Separate ordinary and preferential income
Short term capital gains are generally taxed as ordinary income. Net long term gains and qualified dividends can use 0%, 15%, and 20% federal rates when eligibility rules are met.
Holding period, dividend qualification, loss netting, and special asset categories determine which bucket applies before rate stacking begins.
How capital gain stacking works
Apply adjustments and deductions, calculate ordinary taxable income, then place preferential taxable income directly above it. The combined position determines how much gain fits in each preferential band.
This is why two taxpayers with the same gain can owe different federal capital gains tax.
The 3.8% Net Investment Income Tax
NIIT applies to the lesser of net investment income or modified adjusted gross income above the statutory threshold. The threshold is $200,000 for single and head of household, $250,000 for married filing jointly and qualifying surviving spouse, and $125,000 for married filing separately.
NIIT is added after the preferential capital gain calculation. A 15% capital gain can therefore face an additional 3.8% federal tax.
Worked example: $40,000 ordinary taxable income and $20,000 gain
Investment tax limitations
Related calculators
Apply this guide with a focused calculator that shows its inputs, assumptions, worked example, and federal limitations.
- Capital gains taxNet short term and long term capital gains or losses, stack qualified dividends, and estimate the federal income tax effect.
- Qualified dividends taxStack qualified dividends above ordinary taxable income to show the supported federal preferential-rate allocation.
- NIITApply the 3.8 percent NIIT to the lesser of supported net investment income or excess modified AGI.
Frequently asked questions
Can long term capital gains be taxed at 0%?
Yes, when the gain fits inside the 0% threshold after ordinary taxable income is stacked first.
Is NIIT the same as the 20% capital gains rate?
No. NIIT is a separate 3.8% tax that can apply in addition to the preferential capital gain rate.
Primary sources
Afterax uses official IRS material where available and names other authorities when a cross-state comparison is required.
- IRS Revenue Procedure 2024-40
- IRS Revenue Procedure 2025-32
- IRS questions and answers on the Net Investment Income Tax
- IRS Topic 409, capital gains and losses
Rules can change, and eligibility depends on facts not captured by a general guide. Confirm the current form instructions before filing or making a material transaction.
Keep exploring
Browse all twelve US tax guides or move from explanation to a transparent federal estimate.