Capital Gains Tax Calculator

Calculate your capital gains tax and compare short-term vs long-term rates.

Ad · Responsive

Understanding Capital Gains Tax

Capital gains tax applies when you sell an asset — such as stocks, bonds, real estate, or cryptocurrency — for more than you paid for it. The amount of tax you owe depends on two key factors: how long you held the asset (short-term vs long-term) and your total taxable income. Understanding these rules can save you thousands by timing your sales strategically and using available tax-saving strategies.

2024 Long-Term Capital Gains Rates

  • 0%: Single filers with taxable income up to $47,025 ($94,050 married)
  • 15%: Single filers $47,025 – $518,900 ($94,050 – $583,750 married)
  • 20%: Single filers above $518,900 ($583,750 married)
  • Short-term gains: Taxed as ordinary income at your marginal tax bracket rate

Worked Example

You bought stock for $50,000 and sold it for $85,000 with$85,000 in other taxable income:

  • Capital gain: $35,000
  • Short-term tax (22% bracket): $7,700
  • Long-term tax (15%): $5,250
  • Savings by holding over 1 year: $2,450

Key Capital Gains Terms

Cost Basis
The original price you paid for an asset, including commissions and fees. Your gain is Sale Price − Cost Basis.
Tax-Loss Harvesting
Selling losing investments to offset gains. You can deduct up to $3,000 in net losses against ordinary income per year.
1031 Exchange
A tax-deferral strategy for real estate that allows you to roll capital gains into a "like-kind" property without paying tax.
Net Investment Income Tax (NIIT)
An additional 3.8% tax on investment income for high earners (AGI above $200,000 single / $250,000 married).
Wash Sale Rule
You cannot deduct a loss if you buy a "substantially identical" security within 30 days before or after the sale.

Tax-Saving Strategies

  • Hold over 1 year: Long-term rates (0/15/20%) are dramatically lower than short-term (up to 37%)
  • Harvest losses: Sell losing positions to offset gains, then reinvest in similar (not identical) assets
  • Use tax-advantaged accounts: Gains in Roth IRAs, 401(k)s, and HSAs are tax-free or tax-deferred
  • Gift appreciated assets: Gifting stock to family members in lower brackets can reduce the family's total tax
  • Track your cost basis: Calculate investment returns accurately to avoid overpaying

Frequently Asked Questions

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

Short-term capital gains apply to assets held less than 1 year and are taxed as ordinary income at your marginal tax rate (up to 37%). Long-term capital gains apply to assets held over 1 year and receive preferential rates of 0%, 15%, or 20% depending on your taxable income. This distinction can mean a 20%+ difference in tax rate.

Can I offset capital gains with losses?

Yes, capital losses offset capital gains dollar-for-dollar through a process called tax-loss harvesting. Short-term losses first offset short-term gains, then long-term gains. If net losses exceed gains, you can deduct up to $3,000 ($1,500 if married filing separately) against ordinary income per year, carrying forward any remaining losses indefinitely.

Do I pay capital gains tax on my primary home?

If you have lived in your home as your primary residence for at least 2 of the last 5 years, you can exclude up to $250,000 in gains ($500,000 if married filing jointly) from capital gains tax under the Section 121 exclusion. This is one of the most valuable tax breaks available to homeowners.

What is the Net Investment Income Tax (NIIT)?

The NIIT is an additional 3.8% tax on investment income (capital gains, dividends, rental income) for individuals with modified AGI above $200,000 ($250,000 for married couples). This means top earners effectively pay 23.8% on long-term capital gains (20% + 3.8% NIIT).

What is cost basis and why does it matter?

Cost basis is the original value of an asset for tax purposes — typically what you paid for it, plus any commissions or fees. Your capital gain (or loss) is calculated as: Sale Price − Cost Basis. Using the correct cost basis method (specific identification, FIFO, average cost) can significantly affect your tax liability.