Skip to content
C

Capital Gains Tax Calculator

Short- vs. long-term capital gains.

Capital gains tax (US federal)

Applied rate
15.0%
Tax owed
$3,000
Net gain
$17,000

About the Capital Gains Tax Calculator

MethodologyHome

A capital gains tax calculator estimates the federal tax owed when you sell an investment for more than you paid for it. The tax depends on whether the gain is short-term (asset held one year or less, taxed as ordinary income) or long-term (held more than one year, taxed at preferential 0%, 15%, or 20% rates). The distinction is one of the largest, most accessible tax-saving tools in the U.S. tax code — and one of the most misunderstood.

Short-term vs. long-term: the year-and-a-day rule

Short-term capital gains apply to assets held for one year or less. They're taxed at ordinary income rates — anywhere from 10% to 37% federally, depending on your bracket — making them substantially more expensive than long-term gains in most cases.

Long-term capital gains apply to assets held for more than one year. The federal rate is 0%, 15%, or 20% depending on taxable income. The holding period is measured day-to-day from the day after purchase to the day of sale; selling on day 365 is short-term, selling on day 366 is long-term. The difference can be tens of thousands of dollars on a meaningful gain — waiting one extra day is sometimes the highest-value financial decision someone makes in a year.

The 0% long-term capital gains bracket

The 0% long-term capital gains rate applies up to certain taxable income thresholds — for 2024, $47,025 single, $94,050 MFJ. This means a retiree with low income, a worker on sabbatical, or anyone in a low-income year can realize substantial long-term capital gains entirely tax-free up to the threshold.

Tax-gain harvesting: deliberately selling appreciated long-term positions in the 0% bracket to step up the cost basis, then re-buying immediately. Unlike tax-loss harvesting, there's no wash-sale rule for gains. Done annually in low-income years, this can permanently reset basis and avoid taxes that would otherwise apply when income rises later.

Tax-loss harvesting and the wash-sale rule

Tax-loss harvesting: selling investments at a loss to offset capital gains and (up to $3,000/year) ordinary income. Excess losses carry forward indefinitely. In a volatile market with significant losses, harvesting can substantially reduce current-year tax bills.

The wash-sale rule disallows the loss if you purchase the same or substantially identical security within 30 days before or after the sale. Designed to prevent purely cosmetic loss-taking, the rule's interpretation is sometimes unclear (especially for bonds and options); when in doubt, wait the 30 days or buy a clearly different asset.

State tax and the Net Investment Income Tax

Most states tax capital gains as ordinary income, regardless of the federal long-term/short-term distinction. California, in particular, taxes long-term gains at full state rates (up to 13.3%) on top of the federal 20% rate — making total tax on large gains in high-tax states approach 35%.

The Net Investment Income Tax (NIIT) adds 3.8% to investment income (interest, dividends, capital gains, rental income) for high earners (modified AGI above $200,000 single, $250,000 MFJ). It's a separate tax not included in headline rates; high earners often forget to include it in projections, underestimating the true tax cost of large capital gains.

The home-sale exclusion

Section 121: married couples can exclude up to $500,000 of capital gain on the sale of a primary residence; singles up to $250,000. To qualify, you must have owned and used the home as your primary residence for at least 2 of the past 5 years. The exclusion can be used once every 2 years.

For long-time owners in high-appreciation markets, gains above the exclusion can still be substantial. Cost basis includes the original purchase price plus most major improvements (with documentation) — kitchens, additions, roofs. Keep records; the basis you can document is the basis you can claim.

Worked examples

Short-term vs. long-term: same gain, different tax

$50,000 gain, single filer with $100,000 ordinary income. Short-term: taxed at 22–24% marginal = ~$11,500 federal. Long-term: 15% federal = $7,500. Difference: $4,000, simply for waiting past the 1-year mark.

0% bracket harvesting

Retiree, $30,000 of ordinary income, single, no other tax. Standard deduction (~$14,600) leaves $15,400 taxable. 0% LTCG bracket extends to ~$47,000. Realizing $30,000 of long-term gains: $0 federal tax owed. Re-buying immediately (no wash-sale rule for gains) steps up basis from $30K to $60K.

Home-sale exclusion

Couple sells primary residence for $900,000 after buying for $400,000 with $50,000 in documented improvements. Gain: $450,000. MFJ Section 121 exclusion: $500,000 → no federal capital-gains tax. Without the exclusion, the same gain would have cost ~$67,500 in federal LTCG tax.

Frequently asked questions

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

Short-term: asset held one year or less, taxed at ordinary income rates (10–37%). Long-term: held more than one year, taxed at 0%, 15%, or 20%. The threshold is one year and one day — the difference between selling on day 365 and day 366 can be substantial.

How is the long-term capital gains rate determined?

By taxable income. For 2024: 0% up to $47,025 single / $94,050 MFJ; 15% up to $518,900 single / $583,750 MFJ; 20% above that. The brackets apply to total taxable income, with capital gains stacked on top of ordinary income — your gains get taxed at whatever bracket they fall into, including potentially split across rates.

Do I have to pay taxes if I reinvest the proceeds?

Yes — reinvesting doesn't defer capital gains. The taxable event is the sale, not the use of proceeds. The exception is real estate's 1031 exchange (like-kind exchanges of investment property), which defers gains when proceeds are reinvested in another investment property.

How does tax-loss harvesting work?

Sell investments at a loss to offset capital gains; excess losses up to $3,000/year offset ordinary income; further losses carry forward indefinitely. The wash-sale rule disallows the loss if you buy the same security within 30 days. Tax-loss harvesting is one of the largest, most accessible tax-saving tools for taxable investors.

Are capital gains taxed by states?

Most states tax capital gains as ordinary income at their state-tax rate. Nine states have no state income tax. California taxes gains at full state rates (up to 13.3%); high-tax-state filers can see total tax on long-term gains approaching 35% federal + state combined.

What is the home-sale exclusion?

Section 121 lets singles exclude up to $250,000 and married couples up to $500,000 of capital gain on the sale of a primary residence, if owned and used as primary residence at least 2 of the past 5 years. The exclusion can be used once every 2 years and applies to gain — proceeds minus cost basis (original price + documented improvements).

Concepts

Sources & methodology

  • IRS — Topic No. 409, Capital gains and lossessource
  • IRS Publication 523 — Selling your homesource