Capital Gains Tax Calculator

Capital gains tax depends on three things: how long you held the asset (long-term vs short-term), how much you made (the gain), and your total income (which determines your bracket). Long-term gains (held 1+ year) get preferential rates of 0%, 15%, or 20%. Short-term gains are taxed as ordinary income at 10-37%. High earners may also owe the 3.8% Net Investment Income Tax (NIIT). Our calculator handles all 2024 federal brackets for single, married filing jointly, and head of household, plus optional state tax.

star 4.9
auto_awesome AI
New

receipt_longInvestment Details

paymentsTax Breakdown

Net Profit After Tax
$4,208
From $4,950 net gain
Long-term
Federal Tax
$743
Federal Rate
15%
State Tax
$0
NIIT (3.8%)
$0
Total Tax
$743
15% LTCG bracket

tips_and_updates Tips

  • Hold investments for at least 1 year + 1 day to qualify for long-term rates
  • Tax-loss harvesting: offset gains with realized losses to reduce tax
  • 0% LTCG bracket exists for low-to-middle earners — useful for retirees
  • NIIT (3.8%) applies above $200k single / $250k married — plan around it
  • Real estate primary home: $250k single / $500k married exclusion
  • Wash sale rule: can't claim loss if you rebuy same security within 30 days
  • Crypto is taxed like property, not currency — every trade is a taxable event
  • Hold tax-inefficient assets (REITs, bonds) in IRAs to avoid annual tax drag

How to Use This Calculator

1

Enter purchase + sale price

How much you paid and what you sold for.

2

Set holding period in months

12+ months qualifies for long-term rates.

3

Choose filing status + income

Determines which LTCG bracket applies.

4

Add fees and state rate

Optional but improves accuracy.

5

Review tax breakdown

See federal, state, NIIT, and net profit after tax.

The Formula

Long-term gains (1+ year holding) get the lowest tax rates — 0% if you're in low tax brackets, 15% for most taxpayers, 20% for very high earners. Short-term gains (under 1 year) are taxed at your ordinary income rate, which can be much higher. This is why long-term investing is tax-efficient.

Net Gain = (Sale Price − Purchase Price − Fees); Tax = Net Gain × Federal Rate + Net Gain × State Rate + NIIT (if applicable)

lightbulb Variables Explained

  • Net Gain Profit after deducting purchase cost and selling fees
  • Federal Rate 0/15/20% LTCG, or 10-37% ordinary STCG
  • State Rate Varies by state (0% in TX/FL, 13.3% in CA)
  • NIIT 3.8% extra for MAGI over $200k single / $250k married

tips_and_updates Pro Tips

1

Hold investments for at least 1 year + 1 day to qualify for long-term rates

2

Tax-loss harvesting: offset gains with realized losses to reduce tax

3

0% LTCG bracket exists for low-to-middle earners — useful for retirees

4

NIIT (3.8%) applies above $200k single / $250k married — plan around it

5

Real estate primary home: $250k single / $500k married exclusion

6

Wash sale rule: can't claim loss if you rebuy same security within 30 days

7

Crypto is taxed like property, not currency — every trade is a taxable event

8

Hold tax-inefficient assets (REITs, bonds) in IRAs to avoid annual tax drag

Capital gains tax applies when you sell an asset — stocks, bonds, real estate, cryptocurrency, or collectibles — for more than your purchase price. The tax rate depends on how long you held the asset and your total taxable income. Short-term capital gains on assets held less than one year are taxed as ordinary income at rates from 10% to 37%. Long-term capital gains on assets held longer than one year receive preferential rates of 0%, 15%, or 20%. This capital gains tax calculator estimates your federal and state tax liability from any asset sale, factoring in your filing status, total income, holding period, purchase and sale prices, and transaction fees. It identifies whether your gain qualifies for long-term or short-term treatment, applies the correct 2024 federal bracket, adds the 3.8% Net Investment Income Tax (NIIT) for high earners, and includes optional state capital gains tax. The result shows your total tax bill, effective tax rate, and after-tax profit — the information you need to plan asset sales strategically and minimize your tax burden through timing, tax-loss harvesting, and other legitimate strategies.

2024 Long-Term Capital Gains Tax Brackets

For 2024, long-term capital gains tax rates depend on your taxable income and filing status. Single filers pay 0% on gains up to $47,025, 15% on gains from $47,026 to $518,900, and 20% on gains above $518,900. Married filing jointly, the thresholds are $94,050 for the 0% bracket and $583,750 for the 20% bracket. These brackets are indexed for inflation annually. The 0% bracket is particularly valuable for retirees and others with moderate income — if your total taxable income including gains stays below the threshold, you owe zero federal tax on those gains. Strategic tax planning involves 'filling up' the 0% bracket each year by selling appreciated assets in low-income years. Additionally, taxpayers with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly) owe an additional 3.8% NIIT on the lesser of net investment income or the excess over the threshold. Combined, the maximum federal rate on long-term gains is 23.8%.

Short-Term vs. Long-Term: The One-Year Holding Period Rule

The difference between short-term and long-term capital gains rates is substantial — up to 17.2 percentage points for high earners (37% ordinary rate vs. 20% long-term rate, before NIIT). The holding period is measured from the day after you acquire the asset to the day you sell it. If you buy stock on January 15, 2024, you must sell on or after January 16, 2025 to qualify for long-term treatment. For tax-loss harvesting, the wash sale rule prevents you from claiming a loss if you repurchase the same or substantially identical security within 30 days before or after the sale. Real estate held over one year qualifies for long-term rates, but depreciation recapture on rental property is taxed at a flat 25% regardless of holding period. Cryptocurrency follows the same short-term and long-term rules as stocks. For active traders making frequent short-term trades, the tax drag can significantly reduce after-tax returns — a 30% pre-tax return becomes approximately 19.5% after short-term capital gains tax for someone in the 35% bracket.

Strategies to Legally Minimize Capital Gains Tax

Several legitimate strategies can reduce or defer capital gains tax. Tax-loss harvesting involves selling losing positions to offset gains — you can offset unlimited gains with losses, and deduct up to $3,000 of net losses against ordinary income annually, carrying forward excess losses indefinitely. Donating appreciated stock to charity lets you deduct the full market value without paying capital gains tax. Opportunity Zone investments allow deferral and partial exclusion of capital gains when invested in qualified zones. The primary residence exclusion lets homeowners exclude up to $250,000 ($500,000 married) of gain when selling a home they have lived in for 2 of the past 5 years. For real estate investors, 1031 like-kind exchanges defer capital gains tax by rolling proceeds into a replacement property within 180 days. Installment sales spread the gain over multiple years, potentially keeping you in lower brackets. Finally, holding appreciated assets until death provides a step-up in basis to the heir, permanently erasing the unrealized gain.

Frequently Asked Questions

sell

Tags

verified

Data sourced from trusted institutions

All formulas verified against official standards.