Money

Capital Gains Tax Calculator: What You Owe When You Sell Stock

The federal tax on your profit, and what you keep after selling

This capital gains tax calculator works out the federal tax when you sell stock in 2026: enter the shares, the purchase and sale price, your fees and your income, and you get the tax at the 0%, 15% or 20% long-term rate or at your ordinary bracket, plus the net investment income tax if it applies.

Income before the sale: your adjusted gross income for the year without this sale (wages, interest, other gains). We subtract the 2026 standard deduction to find your bracket. State income tax is not included.

Result$447.00Federal tax on this sale
Long-termGain $2,980.00Effective rate 15.0%
Taxed at 0%: $0.00 · at 15%: $2,980.00 · at 20%: $0.00Based on 3 official sources · reviewed November 12, 2026
Instantthe result updates as you type
Official sourceIRS Revenue Procedure 2025-32: 2026 inflation adjustments
11/12/2026last reviewed
0 datasent: everything runs in your browser

The key idea

Waiting one more day can cut your tax rate

Stock held more than one year pays the long-term rate: 0% for a single filer with taxable income up to $49,450 in 2026, 15% up to $545,500 and 20% above. Sell after a year or less and the gain is taxed like your salary, at up to 37%. On a $2,980 gain with $80,000 of income, that is $447 of tax instead of $655.60.

01

How it is calculated

Your capital gain is what you get from the sale minus what you paid, including commissions and fees (your cost basis):

Gain = shares × (sale price − purchase price) − fees

Long-term gains, on stock held more than one year, are taxed at 0%, 15% or 20%. The rate depends on your taxable income, and the gain sits on top of your other income. In 2026 (IRS Rev. Proc. 2025-32):

Filing status0% up to15% up to20% above
Single$49,450$545,500$545,500
Married filing jointly$98,900$613,700$613,700
Head of household$66,200$579,600$579,600
Married filing separately$49,450$306,850$306,850

Short-term gains, on stock held one year or less, are taxed as ordinary income, from 10% to 37%.

On top, the net investment income tax adds 3.8% when your modified adjusted gross income passes $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). It applies to the smaller of your investment income and the excess over the threshold. The calculator takes your taxable income as your income before the sale minus the standard deduction.

02

Worked example

A single filer with $80,000 of income sells 100 shares bought at $50 for $80 after more than a year, with $20 of fees. The gain is $8,000 − $5,000 − $20 = $2,980. Taxable income before the sale is $80,000 − $16,100 = $63,900, above the 0% limit, so the whole gain pays 15%: $447. Sold within a year, it would pay the 22% bracket: $655.60.

Official sources

By Javier Mohíno · Reviewed on 11/12/2026 · How we review our calculators · Spot an error? Let us know

Common questions

Frequently asked questions

Back to the calculator
What is the capital gains tax rate for 2026?

0%, 15% or 20% on long-term gains, depending on your taxable income. A single filer pays 0% up to $49,450, 15% up to $545,500 and 20% above; married couples filing jointly, 0% up to $98,900 and 15% up to $613,700.

How long do I have to hold stock to pay the long-term rate?

More than one year. Shares sold after one year or less produce a short-term gain, taxed at your ordinary income tax rate.

Do I pay tax on stock I have not sold?

No: a rise in the price of shares you still own is not taxed. You pay when you sell at a gain, and on any dividends you receive.

Can I deduct a loss on stock?

Yes: capital losses offset capital gains, and a net loss offsets up to $3,000 of other income a year ($1,500 if married filing separately). The rest carries forward to later years.

What is the 3.8% tax on investment income?

The net investment income tax: 3.8% on investment income, including capital gains, when your modified adjusted gross income passes $200,000 for single filers or $250,000 for married couples filing jointly.

Do commissions reduce my capital gain?

Yes: fees and commissions are part of your cost basis and reduce the gain you are taxed on.

Your next calculation

Missing a calculator?

Tell us what you need to calculate. The most requested ones are the first we build, with their formula, a worked example and the source.

Embed this calculator

Paste this code into your website or blog. It is free and updates itself.

Save this calculation

Give it a name so you can find it later. It is stored only in your browser.