Guide

Investing and gains · 11 min read

Capital gains, qualified dividends, and NIIT

Preferential income does not start at zero. It stacks above ordinary taxable income, and higher-income investors may also face NIIT.

By AfteraxLast reviewed July 24, 2026US tax years 2025 and 2026

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

Apply this guide with a focused calculator that shows its inputs, assumptions, worked example, and federal limitations.

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.

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.

Try the calculators

General US federal tax information · State rules are separate · Not tax, legal, or financial advice