Capital Gains Tax Calculator
Estimate your short-term and long-term capital gains tax on stocks, crypto, real estate, and other investments
Investment Details
Tax Rates
Typically your ordinary income tax bracket
Common US brackets: 0%, 15%, or 20%
Set to 0 if your jurisdiction has no state/provincial capital gains tax
Tax Estimate
Please fill in all required fields to see your tax estimate
Complete Guide to Capital Gains Tax
What Is Capital Gains Tax?
Capital gains tax is a tax on the profit from selling an asset — stocks, bonds, real estate, cryptocurrency, or collectibles — for more than you paid. Governments distinguish between short-term gains (assets held under one year) and long-term gains (held one year or longer), with long-term gains typically taxed at lower rates to encourage patient investing.
If you sell an asset at a loss, that loss can offset gains elsewhere in your portfolio, a strategy known as tax-loss harvesting. For a broader view of your investment returns before taxes, try our Stock Return Calculator or the Profit Margin Calculator for business-oriented gain analysis.
How Capital Gains Tax Is Calculated
Capital Gains Tax Formula:
Capital Gain = (Sale Price − Purchase Price) × Quantity
Federal Tax = Capital Gain × Federal Rate
State Tax = Capital Gain × State Rate
Total Tax = Federal Tax + State Tax
Net Profit = Capital Gain − Total Tax
Where: Federal Rate = short-term rate (if held < 1 yr) or long-term rate (if held ≥ 1 yr); State Rate = your local jurisdiction's capital gains rate (0% in some states/countries)
Benefits of Estimating Capital Gains Tax
Optimize Holding Period
See exactly how much you save by holding an asset past the one-year threshold — the short-term vs long-term comparison shows the dollar difference at a glance.
Plan Cash Flow
Know your after-tax proceeds before you sell, so you can budget for estimated tax payments and avoid surprises at filing time.
Compare Across Jurisdictions
Enter your federal and state rates to model taxes in different states or countries — useful if you are relocating or filing in multiple jurisdictions.
Tax-Loss Harvesting
Model a losing position to see how the loss offsets gains. Pair with our Stock P&L Calculator for a full picture.
Tips for Reducing Capital Gains Tax
Hold for the Long Term: Assets held longer than one year qualify for reduced long-term rates. This single decision can cut your tax by 7–22 percentage points compared to short-term rates.
Use Tax-Advantaged Accounts: Investments inside a Roth IRA or similar tax-sheltered account grow and withdraw tax-free, completely eliminating capital gains tax on those holdings.
Harvest Losses Strategically: Sell losing positions to offset gains dollar-for-dollar. In the US, up to $3,000 of excess losses can offset ordinary income, with the rest carried forward indefinitely.
Common Mistakes
Ignoring State or Provincial Tax
Federal tax is only part of the picture. States like California charge up to 13.3% on capital gains. Always include your local rate to get an accurate estimate.
Forgetting Transaction Costs in Cost Basis
Brokerage commissions, exchange fees, and transfer costs can all be added to your cost basis, reducing the taxable gain. Omitting them means paying tax on money you never actually received.
Triggering the Wash-Sale Rule
In the US, if you sell a security at a loss and buy a substantially identical one within 30 days, the loss is disallowed. Plan your harvesting windows carefully to avoid this trap.
Related tools
Browse allStock Profit & Loss Calculator
Calculate the ideal position size and potential profit/loss for stock trades. Determine recommended shares to buy based on your account risk and stop-loss levels.
OpenCrypto Tax Calculator India
Calculate your Indian crypto tax liability including 30% flat tax and 1% TDS. Stay compliant with the latest Income Tax rules for VDAs.
OpenRoth IRA Calculator
Project tax-free Roth IRA growth to retirement, compare Roth vs Traditional IRA outcomes, and plan annual contributions with compound interest.
OpenStock Return Calculator
Calculate total return, CAGR, and dividend income for any stock. Live prices via AlphaVantage, search from MoneyFlock's stock database.
OpenFrequently Asked Questions
What is a capital gains tax?
A capital gains tax is a levy on the profit you realize when you sell an asset (stocks, real estate, crypto, collectibles) for more than you paid. The tax applies only to the gain — the difference between sale proceeds and cost basis — not the total sale amount.
How is capital gains tax calculated?
Capital Gain = (Sale Price − Purchase Price) × Quantity. Tax Owed = Capital Gain × Tax Rate. The applicable rate depends on your holding period: short-term gains (held < 1 year) are taxed at your ordinary income rate, while long-term gains (held ≥ 1 year) qualify for reduced rates — typically 0%, 15%, or 20% in the US.
What is the difference between short-term and long-term capital gains?
Short-term capital gains apply to assets held for less than one year and are taxed at your ordinary income tax rate (up to 37% in the US). Long-term capital gains apply to assets held for one year or more and are taxed at preferential rates — 0%, 15%, or 20% in the US depending on taxable income. The difference can save you 7–22 percentage points in tax.
How does this differ from the Crypto Tax Calculator?
The Crypto Tax Calculator India is designed specifically for Indian crypto taxation rules (flat 30% + 4% cess, Section 115BBH). This Capital Gains Tax Calculator is global — you enter your own short-term and long-term rates plus an optional state/provincial rate, making it suitable for stocks, real estate, crypto, or any asset class in any country.
What are common mistakes when calculating capital gains tax?
Three frequent errors: (1) Forgetting to include transaction fees in your cost basis, which reduces your taxable gain. (2) Miscounting the holding period — the clock starts the day after purchase. (3) Ignoring state or provincial taxes, which can add 0–13% on top of federal rates. Also, wash-sale rules can disallow a loss if you repurchase the same asset within 30 days.
Can you show a worked example?
Buy 100 shares at $50 each (cost basis = $5,000). Sell at $80 each (proceeds = $8,000). Capital gain = $3,000. If held over 1 year at a 15% long-term rate with 5% state tax: federal tax = $3,000 × 15% = $450, state tax = $3,000 × 5% = $150, total tax = $600. Net profit after tax = $3,000 − $600 = $2,400, an after-tax return of 48%.