MaximCalculator Free, fun & accurate calculators
💰 Platinum finance layout
🌙Dark Mode

Capital Gains Calculator

Use this free Capital Gains Calculator to estimate your profit or loss, ROI, tax owed, and after-tax gain when you sell an asset (stocks, crypto, ETFs, collectibles, land, etc.). Add fees, choose short-term vs long-term, and get a clean breakdown you can screenshot or share.

Instant gain/loss + ROI
🧾Fees & cost basis included
🏷️Optional tax estimate (short/long)
📱Perfect for sharing & screenshots

Enter your trade details

Fill in what you paid, what you sold for, and any fees. Then (optional) add a tax rate to estimate your after-tax profit. All calculations run locally in your browser.

💱
🛒
🏁
🧮
🧾
🧾
🏷️
Your result will appear here
Enter your buy price, sell price, and quantity — then tap “Calculate Capital Gain”.

This tool provides a simple estimate and is not tax advice. Tax rules vary by country, asset type, and your personal situation. Use this calculator as a planning aid and confirm with your broker statements or a tax professional.

🧠 Formula Breakdown

How capital gains are calculated

A capital gain is the profit you make when you sell something (an “asset”) for more than you paid. A capital loss is the opposite — you sell for less than your total cost basis. The tricky part is that your “real” gain isn’t just the simple difference between buy price and sell price. Fees, commissions, and other costs change the math.

Step 1: Calculate cost basis

Your cost basis is the total amount you invested into the position: the purchase price times quantity, plus any buying fees.

  • Gross cost = Buy price × Quantity
  • Cost basis = Gross cost + Buy fees
Step 2: Calculate net proceeds

When you sell, you don’t always receive the full sell price. Selling fees or exchange fees reduce what you actually take home.

  • Gross proceeds = Sell price × Quantity
  • Net proceeds = Gross proceeds − Sell fees
Step 3: Capital gain (or loss)

Your capital gain is the difference between what you received and what you put in:

  • Capital gain = Net proceeds − Cost basis

If this number is negative, you have a capital loss. Losses can matter for tax planning in many countries, but the rules are complicated — so treat the tax part of this calculator as a simple estimate.

Step 4: ROI (return on investment)

ROI converts your profit into a percent, which is useful for comparing investments of different sizes:

  • ROI % = (Capital gain ÷ Cost basis) × 100
Step 5: Optional tax estimate & after-tax gain

If you enter a tax rate (like 15%), we estimate the tax on positive gains. (We assume no tax credit on losses.) Then we compute what you keep after tax:

  • Estimated tax = max(Capital gain, 0) × (Tax rate ÷ 100)
  • After-tax gain = Capital gain − Estimated tax

The short-term vs long-term selector is here because many tax systems treat them differently. But instead of hardcoding country-specific rules (which change often), this calculator lets you enter the rate that applies to you.

🧪 Examples

Capital gains examples (with fees)

Example 1: Stock trade profit

You buy 10 shares at $120.50 and sell at $175.00. You paid $4.99 to buy and $4.99 to sell.

  • Cost basis = (120.50 × 10) + 4.99 = $1,209.99
  • Net proceeds = (175.00 × 10) − 4.99 = $1,745.01
  • Capital gain = 1,745.01 − 1,209.99 = $535.02
  • ROI = 535.02 ÷ 1,209.99 ≈ 44.22%
Example 2: Crypto sale with exchange fees

You buy 0.75 BTC at $28,000 and sell at $35,000. Total buy fees are $30 and sell fees are $45.

  • Cost basis = (28,000 × 0.75) + 30 = $21,030
  • Net proceeds = (35,000 × 0.75) − 45 = $26,205
  • Capital gain = 26,205 − 21,030 = $5,175
  • ROI ≈ 5,175 ÷ 21,030 ≈ 24.61%
Example 3: After-tax profit estimate

Using Example 1, imagine your long-term capital gains tax rate is 15%.

  • Estimated tax = 535.02 × 0.15 = $80.25
  • After-tax gain = 535.02 − 80.25 = $454.77

Notice how fees and taxes shrink the “headline” profit. This is why after-tax, after-fee math is the most honest way to compare investments.

🔍 How It Works

What this calculator is doing (in plain English)

Think of a trade as two totals: money in and money out. Money in is your cost basis. Money out is your net proceeds. The gain is simply out minus in.

  • If net proceeds are higher than cost basis, you made money (gain).
  • If net proceeds are lower than cost basis, you lost money (loss).
  • ROI turns that gain/loss into a percent so you can compare across trades.
Why “per unit” inputs?

Most people know their buy and sell price per share/coin/unit. The calculator multiplies by quantity to build totals. This also works for real estate or collectibles — just set quantity to 1.

Why taxes are “optional” here

Capital gains tax depends on rules that vary by country and can change year-to-year. Even within one country, the rate can depend on holding period, income level, asset type, and deductions. So this tool uses a simple approach: you provide the rate, and we compute an estimate based on the gain.

A fast way to use it for decision-making

If you’re deciding whether to sell, try this:

  • Enter your current sell price (today’s price) and fees → screenshot results.
  • Change the sell price to a target price (your “I would sell at…”) → compare ROI and after-tax gain.
  • If your net improvement is small, fees/taxes might not be worth waiting for.
❓ FAQs

Frequently Asked Questions

  • What is a capital gain?

    A capital gain is the profit you earn when you sell an asset for more than your total cost basis (what you paid, including fees). This calculator shows the gain in dollars and as an ROI percentage.

  • What if I have a capital loss?

    The calculator will show a negative number as a loss. Many tax systems allow losses to offset gains, but rules vary. This tool doesn’t apply loss carryover rules — it simply reports your trade result.

  • Does this work for crypto?

    Yes. Treat “buy price” and “sell price” as your average buy and sell prices, and include exchange fees. Quantity can be fractional (like 0.75 BTC or 12.5 SOL).

  • How do I calculate cost basis if I bought multiple times?

    If you bought in multiple lots, you typically use an average cost basis (or FIFO/LIFO depending on rules and broker reporting). For quick planning, use the Stock Average Cost Calculator.

  • Is the tax estimate accurate?

    It’s an estimate based on the rate you enter. Real taxes may include additional rules (income brackets, wash sales, offsets, exemptions, local taxes). Use this calculator for planning, not filing.

  • Why does ROI use cost basis in the denominator?

    ROI measures profit relative to what you invested. Using cost basis makes ROI comparable across trades: a $500 gain on a $1,000 investment (50% ROI) is very different from a $500 gain on a $50,000 investment (1% ROI).

  • Can I use this for real estate?

    For a simple sale comparison, yes: quantity = 1, buy price = purchase price, sell price = sale price, and add fees. Real estate often has additional factors (closing costs, depreciation, improvements, exclusions), so treat this as a quick estimate only.

MaximCalculator provides simple, user-friendly tools. Always double-check important numbers with official statements and local rules.