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 |
In short: In 2026, gains on assets held over a year are taxed at 0%, 15% or 20%: 0% up to $49,450 of taxable income for single filers ($98,900 jointly). Shorter holdings are taxed as ordinary income.
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
- The calculatorHourly to salary
Related calculators
Three worked examples for 2026
1. A gain taxed at 0%
A married couple filing jointly with $70,000 of other income sells shares held for three years, with a $40,000 long-term gain.
- Taxable income before the gain: $70,000 − $32,200 = $37,800.
- Room left in the 0% band: $98,900 − $37,800 = $61,100.
- The whole $40,000 gain fits: federal tax on the gain $0.
2. A gain that straddles two rates
A single filer with $55,000 of other income and a $30,000 long-term gain.
- Taxable income before the gain: $55,000 − $16,100 = $38,900.
- At 0%: the $10,550 up to $49,450.
- At 15%: the other $19,450 = $2,917.50.
- Tax on the gain: $2,917.50, an average of 9.7%. The bands apply to each tax year separately.
3. When the 3.8% tax kicks in
A single filer with $190,000 of wages and a $50,000 long-term gain.
- Taxable income before the gain: $173,900, so the gain is taxed at 15%: $7,500.
- Modified AGI: $240,000, which is $40,000 over the $200,000 threshold. The net investment income tax is 3.8% of the smaller of the gain ($50,000) and the excess ($40,000): $1,520.
- Total federal tax on the sale: $9,020. The 3.8% tax doesn’t apply to wages; it is figured on Form 8960.
Rules that change the result
- Counting the year: the IRS counts from the day after you acquired the asset up to and including the day you sell. Selling one day too early makes the gain short-term.
- Wash sales: a loss on stock or securities can’t be deducted if, within 30 days before or after the sale, you buy substantially identical securities, including inside an IRA or Roth IRA, or your spouse does. The disallowed loss is added to the cost of the new shares.
- Crypto: for US tax purposes digital assets are property, not currency, so selling, swapping or spending them can create a gain or loss. Every return asks a yes-or-no question about digital asset transactions; simply buying with dollars and holding, or moving coins between your own wallets, is a “No”.
- Personal items at a loss: losses on personal-use property, such as your car or home, aren’t deductible.
- Gifts and inheritances: the basis rules are different; IRS Publication 551 explains them.
- Your main home: up to $250,000 of gain ($500,000 jointly) can be excluded if you owned and lived in it for at least 2 of the 5 years before the sale.
After the sale: what to do
- Check the 1099-B from your broker against your own records, especially the cost basis and the purchase date.
- Report each sale on Form 8949 and the totals on Schedule D. A home sale reported on Form 1099-S must be reported even if the whole gain is excluded.
- Avoid an underpayment penalty: a large gain adds tax that wages withholding won’t cover. The IRS notes you may need to raise withholding or estimated tax payments; the Tax Withholding Estimator and Publication 505 help work out how much.
Sources
- IRS: Revenue Procedure 2025-32, 2026 capital gains thresholds (PDF)
- IRS: Topic no. 409, Capital gains and losses
- IRS: Topic no. 559, Net investment income tax
- IRS: Publication 550, Investment income and expenses (wash sales)
- IRS: Digital assets
- IRS: Topic no. 701, Sale of your home
More questions
What is a wash sale?
Selling stock or securities at a loss and buying substantially identical ones within 30 days before or after, including in an IRA or through your spouse. The loss isn’t deductible then; it’s added to the cost of the new shares.
Do I pay capital gains tax on crypto?
Yes. The IRS treats digital assets as property, so selling, trading or spending them can create a taxable gain or a deductible loss, reported like other capital assets.
What are the 2026 capital gains thresholds for head of household?
0% up to $66,200 of taxable income, 15% up to $579,600 and 20% above. For married filing separately, 15% ends at $306,850.
Can I avoid capital gains tax on selling my house?
Up to $250,000 of gain ($500,000 jointly) can be excluded if you owned and used the home as your main residence for at least 2 of the 5 years before the sale.