calculator for capital gains

Use this capital gains calculator to estimate your taxable gain, estimated tax, and after-tax profit from selling an asset such as stocks, ETFs, crypto, or property.

Educational estimate only. Tax law varies by country, filing status, and local rules. Consult a qualified tax professional for personalized advice.

What is capital gains tax?

A capital gain is the profit you make when you sell an asset for more than your adjusted cost basis. Capital gains tax is the tax charged on that profit. If you sell at a lower value than your cost basis, you have a capital loss, which may reduce taxable gains depending on your local tax code.

Common assets that can generate capital gains include stocks, mutual funds, exchange-traded funds (ETFs), real estate, collectibles, and digital assets. The final tax amount can depend on how long you held the asset, your income, and country-specific rules.

How this calculator works

Core formula

  • Cost basis = (units × purchase price) + purchase fees + improvement costs
  • Net sale proceeds = (units × sale price) − sale fees
  • Capital gain (or loss) = net sale proceeds − cost basis
  • Estimated tax = gain × applicable tax rate (only when gain is positive)
  • After-tax gain = gain − estimated tax

Short-term vs long-term gains

Many tax systems apply different rates depending on holding period. In general, short-term gains are taxed at higher ordinary income rates, while long-term gains often receive preferential rates. This page lets you define both rates and a threshold (such as 12 months) so you can model different scenarios.

How to use the calculator effectively

  • Enter realistic transaction costs, including broker fees and exchange fees.
  • Include any basis adjustments, such as eligible improvement costs.
  • Use your likely marginal tax rates for short-term and long-term gains.
  • Run multiple scenarios before selling to compare timing outcomes.

Practical example

Suppose you bought 100 shares at $25 and sold at $40. You paid $10 to buy and $10 to sell, and held for 18 months. With a 15% long-term rate, your gain and estimated tax may be much lower than if you sold at month 10 with a 32% short-term rate.

This is exactly why planning sale timing can matter: even a strong return can be meaningfully improved by managing tax treatment.

Ways to reduce capital gains tax legally

1) Hold assets long enough for long-term rates

If your fundamentals are still strong, waiting until you cross a long-term threshold can reduce tax drag.

2) Use tax-loss harvesting

Realized losses can offset gains in many jurisdictions. Be sure to check wash-sale or similar anti-abuse rules.

3) Maximize tax-advantaged accounts

Retirement and tax-sheltered accounts can defer or avoid taxes on gains depending on account type and withdrawal rules.

4) Keep clean records

Missing trade confirmations, fee records, or basis adjustments can lead to overpaying tax. Good documentation protects you.

Common mistakes to avoid

  • Ignoring transaction fees when calculating true profit.
  • Using the wrong holding period classification.
  • Forgetting corporate actions (splits, spin-offs, reinvested distributions) that adjust basis.
  • Assuming one tax rate applies to every asset type and every country.

Final thoughts

A capital gains calculator helps you move from guesswork to decision-making. Before you sell, test the after-tax outcome—not just the headline gain. Small changes in fees, timing, and tax bracket assumptions can have a big impact on your net return.

🔗 Related Calculators