When you sell an investment for more than you paid, the profit is a capital gain — and how much tax you owe on it depends on how long you held the asset, your other income and your filing status. This calculator applies the 2026 federal rules published by the IRS in Revenue Procedure 2025-32, adds the 3.8% net investment income tax where it applies, and lets you include a flat state rate.
How to use the capital gains tax calculator
- Choose your filing status and whether you held the asset more than one year (long-term) or one year or less (short-term).
- Enter the purchase price (your cost basis), the sale price and any selling costs such as commissions.
- Enter your other income for 2026. Pick Before deductions to let the calculator subtract the 2026 standard deduction, or Taxable income if you already know that figure.
- Optionally add other investment income (for the NIIT) and a state tax rate.
How capital gains tax is calculated
Long-term gains are stacked on top of ordinary taxable income and taxed by the band they fall into:
Short-term gains are taxed as ordinary income: the tax on (other income + gain) minus the tax on other income alone.
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,451 – $545,500 | $98,901 – $613,700 | $66,201 – $579,600 | $49,451 – $306,850 |
| 20% | over $545,500 | over $613,700 | over $579,600 | over $306,850 |
Thresholds are taxable income, including the gain. Source: IRS Rev. Proc. 2025-32, §4.03.
Worked example
A single filer earns $60,000 in wages and sells shares held for three years, bought for $20,000 and sold for $35,000.
Gain = 35,000 − 20,000 = $15,000
Other taxable income = 60,000 − 16,100 standard deduction = $43,900
The 0% band ends at $49,450, so $5,550 of the gain is taxed at 0% and the remaining $9,450 at 15%
Tax = 9,450 × 15% = $1,417.50 — an effective 9.45% on the gain
Had the shares been held less than a year, the same $15,000 would be taxed at 12% and 22% ordinary rates — $2,650, or $1,232.50 more.
At the other end, a married couple with $700,000 of other income realizing a $200,000 long-term gain pays 20% ($40,000) plus the 3.8% NIIT ($7,600), a combined 23.8%.
Ways to reduce capital gains tax
- Wait for the one-year mark. A gain becomes long-term only if you held the asset more than one year.
- Harvest losses. Selling losers in the same year offsets gains, and up to $3,000 of excess loss offsets other income. Avoid buying the same security within 30 days, or the wash-sale rule disallows the loss.
- Use the 0% band. In a low-income year — a sabbatical, early retirement — long-term gains up to the 0% threshold can be realized tax-free.
- Hold in tax-advantaged accounts. Gains inside a 401(k) or IRA are not taxed when realized.
- Give appreciated shares. Donating stock held over a year to charity can avoid the gain entirely.
Track the trade itself with the stock profit calculator, combine multiple purchases with the average cost calculator, and see your full tax picture with the federal income tax calculator.
This is an estimate for planning based on 2026 IRS figures, not tax advice. It does not model collectibles (28% maximum rate), unrecaptured Section 1250 gain, the home-sale exclusion, the alternative minimum tax or how this gain interacts with other credits and deductions.
Frequently asked questions
What are the 2026 long-term capital gains tax brackets?
Per IRS Rev. Proc. 2025-32, the 0% rate applies to taxable income up to $49,450 for single filers, $98,900 for married couples filing jointly and $66,200 for heads of household. The 15% rate runs up to $545,500 (single), $613,700 (joint) and $579,600 (head of household). Above those, the rate is 20%.
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% in 2026. The same gain held just over a year can be taxed at 0%, 15% or 20% instead.
What is the net investment income tax?
It is an extra 3.8% federal tax on the smaller of your net investment income or the amount by which modified AGI exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). These thresholds are set by statute and are not adjusted for inflation.
How much of a capital loss can I deduct?
Capital losses first offset capital gains. If losses exceed gains, up to $3,000 a year ($1,500 if married filing separately) can offset other income, and any remainder carries forward to future years indefinitely.
Why does my gain not all get taxed at the same rate?
Long-term gains are stacked on top of your ordinary taxable income. If your ordinary income sits below a bracket threshold, the first part of the gain fills the 0% or 15% band and only the rest is taxed at the next rate.