Capital Gains Tax Calculator – Free Online Tool

Capital Gains Tax Calculator: Compute Your Tax Instantly 💰

By Dr. Irfan Mansuri
·
Last Updated: August 2026
·
9 min read
·
Finance / Tax
Capital gains tax calculator showing short-term and long-term tax computation with formula and result
Capital gains tax calculator – compute short-term and long-term tax owed on any asset sale

How much tax do you actually owe when you sell a stock, property, or investment? Does holding an asset longer really cut your tax bill? And what exactly counts as your “cost basis”? These are the three questions I hear most from students and first-time investors — so let me answer each one directly, then give you a working calculator to run your own numbers.

Quick Answer: Capital gains tax is the tax you pay on profit from selling an asset. Subtract your cost basis (purchase price plus fees) from the sale price to find your gain. If you held the asset one year or less, short-term rates apply (taxed as ordinary income). If you held it more than one year, long-term rates apply — 0%, 15%, or 20% in the US — which are significantly lower than ordinary income rates.

📌 Quick Summary

  • 💡 Capital gains tax = (Sale Price − Cost Basis) × Tax Rate.
  • 📅 Holding > 1 year unlocks lower long-term rates (0–20% in the US).
  • 📉 Capital losses can offset gains and reduce your tax bill.
  • 🧾 Cost basis includes purchase price, fees, and eligible improvements.
  • 🌍 Rates vary by country — always verify your local rules.

⚡ Use the capital gains tax calculator now

Enter your numbers below. The calculator handles both short-term and long-term gains and shows a full step-by-step breakdown so you can see exactly how the result was reached.

Capital Gains Tax Calculator



Your currency (e.g. USD, EUR, INR)


Your currency


Adds to cost basis, reducing your gain


Long-term US rates: 0%, 15%, or 20%


—
Estimated Capital Gains Tax Owed

    How to use this calculator 🖱️

    1. Enter your purchase price — the amount you originally paid for the asset (your cost basis).
    2. Enter the sale price — the amount you received when you sold it.
    3. Add transaction fees (optional) — brokerage commissions, legal fees, or selling costs. These increase your cost basis and reduce your taxable gain.
    4. Enter your tax rate — use your applicable short-term or long-term rate as a percentage.
    5. Select the gain type — Short-Term (held 1 year or less) or Long-Term (held more than 1 year).
    6. Click Calculate — see your tax owed and the full step-by-step breakdown instantly.

    What is capital gains tax? 📖

    Capital gains tax (CGT) is a tax levied on the profit you make when you sell a capital asset — such as stocks, real estate, bonds, or cryptocurrency — for more than you paid for it. The taxable amount is the gain, not the full sale price.

    The key distinction that most first-time investors miss is the holding period. Selling within one year triggers short-term rates, which are the same as your ordinary income tax rate. Holding for more than one year unlocks long-term rates, which are far lower. In the US, long-term rates are 0%, 15%, or 20% depending on your income bracket. Many other countries use a similar tiered structure.

    In my experience explaining this to students, the single biggest "aha moment" is realising that waiting just one extra day past the one-year mark can save thousands of dollars on a large gain. That is not a loophole — it is the intended policy design to reward long-term investment.

    Fact Detail
    Short-term holding period 1 year or less
    Long-term holding period More than 1 year
    US long-term rates (2026) 0%, 15%, or 20%
    Short-term rate Same as ordinary income tax rate
    Annual loss deduction limit (US) Up to $3,000 against ordinary income
    Loss carryforward Unlimited (carry to future tax years)

    The capital gains tax formula explained 🧮

    Core formula

    Capital Gains Tax = (Sale Price − Cost Basis) × Tax Rate
    Cost Basis = Purchase Price + Transaction Fees + Improvement Costs
    Net Gain = Sale Price − Cost Basis
    Symbol / Term Meaning Unit
    Sale Price Amount received on disposal of the asset Currency
    Cost Basis Original purchase price + fees + improvements Currency
    Net Gain Profit subject to tax (Sale Price − Cost Basis) Currency
    Tax Rate Applicable short-term or long-term rate % (decimal in formula)
    Capital Gains Tax Tax owed on the net gain Currency

    If the net gain is zero or negative (a loss), no capital gains tax is owed. A capital loss may actually be deductible against other gains or, up to a limit, against ordinary income.

    Short-term vs long-term capital gains: side-by-side comparison 📊

    Feature Short-Term Long-Term
    Holding period 1 year or less More than 1 year
    Tax rate (US, 2026) 10%–37% (ordinary income) 0%, 15%, or 20%
    Tax on $10,000 gain at 22% / 15% $2,200 $1,500
    Best for Active traders, forced sales Buy-and-hold investors
    Loss treatment Offsets short-term gains first Offsets long-term gains first
    Typical assets Stocks, crypto held briefly Stocks, real estate, bonds held long

    The table makes the tax saving concrete: on a $10,000 gain, switching from a 22% short-term rate to a 15% long-term rate saves $700. On a $100,000 gain, that is $7,000 in your pocket simply by holding one extra day past the one-year mark.

    Worked examples: see the calculator's steps in action 📝

    Example 1 — Long-term stock gain

    You bought 100 shares at $50 each (total $5,000) and paid $30 in brokerage fees. Fourteen months later you sold for $12,000. Your long-term tax rate is 15%.

    1. Cost Basis = $5,000 + $30 = $5,030
    2. Net Gain = $12,000 − $5,030 = $6,970
    3. Tax Owed = $6,970 × 15% = $1,045.50

    If you had sold after only 10 months (short-term, 22% rate): Tax = $6,970 × 22% = $1,533.40 — an extra $487.90 in tax for the same gain.

    Example 2 — Short-term crypto sale with a loss

    You bought cryptocurrency for $8,000 and sold it six months later for $5,500. No additional fees.

    1. Cost Basis = $8,000
    2. Net Gain = $5,500 − $8,000 = −$2,500 (a loss)
    3. Capital Gains Tax Owed = $0
    4. The $2,500 capital loss can offset other capital gains this year, or up to $3,000 can be deducted against ordinary income.
      PURCHASE PRICE + FEES
             │
             ▼
         COST BASIS
             │
      SALE PRICE ──────────────┐
             │                 │
             ▼                 │
       NET GAIN = Sale − Cost Basis
             │
       ┌─────┴──────┐
       │            │
     GAIN > 0    GAIN ≤ 0
       │            │
       ▼            ▼
    Apply Rate    No CGT owed
       │         (may have
       ▼          deductible loss)
     TAX OWED
      = Gain × Rate
      

    Common mistakes that cost investors money ⚠️

    Mistake 1 — Forgetting to include fees in cost basis. Many people enter only the purchase price and ignore brokerage commissions, legal fees, or transfer taxes. Every dollar of fees added to your cost basis is a dollar less of taxable gain. Over a lifetime of investing, this omission can cost hundreds or thousands in overpaid tax.

    Mistake 2 — Confusing the sale price with the gain. The tax applies to the profit, not the full sale amount. A stock sold for $20,000 that cost $18,000 produces a $2,000 gain — not a $20,000 taxable event.

    Mistake 3 — Selling one day too early. Selling on day 364 instead of day 366 can push a large gain from a 15% long-term rate into a 22%+ short-term rate. Always check your holding period before placing a sell order.

    Mistake 4 — Ignoring capital loss harvesting. Realising a loss on an underperforming asset before year-end to offset a gain elsewhere is a legitimate and widely used tax strategy. Many investors leave this saving on the table.

    🔢 Try Another Free Calculator →

    🧠 Worth Knowing

    The "wash-sale" trap most guides skip: In the US, if you sell a security at a loss and buy the same (or a "substantially identical") security within 30 days before or after the sale, the IRS disallows the loss deduction under the wash-sale rule. This catches many investors who try to harvest a tax loss while staying invested. The disallowed loss is not gone forever — it is added to the cost basis of the repurchased shares — but it delays the benefit. Cryptocurrency was historically exempt from wash-sale rules in the US, though legislation to close this gap has been proposed. Always verify current rules with a tax professional before executing a loss-harvesting strategy.

    Frequently asked questions about capital gains tax ❓

    What is the difference between short-term and long-term capital gains?
    Short-term capital gains apply when you sell an asset held for one year or less; they are taxed at your ordinary income rate. Long-term capital gains apply when you hold an asset for more than one year and are taxed at preferential rates (0%, 15%, or 20% in the US). The lower long-term rate is the primary incentive for buy-and-hold investing.
    How do I calculate capital gains tax?
    Use the formula: Capital Gains Tax = (Sale Price − Cost Basis) × Tax Rate. Cost basis is your purchase price plus any fees or improvements. Multiply the resulting net gain by your applicable short-term or long-term rate to get your estimated tax owed. Use the calculator above to do this instantly with a step-by-step breakdown.
    What is cost basis and why does it matter?
    Cost basis is the original value of an asset for tax purposes — typically the purchase price plus transaction fees, commissions, and the cost of any capital improvements. A higher cost basis reduces your taxable gain. Keeping accurate records of every purchase price and fee is one of the most important habits for any investor.
    Can capital losses offset capital gains?
    Yes. Capital losses offset capital gains dollar-for-dollar. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against ordinary income per year in the US, and carry any remaining loss forward to future tax years indefinitely. This makes loss harvesting a powerful year-end tax planning tool.
    Is capital gains tax the same in every country?
    No. Capital gains tax rates and rules vary significantly by country. Some countries — such as New Zealand and Singapore — have no general capital gains tax. Others, like the UK and Australia, have their own rates, exemptions, and holding-period rules. The calculator above works for any country: just enter your local applicable rate. Always consult your local tax authority or a qualified tax professional for country-specific advice.

    Key takeaways ✅

    What to remember

    • Capital gains tax applies to the profit from selling an asset, not the full sale price.
    • The formula is: Tax = (Sale Price − Cost Basis) × Rate.
    • Holding an asset for more than one year qualifies you for lower long-term rates.
    • Always include transaction fees in your cost basis to reduce your taxable gain.
    • Capital losses can offset gains and, up to $3,000/year in the US, ordinary income too.
    • The wash-sale rule can disallow a loss if you repurchase the same security within 30 days.
    • Tax rates and rules differ by country — verify your local rules before making decisions.

    Sources & references

    1. IRS Publication 550 – Investment Income and Expenses (Capital Gains and Losses): irs.gov/publications/p550
    2. Investopedia – Capital Gains Tax: investopedia.com – Capital Gains Tax
    3. Wikipedia – Capital gains tax: en.wikipedia.org/wiki/Capital_gains_tax

    Editorial note: This article is for educational purposes only and does not constitute tax, legal, or financial advice. Tax laws change frequently and vary by jurisdiction. Always consult a qualified tax professional before making financial decisions. ✍ Written & fact-checked by Dr. Irfan Mansuri, August 2026.

    Leave a Comment

    Your email address will not be published. Required fields are marked *

    Scroll to Top