How capital gains are taxed
When you sell an investment for more than you paid, the profit is a capital gain. If you held the asset for one year or less, it is a short-term gain, and it is added to your other income and taxed at your ordinary rate of 10% to 37%. If you held it for more than one year, it is a long-term gain, which gets lower rates of 0%, 15% or 20% depending on your total taxable income. This calculator applies those rules for the 2026 tax year using the figures in IRS Revenue Procedure 2025-32.
The 2026 long-term thresholds
| Filing status | 0% up to | 15% up to | 20% above |
|---|---|---|---|
| Single | $49,450 | $545,500 | $545,500 |
| Married filing jointly | $98,900 | $613,700 | $613,700 |
| Head of household | $66,200 | $579,600 | $579,600 |
| Married filing separately | $49,450 | $306,850 | $306,850 |
The thresholds apply to taxable income, which is income after deductions. Gains are “stacked” on top of your ordinary income: your ordinary income fills the lowest brackets first, and the gain sits above it. A single filer with $40,000 of other taxable income and a $30,000 long-term gain has $9,450 of gain below the $49,450 line, taxed at 0%, and $20,550 above it, taxed at 15%. The federal tax on the gain is $3,082.50, a blended 10.3%. The calculator performs exactly this stacking, including when your income is high enough that part of the gain lands in the 20% range.
The 3.8% net investment income tax
Higher earners may also owe the net investment income tax (NIIT), a 3.8% surtax on the smaller of your net investment income or the amount your modified adjusted gross income exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). Those thresholds are set in the statute and are not adjusted for inflation. Net investment income includes capital gains, interest, dividends and rental income, but not wages. Enter your adjusted gross income before the gains, or leave it blank to let the tool estimate it from your taxable income and the standard deduction, and add other interest and dividends in the last field. Example: a married couple with $250,000 of other taxable income (about $282,200 AGI) and a $100,000 long-term gain pays $15,000 at 15% plus $3,800 of NIIT, a blended 18.8%.
Losses, netting and carryovers
Gains and losses are netted before tax. Short-term results are netted with short-term, long-term with long-term, and then a net loss in one group offsets a net gain in the other. If the whole year is a net loss, you can deduct up to $3,000 against other income ($1,500 if married filing separately) and carry the rest forward indefinitely. Enter losses as negative numbers. The tool shows the deduction and carryforward when your result is a loss.
Using the 0% room figure
The last line shows how much more long-term gain you could realize this year and still be in the 0% bracket. People with low taxable income, such as early retirees living off savings, can sell appreciated investments up to that line and immediately repurchase them, resetting their cost basis higher without paying federal tax. This is sometimes called gain harvesting. Remember that the extra income can reduce ACA premium tax credits, raise taxes on Social Security benefits and affect state taxes, so check those effects before selling. Our guide to capital gains tax rates goes through the rules in more depth.
What this calculator leaves out
- State taxes. Most states tax gains as ordinary income; a few have no income tax at all.
- Collectibles and real estate depreciation. Gains on collectibles are taxed up to 28%, and unrecaptured section 1250 gain on depreciated real estate up to 25%.
- Home sale exclusion. Up to $250,000 ($500,000 joint) of gain on a main home may be excluded entirely.
- Qualified dividends. They are taxed at the same 0/15/20 rates; add them to your long-term gain figure for a rough result.