"/>
Investment Free • No signup required

Capital Gains Tax Calculator

Estimate capital gains tax on the sale of stocks, crypto, or real estate.

Estimate capital gains tax

2024 federal rates: short-term uses ordinary brackets, long-term uses 0/15/20% LTCG brackets plus 3.8% NIIT for high earners.

$
$
$

Your ordinary taxable income from wages, salary, interest, etc.—not including the capital gain being calculated.

"/> How to use this calculator

  1. Enter your purchase price (cost basis)—what you originally paid, including any reinvested dividends and adjustments.
  2. Enter your sale price (gross proceeds before commissions).
  3. Select the holding period—long-term (over 1 year) qualifies for preferential 0/15/20% rates; short-term is taxed as ordinary income.
  4. Pick your filing status—this determines your LTCG bracket thresholds and NIIT threshold.
  5. Enter your other taxable income—ordinary income from wages, interest, etc., excluding this gain. The LTCG brackets stack on top of this.
  6. Click Calculate to see the gain, federal tax owed, effective rate, NIIT (if applicable), and net proceeds.
HOW IT WORKS

How capital gains tax works

When you sell a capital asset—stocks, bonds, real estate, cryptocurrency, even collectibles—for more than you paid, the profit is a capital gain subject to federal tax. The rate depends on two things: how long you held the asset (the holding period) and your overall taxable income. Holding an asset for more than one year before selling unlocks dramatically lower "long-term" rates; selling after one year or less triggers "short-term" rates that match ordinary income tax brackets.

Short-term vs long-term: the one-year cliff

The single biggest lever investors control is when they sell. A short-term gain (held one year or less) is taxed at ordinary income rates up to 37% federally. A long-term gain (held more than one year) qualifies for the preferential 0%, 15%, or 20% LTCG rates. For a top-bracket taxpayer, the difference can be 17 percentage points or more. Holding an asset just one extra day past the one-year mark can save tens of thousands of dollars on a large gain.

The 2024 long-term capital gains brackets

LTCG brackets are stacked on top of ordinary income. Your other taxable income fills the brackets first, then your long-term gain fills the remaining space:

  • 0% rate applies when total taxable income is at or below $47,025 (single), $63,000 (HoH), or $94,050 (MFJ).
  • 15% rate applies when total taxable income falls between the 0% threshold and $518,900 (single), $551,350 (HoH), or $583,750 (MFJ).
  • 20% rate applies to taxable income above those 15% thresholds.

Because the brackets stack, a single filer with $30,000 of ordinary income and a $50,000 long-term gain has taxable income of $80,000—$17,025 fits in the 0% bracket (from $30,001 to $47,025), and the remaining $32,975 is taxed at 15%. The effective rate on the gain is just 9.9%, even though the top marginal rate is 15%.

The 3.8% Net Investment Income Tax (NIIT)

High earners face an additional surcharge: a 3.8% tax on the lesser of (a) net investment income, or (b) the amount by which modified adjusted gross income exceeds $200,000 (single/HoH) or $250,000 (MFJ). For a large long-term gain, this typically means the entire gain is subject to NIIT. Combined with a 20% top LTCG rate, the effective top federal rate on investment income is 23.8%—before any state tax.

Special assets and rules

Primary residences qualify for the Section 121 exclusion: $250,000 of gain ($500,000 MFJ) is tax-free if you owned and lived in the home for 2 of the past 5 years. Investment real estate is subject to depreciation recapture (capped at 25%) plus capital gains, but a 1031 exchange can defer gains if you reinvest in like-kind property within set timelines. Collectibles (art, coins, gold) are taxed at a 28% top LTCG rate. Cryptocurrency is treated as property by the IRS—every crypto-to-fiat, crypto-to-crypto, or crypto-to-goods transaction is a taxable event.

Tax-loss harvesting

You can offset unlimited capital gains with capital losses, plus up to $3,000 of ordinary income per year ($1,500 if married filing separately), carrying forward any excess. Strategic loss harvesting—selling underwater positions to offset gains elsewhere—is one of the most powerful year-end tax moves. Beware the wash-sale rule: you cannot repurchase the same or a "substantially identical" security within 30 days before or after the sale, or the loss is disallowed.

What this calculator doesn't capture

This tool estimates federal capital gains tax using 2024 brackets. It excludes state capital gains taxes (which most states tax as ordinary income—California's top rate is 13.3%), the Section 121 home exclusion, depreciation recapture, qualified small business stock exclusions, wash-sale interactions, and any foreign tax credits. For multi-asset portfolios or significant transactions, work with a qualified CPA.

"/> Worked example

Scenario: Single filer, $85,000 other taxable income, sold stock for $120,000 that was purchased for $50,000 more than 2 years ago.

  • Cost basis: $50,000
  • Sale price: $120,000
  • Long-term gain: $120,000 − $50,000 = $70,000
  • Total taxable income: $85,000 + $70,000 = $155,000

LTCG bracket calculation (single, 2024):

  • 0% bracket fills with ordinary income up to $47,025 — only $0 of the gain fits (because $85,000 ordinary already exceeds the 0% threshold)
  • 15% bracket: $155,000 total income is below the $518,900 15% cap — entire $70,000 gain at 15%
  • LTCG tax: $70,000 × 15% = $10,500

NIIT check: Total income $155,000 is below the $200,000 single threshold—no NIIT owed.

  • Total tax on gain: $10,500
  • Effective rate: $10,500 ÷ $70,000 = 15.0%
  • Net proceeds after tax: $120,000 − $10,500 = $109,500

If the same position had been sold after one year or less, the $70,000 gain would have stacked on top of $85,000 ordinary income—pushing the marginal rate to 24% and the tax on the gain to roughly $16,800, a $6,300 difference for waiting just a few extra days.

"/> Glossary

Cost basis
What you paid for an asset, plus adjustments (reinvested dividends, improvement costs). Used to calculate the gain when you sell.
Short-term capital gain
Profit on an asset held one year or less. Taxed as ordinary income at rates up to 37% federally.
Long-term capital gain (LTCG)
Profit on an asset held more than one year. Taxed at preferential rates of 0%, 15%, or 20% based on total taxable income.
Net Investment Income Tax (NIIT)
A 3.8% surcharge on investment income for high earners—those with modified AGI above $200,000 (single/HoH) or $250,000 (MFJ).
Tax-loss harvesting
Selling investments at a loss to offset capital gains, plus up to $3,000 of ordinary income per year. Subject to the 30-day wash-sale rule.
Section 121 exclusion
Excludes up to $250,000 ($500,000 MFJ) of gain on the sale of a primary residence if you owned and lived in it 2 of the last 5 years.
FAQ

Frequently asked questions

Quick answers to the most common questions about capital gains tax calculator.

What is the difference between short-term and long-term capital gains?
Short-term gains (assets held one year or less) are taxed at ordinary income rates—up to 37% federally. Long-term gains (assets held more than one year) enjoy preferential rates of 0%, 15%, or 20% depending on your income. The difference can be dramatic—a top-rate taxpayer saves 17%+ by holding just over a year.
What are the long-term capital gains tax brackets for 2024?
For 2024, the 0% rate applies to taxable income up to $47,025 (single) or $94,050 (married). The 15% rate applies from there up to $518,900 (single) or $583,750 (married). The 20% rate applies above those thresholds. High earners also pay a 3.8% Net Investment Income Tax (NIIT) on investment income above $200,000 (single) or $250,000 (married).
What is tax-loss harvesting?
Tax-loss harvesting is selling investments at a loss to offset capital gains. You can offset unlimited gains with losses, plus up to $3,000 of ordinary income per year, carrying forward excess losses. Avoid wash sales by not repurchasing the same or "substantially identical" security within 30 days.
How is real estate taxed differently?
Primary residences qualify for the Section 121 exclusion—$250,000 of gain ($500,000 married) is tax-free if you owned and lived in the home 2 of the last 5 years. Investment real estate is subject to depreciation recapture (25% max) and capital gains, but 1031 exchanges can defer gains if you reinvest in like-kind property.
How is cryptocurrency taxed?
The IRS treats crypto as property. Selling crypto for fiat, trading one crypto for another, or using crypto to buy goods all trigger capital gains/losses based on cost basis vs. proceeds. Receiving crypto as payment is ordinary income. Mining rewards are ordinary income at fair market value when received.
"/>

This calculator is provided for informational and educational purposes only and does not constitute financial, legal, tax, or professional advice. Results are estimates based on the inputs you provide and standard assumptions. Actual figures may vary. Please consult a qualified professional before making financial decisions. Read our full disclaimer.