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).

2025 federal brackets NIIT included Shareable results

Your stock sale

Tell us about the shares you sold.

$

Your wages, interest, and other income for the year, before this sale.

$
$
shares
Holding period

Shares held over a year qualify for lower long-term rates.

Holding dates (optional — auto-sets the term)

Fill both and the term is set automatically: sale − purchase > 365 days = long-term, otherwise short-term.

Include losses
Apply net capital losses to your gain
Apply NIIT
3.8% Net Investment Income Tax if your MAGI exceeds the threshold
Estimated federal tax
$0
Long-term • effective 0.0%

Federal tax at different gain levels

Tax on your gain vs. total capital gain — short-term vs. long-term at your filing status & income

Example calculation

Tax year 2025 Reviewed & verified

Long-term gain on 100 shares sold after 3 years

Buy price / share$50.00
Sell price / share$80.00
Number of shares100
Cost basis$5,000
Sale proceeds$8,000
Capital gain$3,000
Other taxable income (single)$75,000
Estimated federal tax$450 — taxed at the 15% long-term rate

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 status0% rate up to15% rate up to20% 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

For assets held more than one year, the federal long-term capital gains rates are 0%, 15%, and 20%, depending on your taxable income. Assets held one year or less are taxed as ordinary income at rates from 10% to 37%. A 3.8% NIIT can also apply to high earners.
Subtract your cost basis (purchase price × shares, plus commissions) from your sale proceeds. That's your gain. Then apply the short-term or long-term rates above based on how long you held the shares.
In 2025, single filers with taxable income up to $48,350 (and joint filers up to $96,700) pay 0% federal tax on long-term capital gains. That's a powerful reason to realize gains in low-income years.
The Net Investment Income Tax adds 3.8% on the smaller of your net investment income or the amount your MAGI exceeds $200,000 (single), $250,000 (joint), or $125,000 (married filing separately). Toggle "Apply NIIT" in the calculator to see the impact.
Yes. Losses first offset gains, then up to $3,000 of ordinary income per year. Remaining losses carry forward indefinitely. Note the wash-sale rule: buying a substantially identical security within 30 days disallows the loss.
This calculator estimates federal tax only. It doesn't include state taxes, the alternative minimum tax (AMT), wash-sale adjustments across multiple transactions, or qualified small business stock (QSBS) exemptions.

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.