US Capital Gains Tax Calculator

Calculate federal capital gains tax on stock sales, real estate, and investments. Shows long-term vs short-term tax impact and state tax considerations.

Investment Details

$
$

Tax Calculation

Capital Gain:
$5,000
50.0% return
Long-term capital gains rate
Holding Period:Long-term (>1 year)
Tax Rate:20.0%
Federal Tax:$1,000
State Tax:$0
Total Tax:$1,000
Net Proceeds:$14,000

Disclaimer:

This estimate does not include NIIT (3.8% tax on investment income) for high earners, state taxes, or other factors. Consult a tax professional for accurate calculations.

Short-Term vs Long-Term Makes a Huge Difference

Hold an investment for one year or less, gains are 'short-term' and taxed as ordinary income at your marginal rate (10-37%). Hold for more than a year, gains are 'long-term' and taxed at preferential rates of 0%, 15%, or 20%. On a $50,000 gain, the difference between selling on day 364 vs day 366 can be $7,500-10,000 in tax.

The day-count is from the day after you bought to the day you sold. There is no way to backdate or extend the clock. The single biggest avoidable tax mistake retail investors make is selling profitable positions at month 11 of holding when waiting another month would convert short-term to long-term.

The 0%, 15%, and 20% Long-Term Brackets

For 2024, single filers pay 0% on long-term gains up to $47,025 of taxable income, 15% from $47,026 to $518,900, and 20% above. Married filing jointly: 0% to $94,050, 15% to $583,750, 20% above. The 0% bracket is genuinely real - retired couples with modest income can sell appreciated stock and pay literally zero federal tax on the gain.

Stacking matters: capital gains sit on top of ordinary income for bracket purposes. If you have $90,000 of wages and $20,000 of long-term gains, the full gain is taxed at 15% (because wages already used up the 0% gain space). High earners over $250k single / $250k MFJ also pay an extra 3.8% Net Investment Income Tax on top.

Loss Harvesting Cuts Your Bill

Capital losses offset capital gains dollar-for-dollar in the same year. Realised losses beyond gains can offset up to $3,000 of ordinary income per year, with the remainder carried forward indefinitely. Selling a losing position to crystallise the loss before year end is 'tax-loss harvesting' and can save thousands.

Watch the wash-sale rule: if you sell at a loss and buy 'substantially identical' securities within 30 days before or after, the loss is disallowed and gets added to the cost basis of the replacement. Index funds and ETFs of similar but distinct underlying baskets (S&P 500 vs total US market) are usually treated as different enough; identical tickers across different brokers are not.

Real Estate Has Its Own Rules

Sell your primary home and the first $250,000 (single) or $500,000 (married) of gain is excluded from tax under Section 121, provided you owned and lived in it for 2 of the last 5 years. Investment property does not get this exclusion but can use a 1031 exchange to defer the gain into another investment property indefinitely.

Depreciation recapture catches investment property sellers off guard. The depreciation you took (or should have taken) over the years gets recaptured at up to 25% on sale, separate from regular capital gains rates. A rental sold for a $200,000 gain after $80,000 of depreciation owes 25% on the $80,000 plus long-term rates on the remaining $120,000.

Frequently Asked Questions

Do I owe capital gains tax if I reinvest the proceeds?

Generally yes - reinvesting the cash from a stock sale does not defer the tax. The exception is the 1031 exchange for real estate, where rolling proceeds into another investment property defers the gain. Mutual fund cap-gains distributions also count as realised gains even if you reinvested them via DRIP.

What is cost basis and why does it matter?

Cost basis is what you paid for the investment (plus reinvested dividends, fees). Gain = sale price minus basis. Brokerages now report basis to the IRS for shares bought after 2011, but older holdings may need you to reconstruct basis from records. Get this right - guessing low costs you tax, guessing high invites an IRS letter.

How do crypto gains work?

Crypto is treated as property for tax purposes, so the same short-term/long-term rules apply. Every trade is a taxable event - swapping ETH for SOL realises gain on the ETH side. Hard forks and airdrops are taxed as ordinary income at receipt. Many exchanges now provide year-end gain/loss reports; software like CoinTracker pulls them together.

Can I gift appreciated stock to avoid the gain?

You can transfer cost basis to the recipient (carryover basis), so they realise the gain when they sell. Useful when gifting to lower-income family members who might be in the 0% long-term bracket. Charitable giving of appreciated stock to a qualified charity lets you deduct the full market value and skip the gain entirely.

More tools β†’