A capital gains calculator helps you estimate profit, tax exposure, and after-tax proceeds when you sell an investment such as stocks, ETFs, crypto, real estate, or collectibles. Instead of relying on rough mental math, you can quickly model different sale prices, holding periods, and tax rates before making a decision.
What is a capital gain?
A capital gain is the difference between what you receive when selling an asset and your adjusted cost basis. If the sale proceeds are lower than your basis, you have a capital loss instead.
- Cost basis: purchase price plus eligible acquisition costs (such as commissions/fees).
- Net proceeds: sale value minus selling costs.
- Capital gain/loss: net proceeds minus cost basis.
How this capital gains calculator works
This calculator follows a practical, simplified approach:
- Computes total cost basis from purchase price, quantity, and buying fees.
- Computes net proceeds from sale price, quantity, and selling fees.
- Calculates gross gain or loss.
- Applies any loss carryforward to reduce taxable gains.
- Selects a tax rate based on short-term or long-term treatment.
- Shows estimated tax and estimated after-tax gain.
It is designed for planning and education, not for filing taxes.
Short-term vs long-term gains
In many tax systems, short-term gains are taxed at ordinary income rates, while long-term gains receive preferential rates. A holding period of more than one year is often treated as long-term. The exact rule and rates depend on jurisdiction and filing status.
Inputs explained
Purchase and sale values
Enter your per-unit purchase price, per-unit sale price, and quantity. The calculator multiplies these values to estimate total acquisition and total sale value.
Fees and commissions
Costs matter. Buying fees increase basis, and selling fees reduce proceeds. Even small fee differences can materially change your final taxable gain.
Holding period
You can choose:
- Auto: uses purchase and sale dates to determine short-term or long-term status.
- Manual: force short-term or long-term if you already know treatment.
Tax rates and loss carryforward
Use your expected short-term and long-term rates for a more personalized estimate. If you have carryforward losses from prior years, they may offset current gains, reducing taxable income.
Example scenario
Suppose you bought 10 shares at $100 each and sold at $150 each with no fees. Your gross gain is $500. If long-term treatment applies and your long-term capital gains rate is 15%, estimated tax is $75, leaving an estimated after-tax gain of $425.
If the same trade is short-term and taxed at 32%, estimated tax jumps to $160. That holding period difference alone changes your after-tax outcome by $85.
Ways to reduce capital gains tax (legally)
- Hold investments longer when long-term treatment is favorable.
- Tax-loss harvest by realizing losses strategically to offset gains.
- Spread sales across tax years to manage bracket impact.
- Consider tax-advantaged accounts for eligible assets.
- Track basis carefully so you do not overpay taxes.
Common mistakes to avoid
- Ignoring fees and transaction costs.
- Forgetting partial-lot basis differences.
- Using the wrong holding period assumption.
- Assuming a single flat rate applies to every gain.
- Not accounting for carryforward losses.
Frequently asked questions
Does this calculator handle every tax rule?
No. It provides a clean estimate for planning. Real returns may include special rules, net investment income tax, state taxes, wash-sale interactions, depreciation recapture, and filing-status effects.
Can I use this for crypto or real estate?
Yes, as a high-level estimator. Enter your basis, proceeds, and fees. For real estate, tax treatment may involve additional adjustments that are outside this simple model.
What if my result is a loss?
The calculator shows a capital loss and estimated tax as zero for that transaction. In practice, losses may offset other gains and potentially limited ordinary income, depending on local tax law.