US capital gains tax calculator 2026: stocks, crypto and funds
Enter what you sold, what you paid and your other income to see the federal tax on the gain, the rate that applies and the 3.8% investment income tax.
Federal tax on the sale
$3,000.00
on a gain of $20,000 · 15.0% of the gain
- Gain $20,000
- 15% rate
- No 3.8% tax
You sell for $50,000 and paid $30,000, so the gain is $20,000. As a single filer with $80,000 of other income, your taxable income before the gain is $63,900. Held over a year, the gain is long-term and your marginal capital gains rate is 15%. The tax is $3,000.00.
Your income is under the threshold for the 3.8% net investment income tax, so only the capital gains tax applies.
- Gains on collectibles such as art and coins, and on some small business stock, can be taxed at up to 28%, and part of the gain on real property at up to 25%. The calculator does not include them.
- State taxes, qualified dividends, your other gains and losses for the year and assets you were given or inherited are not included. Not tax advice.
Your gain
- Federal tax$3,00015%
- What you keep$17,00085%
I’m not an accountant or a financial advisor. This is an estimate, for information only. Check with a professional before you decide.
Show the detailsHide the details
| What you sold it for | $50,000.00 | |
|---|---|---|
| − | What you paid (cost basis) | $30,000.00 |
| = | Gain | $20,000.00 |
| 15% capital gains rateon $20,000 | $3,000.00 | |
| = | Capital gains tax | $3,000.00 |
| = | Federal tax on the sale | $3,000.00 |
How it works
- The gain is what you sold for minus what you paid (your cost basis). A gain on an asset held more than one year is long-term; held a year or less, it is short-term and taxed as ordinary income.
- For a long-term gain, take your other income minus the standard deduction and add the gain on top. The part of the gain that falls up to the first threshold is taxed at 0%, up to the second at 15%, and above it at 20%.
- If your income, including the gain, is over $200,000 (single or head of household), $250,000 (jointly) or $125,000 (married filing separately), a 3.8% tax applies to the lesser of the gain or the excess over the threshold.
Worked example
Single, $80,000 of other income, a $20,000 long-term gain: taxable income before the gain is $80,000 − $16,100 = $63,900, above the 0% limit of $49,450, so the whole gain is taxed at 15%: $3,000, and no 3.8% tax. As a short-term gain it would be taxed at your 22% rate: $4,400.
Sources
- IRS — Topic no. 409, Capital gains and losses
- IRS — Topic no. 559, Net investment income tax
- IRS — Revenue Procedure 2025-32 (2026 inflation adjustments)
Text checked on October 13, 2026
Good to know
- The holding period decides the rate: only more than one year makes the gain long-term. Check the purchase and sale dates on your broker statement before you sell.
- Capital losses are useful: they offset gains, and up to $3,000 a year ($1,500 if married filing separately) can reduce other income, with the rest carried forward.
- The rate depends on your total taxable income, so a large gain can push part of itself into the 15% or 20% band, and a gain in a year with low income can be taxed at 0%.
- Your broker reports sales on Form 1099-B, and you report them on Form 8949 and Schedule D. Keep your purchase records, because the cost basis decides the gain.
- This is an estimate for one sale. With several sales, dividends or carried-over losses, use tax software or the IRS worksheets.
Frequently asked questions
How is capital gains tax calculated?
The gain is the sale price minus your cost basis. Long-term gains are taxed at 0%, 15% or 20% depending on your taxable income, and short-term gains at your ordinary income tax rates.
What is the long-term capital gains rate in 2026?
0% if your taxable income is up to $49,450 (single) or $98,900 (married filing jointly), 15% up to $545,500 (single) or $613,700 (jointly), and 20% above that.
What is the difference between short-term and long-term?
Long-term means you held the asset for more than one year. Short-term gains, from assets held a year or less, are taxed as ordinary income, which is usually a higher rate.
What is the 3.8% net investment income tax?
An extra tax on the lesser of your net investment income or the amount your income is over $200,000 (single, head of household), $250,000 (jointly) or $125,000 (separately).
Can I deduct a capital loss?
A loss offsets capital gains first. If your losses are more than your gains, you can deduct up to $3,000 ($1,500 if married filing separately) against other income and carry the rest to later years.
Next step
- The calculatorUS federal income tax calculator 2026
- The calculatorUS home sale capital gains tax calculator 2026
- The short guideUS capital gains tax explained: rates, thresholds and losses
- The routeYour pay and taxes in the US