Capital Gains Tax Calculator

Sold a stock, a rental, crypto, or any other investment? Find out exactly what the IRS will want from your profit. This calculator separates short-term gains (taxed like your paycheck) from long-term gains (taxed at the friendlier 0%, 15%, or 20% rates) and shows the tax, your take-home profit, and your effective rate.

🤑

Capital Gains Tax

2025 tax year (filed 2026)

$
$
$
Capital Gains Tax Owed
Total Gain / Loss
Tax Rate Applied
Profit After Tax
Effective Rate on Gain

How capital gains tax actually works

Here's the part that trips most people up: the IRS doesn't tax your whole sale, only your profit — and how long you held the asset changes everything. If you owned it for one year or less, your gain is "short-term" and gets stacked on top of your salary, taxed at your ordinary income rate (anywhere from 10% to 37%). Hold it for more than a year and it becomes a "long-term" gain, which enjoys special lower rates of 0%, 15%, or 20% depending on your total income. That single year of patience can easily cut your tax bill in half.

Long-term rates are also stacked. Your gain sits on top of your other taxable income, and the portion that falls inside each band is taxed at that band's rate. So a modest earner with a big gain might pay 0% on the first slice and 15% on the rest. That's exactly what this calculator models — it doesn't just slap one flat rate on your profit, it walks the gain through the 0/15/20 thresholds the way a tax pro would.

A few things worth knowing before you sell: your "cost basis" is what you paid plus commissions and any reinvested dividends — getting that number right lowers your taxable gain. Selling at a loss isn't all bad either; capital losses offset capital gains dollar-for-dollar, and up to $3,000 of net loss can offset ordinary income each year. And high earners may owe an extra 3.8% Net Investment Income Tax on top of what you see here — this tool covers the core federal capital gains tax, not state tax or the NIIT surcharge.

One Year Is the Line

Held 366+ days? You unlock the 0/15/20% long-term rates. A day short and it's taxed like ordinary income.

📉

Losses Soften the Blow

Capital losses cancel gains, and up to $3,000 of leftover loss can reduce your regular taxable income.

🧾

Basis Is Your Friend

Cost basis = price paid + fees + reinvested dividends. A higher basis means a smaller taxable gain.

Formula & Logic

Capital gains are taxed on the profit from selling an asset, and the holding period changes the rate dramatically. Assets held over one year qualify for long-term rates of 0%, 15% or 20% — substantially below ordinary income rates — while anything sold within a year is short-term and taxed as ordinary income. The bracket thresholds work unusually: long-term gains stack on top of your ordinary income, so the same gain can straddle two rates. Cost basis is where most errors live, because it includes purchase price plus commissions plus improvements, and reinvested dividends raise the basis of a fund holding.

Gain = Sale proceeds − Cost basisLong-term (held > 1 year): 0% / 15% / 20% depending on total incomeShort-term (≤ 1 year): taxed at ordinary income ratesGains stack on top of ordinary taxable income

where:

Cost basis
purchase price + commissions + improvements + reinvested dividends
Proceeds
sale price net of selling costs
holding period
measured from the day after acquisition to the day of sale

Assumptions: Federal only. Net investment income tax adds 3.8% above $200,000 single / $250,000 joint. State treatment varies widely and several states tax gains as ordinary income. Collectibles and depreciation recapture use different rates.

Step-by-Step Example: A $40,000 Long-Term Gain on $90,000 of Income

A single filer with $90,000 of salary sells stock held three years at a $40,000 profit.

  • Salary$90,000
  • Long-term gain$40,000
  • Holding period3 years
  • Deduction$15,000
  1. Ordinary taxable income: $90,000 − $15,000 = $75,000.
  2. Find the 0% band ceiling for a single filer: roughly $48,350 of taxable income.
  3. Ordinary income already exceeds it, so no part of the gain qualifies for 0%.
  4. The whole gain therefore falls in the 15% band: $40,000 × 15% = $6,000.
  5. Compare with a short-term sale: at a 22% marginal rate the same gain would cost $8,800.
  6. The holding period is worth $2,800 — 7 percentage points on $40,000.

Result$6,000 tax on the gain — $2,800 less than selling before one year

Had ordinary taxable income been only $30,000, the first $18,350 of gain would have been taxed at 0%, cutting the bill to $3,248. This is why realising gains in a low-income year — between jobs, or early in retirement — is one of the few genuinely large levers in personal tax.

FAQ

It comes down to how long you held the asset. One year or less is short-term and is taxed at your ordinary income rate — the same brackets your salary uses, up to 37%. More than one year is long-term and is taxed at preferential rates of 0%, 15%, or 20%. The holding clock starts the day after you buy and ends the day you sell.
If your total taxable income (other income plus the gain) stays under the 0% threshold for your filing status — about $48,350 for single filers and $96,700 for married-filing-jointly in 2025 — your long-term gains are taxed at nothing federally. It's one of the most generous breaks in the tax code, and low-to-moderate earners use it every year to harvest gains tax-free.
No. This calculator estimates the core federal capital gains tax only. Most states tax capital gains as regular income (a handful have no income tax at all), and high earners may owe an additional 3.8% Net Investment Income Tax. Add those separately if they apply to you, and treat this as a planning estimate rather than tax advice.

Related Calculators

✔ Written & reviewed by Dr Sam — 20+ yrs in management & research leadership📅 Last updated June 2026📚 Sources: IRS.gov, U.S. Bureau of Labor Statistics📑 How we build & check these⚖ Educational estimates only — not financial, tax or legal advice