Capital Gains Tax Calculator
See exactly how much federal tax you'll owe when you sell stocks. Enter your purchase and sale prices to instantly estimate short-term or long-term capital gains tax — including the Net Investment Income Tax (NIIT).
Your stock sale
Tell us about the shares you sold.
Your wages, interest, and other income for the year, before this sale.
Shares held over a year qualify for lower long-term rates.
Fill both and the term is set automatically: sale − purchase > 365 days = long-term, otherwise short-term.
Federal tax at different gain levels
Tax on your gain vs. total capital gain — short-term vs. long-term at your filing status & incomeExample calculation
Tax year 2025 Reviewed & verifiedLong-term gain on 100 shares sold after 3 years
How capital gains tax works
When you sell an asset for more than you paid, the profit is a capital gain — and it's generally taxable. When you sell for less, that's a capital loss, which can offset your gains (and up to $3,000 of ordinary income each year).
Your gain is simply your sale price minus your cost basis (what you paid, plus any qualifying adjustments like commissions):
Capital gain = Sale proceeds − Cost basis
Short-term vs. long-term gains
The tax rate depends on how long you held the asset:
- Short-term gains (held 1 year or less) are taxed at your ordinary income tax rates — the same brackets as your wages.
- Long-term gains (held more than 1 year) get preferential rates of 0%, 15%, or 20% depending on your income.
2025 long-term capital gains brackets
| Filing status | 0% rate up to | 15% rate up to | 20% rate over |
|---|---|---|---|
| Single | $48,350 | $533,400 | $533,400 |
| Married filing jointly | $96,700 | $600,050 | $600,050 |
| Married filing separately | $48,350 | $300,000 | $300,000 |
| Head of household | $64,750 | $566,700 | $566,700 |
Taxable income includes your ordinary income plus your long-term gains.
Net Investment Income Tax (NIIT)
If your modified adjusted gross income (MAGI) exceeds $200,000 (single or head of household), $250,000 (married filing jointly), or $125,000 (married filing separately), you may owe an additional 3.8% NIIT on the smaller of your net investment income or the amount your MAGI exceeds the threshold.
What about capital losses?
If your total loss exceeds your gains, you can deduct up to $3,000 against ordinary income each year and carry the rest forward. This calculator shows no tax on a net loss and notes that the loss may offset other gains.
State taxes
This tool estimates federal tax only. Most states also tax capital gains — some at flat rates, others using your state income brackets. Check your state's rules separately.
Related calculators
Frequently asked questions
Disclaimer: This tool provides estimates for educational purposes only and is not tax advice. Rates and thresholds are based on 2025 federal brackets. Actual tax liability depends on your complete tax situation. Consult a qualified tax professional before filing.