Capital gains tax calculator
The capital gains tax calculator estimates federal tax on a sale. Long-term gains are stacked on top of your other taxable income, so part of the gain may fall in the zero-rate band, part at the middle rate and part at the top rate. Short-term gains are taxed as ordinary income, and the net investment income tax is added when your income is high enough.
See also: measure the return behind the gain
In force from Checked Rules used
How long-term gains are taxed
Result
How it was calculated
Fill in the fields above to see the result and every step here.
- In force from Checked Source: Rev. Proc. 2024-40 (tax year 2025 inflation adjustments), Rev. Proc. 2025-32 (tax year 2026 inflation adjustments, as amended by OBBBA)
- In force from Checked Source: Rev. Proc. 2025-32 (tax year 2026 inflation adjustments, as amended by OBBBA), IRS releases tax inflation adjustments for tax year 2026
- In force from Checked Source: IRC 1411 Net Investment Income Tax, IRC 1411 Net Investment Income Tax (26 U.S.C. 1411), statute text
Put the gain into a full return estimate →Project the growth of what you keep →
Worked example: gains on top of wages
Short-term gains and the net investment income tax
A gain on something you held for one year or less is a short-term gain. It gets no special rate: it is added to your other taxable income and taxed in the ordinary brackets, from 10% up to 37%. The calculator works out the tax with and without the short-term gain and shows the difference, so a gain that crosses into a higher bracket is taxed correctly in both brackets. Long-term gains are then stacked on top of that larger total, which is why a short-term gain can push part of a long-term gain out of the zero band.
Losses are netted first. A long-term loss reduces a short-term gain, and a short-term loss reduces a long-term gain. If the total is a loss, the tax on gains here is $0.00. On a real return up to a limited amount of a net loss can also be taken off ordinary income and the rest carried to later years; that part is not modelled here.
The net investment income tax is an extra 3.8% on the smaller of your net investment income and the amount by which your modified adjusted gross income is above $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). These thresholds are fixed in the law and are not raised for inflation. Enter your MAGI to include it; if you leave net investment income empty, the calculator uses your net gains.
Method and sources
Long-term gains are stacked on top of other taxable income. For a single filer in 2026 the zero rate applies to taxable income up to $49,450 and the middle rate up to $545,500, with the top rate above that. Short-term gains are added to ordinary income and taxed at ordinary rates. The net investment income tax is 3.8% of the smaller of net investment income and the amount by which income exceeds the threshold, which is $200,000 for a single filer.
What this calculator does not cover
- Collectibles, unrecaptured real estate gains, qualified small business stock and the home-sale exclusion are not included.
- State tax on gains is not included.
- Capital losses net against gains first. A net loss gives zero tax here, and the limited deduction against ordinary income is not modelled.
- Enter your own taxable income. The calculator cannot see the rest of your return.
Rules and calculation checked on Oct 10, 2026.
Questions about capital gains tax
Related calculators
How much capital gains tax calculator?
The tax depends on the size of the gain, how long you held the asset and your other income. For a single filer with other taxable income of $40,000 and a long-term gain of $20,000, federal capital gains tax is $1,582.50, because part of the gain falls in the zero rate band.
How does a capital gains tax calculator work?
It stacks your gain on top of your other taxable income and taxes each slice at the rate for the band it falls in. In the first example, $9,450.00 of the gain is taxed at zero and $10,550.00 at the middle rate, which is why the effective rate is lower than the headline rate.
Work out take-home pay from a UK or US salary. See income tax, National Insurance or payroll tax line by line, with the rules dated and sourced.
Look at your pay from work as wellWork out overtime pay under federal rules, with bonuses in the regular rate, the salaried case, and California's daily overtime and double time.
Results follow the rules named above and are estimates. They are not tax, legal or financial advice and do not replace your pay stub or your tax return.