Home › Capital Gains Tax Calculator

Capital Gains Tax Calculator

Sold a stock at a profit? Enter what you paid, what you sold for and your tax rate to see your capital gain, the tax you'll owe, and exactly how much you keep after the IRS takes its share.

How the capital gains tax calculator works

Answer first: your capital gain is what you sold for minus what you paid (your cost basis). The tax is that gain multiplied by your capital gains rate. This capital gains tax calculator gives you the gain, the tax owed, and what you actually keep after the tax bill.

Tax = (Proceeds − Cost basis) × Rate
Example: bought for $10,000, sold for $18,000, long-term rate 15%. Gain = $8,000. Tax = $8,000 × 15% = $1,200. You keep $6,800 of the gain and walk away with $16,800.

The single biggest lever here is the rate, and the rate depends on how long you held. In the U.S., assets held one year or less are taxed as short-term gains at your ordinary income rate (often 22–37%), while assets held longer than a year get the lower long-term rates of 0%, 15% or 20% for most investors. Holding 366 days instead of 365 can roughly halve the tax — one reason patient investing is tax-efficient investing.

Short-term vs long-term in one glance

Cost basis is where people slip up

Your cost basis isn't just the share price — it includes commissions and is adjusted for reinvested dividends and stock splits. Use your total purchase cost and total proceeds (after selling fees) in the boxes above for an accurate gain. Tax-loss harvesting, the wash-sale rule, state taxes, and the net investment income tax can all change the final number.

Reality check: It uses a single flat rate you enter and ignores tax brackets, the 0%/15%/20% thresholds, state taxes, the net investment income tax, and the wash-sale rule. It is not tax advice — consult a qualified tax professional or the IRS. This is an educational calculator, not financial advice — verify your own numbers and see the U.S. SEC at investor.gov.

Learn the rules in what are capital gains taxes, see how dividends are taxed differently in what are dividends, and project a tax-sheltered account with the retirement savings calculator.

Last updated 21 June 2026 · Written by Mustafa Bilgic. Educational only — not financial advice.

FAQ

Frequently asked questions

How do you calculate capital gains tax on stocks?

Subtract your cost basis (what you paid, including fees) from your sale proceeds to get the gain, then multiply the gain by your capital gains tax rate. The calculator does this and also shows your net profit after tax.

What is the difference between short-term and long-term capital gains?

Assets held one year or less are short-term and taxed at your ordinary income rate. Assets held longer than a year are long-term and taxed at the lower 0%, 15% or 20% rates for most U.S. investors.

Do I pay tax if I sell at a loss?

No. A capital loss is not taxed, and it can offset capital gains dollar-for-dollar. Up to $3,000 of net capital loss per year can also offset ordinary income, with the rest carried forward.

Is this capital gains calculator accurate for my taxes?

It gives a clean estimate from a single flat rate. Real tax depends on your bracket, the 0%/15%/20% thresholds, state tax, the net investment income tax and the wash-sale rule. Confirm with a tax professional or the IRS.

Keep learning

More tools & games

Sponsored: recommended resources →