How it works
A capital gain is what you sold something for minus what you paid, including fees. If you owned it for more than a year, the gain is long-term and taxed at 0%, 15% or 20%. If you owned it a year or less, it is short-term and taxed at the same rates as your wages.
Long-term gains are stacked on top of your other taxable income. Your deductions are used up by ordinary income first, then the part of the gain that fits under the 0% limit is tax-free, the part up to the 15% limit is taxed at 15%, and anything above that at 20%. That is why a gain can be partly tax-free even though the rest is taxed. The calculator figures the tax with and without the sale and shows the difference.
Higher earners also owe the 3.8% net investment income tax on the smaller of their investment income and the amount their modified AGI is over $200,000 ($250,000 married filing jointly, $125,000 married filing separately). These thresholds are set in law and are not adjusted for inflation. Other investment income such as dividends also counts toward it, so enter those in other income.
If you sold at a loss, up to $3,000 ($1,500 married filing separately) of net loss a year comes off your other income and the rest carries forward with no time limit. Selling losing positions before December 31 to offset gains is called tax-loss harvesting. Buying the same or a substantially identical investment within 30 days before or after the sale triggers the wash-sale rule and the loss is disallowed for now.
Formula
Tax on the gain = tax on (other income + gain) − tax on other income, with long-term gains taxed at 0%, 15% or 20% above ordinary taxable income, plus 3.8% × the smaller of the gain and (MAGI − NIIT threshold).
2026 long-term capital gains brackets
| Rate | Single | Married filing jointly | Head of household | Married filing separately |
|---|---|---|---|---|
| 0% | up to $49,450 | up to $98,900 | up to $66,200 | up to $49,450 |
| 15% | $49,450 – $545,500 | $98,900 – $613,700 | $66,200 – $579,600 | $49,450 – $306,850 |
| 20% | over $545,500 | over $613,700 | over $579,600 | over $306,850 |
The limits apply to total taxable income, including the gain. Source: IRS Revenue Procedure 2025-32, section 4.03.
Sources
- IRS Rev. Proc. 2025-32: 2026 inflation adjustments, sec. 4.03 maximum capital gains rate amounts
- IRS Topic no. 409: Capital gains and losses
- IRS Topic no. 559: Net investment income tax
Questions people ask
What are the 2026 capital gains tax brackets?
Long-term gains are taxed at 0% while total taxable income is up to $49,450 single or $98,900 married filing jointly, 15% up to $545,500 single or $613,700 joint, and 20% above that. Head of household limits are $66,200 and $579,600.
How much tax do I pay on $20,000 of long-term gains?
It depends on your other income. A single filer with $80,000 of other income is already past the 0% limit after the standard deduction, so the whole $20,000 is taxed at 15%: $3,000 federal. With $40,000 of other income, part of it would be taxed at 0%.
How are short-term capital gains taxed?
Gains on assets held one year or less are added to your ordinary income and taxed at your regular bracket rates, from 10% to 37%.
How much of a capital loss can I deduct?
Losses first offset your capital gains. If losses are larger, up to $3,000 a year ($1,500 married filing separately) comes off other income, and the rest carries forward to future years.