Financecapital gainsinvestment taxlong-term

Capital Gains Tax Calculator

When you sell an investment for more than you paid, the profit is a capital gain and is subject to tax. The rate depends on how long you held the asset: short-term gains (under one year) are taxed as ordinary income, while long-term gains qualify for preferential rates of 0%, 15%, or 20% depending on your income level.

Advertisement

Calculator

$
$
$

See your Capital Gains Tax Calculator results

Enter your email to unlock results — free forever.

or

No spam, ever. Unsubscribe at any time.

Advertisement

Formula

Tax = Gain × Rate (0/15/20% for long-term; ~22% for short-term)

Capital gains = Sale Price − Purchase Price. For long-term holdings (≥ 1 year), the 2024 rates are: 0% if taxable income is $44,625 or below; 15% for income $44,626–$492,300; 20% above $492,300. For short-term holdings (< 1 year), gains are taxed as ordinary income — this calculator uses an approximate 22% marginal rate, which may differ from your actual marginal rate. After-tax profit is the gain minus the estimated tax.

How to use the Capital Gains Tax Calculator

  1. 1

    Enter your purchase price

    Value should be in $.

  2. 2

    Enter your sale price

    Value should be in $.

  3. 3

    Enter your holding period

  4. 4

    Enter your annual taxable income

    Value should be in $.

  5. 5

    Read your results instantly

    Results update in real time as you type.

Advertisement

Why holding period matters enormously for taxes

The difference between a short-term and long-term capital gain is one of the most impactful decisions an investor can make. For a single filer earning $75,000 who sells a stock for a $10,000 gain, the difference is striking: if sold before 12 months, the gain is taxed at the 22% ordinary income rate for a $2,200 tax bill. If held just one day past the 12-month mark, the gain is taxed at 15% long-term rates — a tax bill of only $1,500. Saving $700 simply by waiting a few more weeks or months is a meaningful return on patience.

For higher earners, the difference is even more dramatic. An investor in the 37% bracket who realizes a $100,000 short-term gain owes $37,000 in federal tax. The same gain after 12 months is taxed at 20%, producing a $20,000 tax bill. The $17,000 difference is a compelling reason to structure investment sales thoughtfully.

This is why tax-loss harvesting, strategic timing of asset sales, and holding long-term are core principles of tax-efficient investing. The calendar is one of the cheapest 'investments' you can make.

The 0% long-term rate: tax-free gains for many investors

One of the most underutilized features of the U.S. tax code is the 0% long-term capital gains rate. In 2024, single filers with taxable income at or below $44,625 owe zero federal tax on long-term capital gains. For married filers, the threshold is $89,250.

This creates powerful planning opportunities. A retiree drawing down a modest income, a young investor in a low-earning year, or someone who has taken time off work may be able to realize significant capital gains entirely tax-free by selling appreciated assets during a low-income year. Even for higher earners, strategically realizing gains in years when income temporarily drops (sabbatical, job transition, early retirement) can save thousands.

The strategy of 'harvesting gains' in low-income years is the flip side of tax-loss harvesting in high-income years. Both are entirely legal and are considered standard tax planning by financial advisors.

Advertisement

What's not included: state taxes and NIIT

This calculator estimates federal capital gains tax only. Two additional taxes may apply:

State capital gains taxes: Most states tax capital gains as ordinary income, at rates ranging from 0% (Texas, Florida, Washington — though Washington has a 7% tax on large gains) to 13.3% (California, which does not offer preferential long-term rates). California residents can add their state marginal rate to the federal rate for a combined effective rate as high as 33%+ on large gains.

Net Investment Income Tax (NIIT): High earners are subject to an additional 3.8% Medicare surtax on investment income, including capital gains. For single filers, this applies to investment income when modified AGI exceeds $200,000 ($250,000 for married couples). This can bring the effective federal long-term rate for high earners to 23.8% (20% + 3.8%).

Always factor in your full effective rate — federal, state, and NIIT — when evaluating investment sale decisions.

Tips & Insights

Wait for the 1-year long-term threshold whenever possible

Unless you have a strong reason to sell earlier (loss-harvesting opportunity, rebalancing need, financial emergency), waiting until the 12-month mark to sell a profitable investment converts the gain from ordinary income rates to long-term capital gains rates. For most investors, this saves 7-15% in federal taxes on the gain.

Use tax-advantaged accounts for your most frequently traded assets

Actively traded investments held inside a 401(k), IRA, or Roth IRA generate no capital gains tax regardless of holding period. If you invest in assets you expect to buy and sell frequently (sector ETFs, individual stocks), holding them inside tax-advantaged accounts eliminates the tax drag from short-term trading.

Consider tax-loss harvesting to offset gains

If you have appreciated investments you want to sell, look for other positions in your portfolio with unrealized losses. Selling the losing positions first generates capital losses that directly offset your capital gains, dollar for dollar. Losses beyond your gains can also offset up to $3,000/year of ordinary income, with unused losses carrying forward to future years.

Worked Examples

Long-term stock gain, middle-income earner

purchasePrice: 10000salePrice: 25000holdingPeriod: 1income: 75000

A $15,000 long-term gain taxed at 15% results in a $2,250 federal tax bill and an after-tax profit of $12,750. Holding for 12+ months saves roughly $1,050 versus the short-term 22% rate.

Short-term flip

purchasePrice: 5000salePrice: 8000holdingPeriod: 0income: 60000

A $3,000 short-term gain at 22% produces a $660 tax bill, leaving $2,340 in after-tax profit. The same gain held long-term would be taxed at 15% — saving $210.

Advertisement

Frequently Asked Questions

When do I owe capital gains tax?

Capital gains tax is triggered when you sell (or otherwise dispose of) an asset for more than you paid. Unrealized gains — appreciation in value while you still own the asset — are not taxed. The tax is based on the realized gain at the time of sale.

Do I pay capital gains tax on my home sale?

Typically no, up to certain limits. The IRS excludes up to $250,000 ($500,000 for married couples) of home sale gain from tax if you owned and lived in the home as your primary residence for at least 2 of the last 5 years. Gains above the exclusion are taxed at long-term capital gains rates if the holding period exceeds one year.

What is the 'step-up in basis' at death?

When assets are inherited, the cost basis 'steps up' to the fair market value at the date of death. This means heirs can sell inherited assets with little or no capital gains tax, even if the original owner had massive unrealized gains. This is a significant estate planning benefit that eliminates capital gains tax on a lifetime of appreciation.

Are capital losses limited?

Capital losses first offset capital gains of the same type (short-term losses against short-term gains, long-term against long-term), then cross-offset between types. Net capital losses beyond all gains can deduct up to $3,000/year against ordinary income. Remaining unused losses carry forward indefinitely to future tax years.

Is cryptocurrency subject to capital gains tax?

Yes. The IRS treats cryptocurrency as property, so the same capital gains rules apply. Buying, holding, and selling crypto triggers short- or long-term gains based on holding period. Every exchange, including crypto-to-crypto trades, is a taxable event. This makes active crypto trading tax-intensive and underscores the importance of careful record-keeping.

Advertisement

Related Calculators