Capital Gains Tax Calculator: Compute Your Tax Instantly 💰

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 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
How to use this calculator 🖱️
- Enter your purchase price — the amount you originally paid for the asset (your cost basis).
- Enter the sale price — the amount you received when you sold it.
- Add transaction fees (optional) — brokerage commissions, legal fees, or selling costs. These increase your cost basis and reduce your taxable gain.
- Enter your tax rate — use your applicable short-term or long-term rate as a percentage.
- Select the gain type — Short-Term (held 1 year or less) or Long-Term (held more than 1 year).
- 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
| 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%.
- Cost Basis = $5,000 + $30 = $5,030
- Net Gain = $12,000 − $5,030 = $6,970
- 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.
- Cost Basis = $8,000
- Net Gain = $5,500 − $8,000 = −$2,500 (a loss)
- Capital Gains Tax Owed = $0
- 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.
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?
How do I calculate capital gains tax?
What is cost basis and why does it matter?
Can capital losses offset capital gains?
Is capital gains tax the same in every country?
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
- IRS Publication 550 – Investment Income and Expenses (Capital Gains and Losses): irs.gov/publications/p550
- Investopedia – Capital Gains Tax: investopedia.com – Capital Gains Tax
- 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.
