Capital Gains Tax Calculator
Estimate your gain or loss, tax impact, and after-tax result for stocks, ETFs, crypto, real estate, or other investments.
Tip: This calculator is an estimate tool. Real tax results depend on your specific tax situation, offsets, carryforwards, and filing details.
How this cap gains calculator works
A capital gain is the difference between what you receive when you sell an asset and your adjusted cost basis. This calculator uses your purchase details, sale details, and estimated tax rates to show:
- Your total cost basis
- Your net sale proceeds
- Your capital gain or capital loss
- Estimated taxes based on short-term or long-term treatment
- Your estimated after-tax gain/loss
Capital gains formula
Step 1: Determine cost basis
Cost basis is typically your purchase price multiplied by units, plus buying costs (like commissions and transaction fees).
Cost basis = (Purchase price × Units) + Buy fees
Step 2: Determine net proceeds
Net proceeds are what you receive from selling, after subtracting selling fees.
Net proceeds = (Sale price × Units) − Sell fees
Step 3: Calculate gain or loss
Capital gain/loss = Net proceeds − Cost basis
If the result is positive, you have a gain. If it is negative, you have a loss.
Short-term vs long-term capital gains
In general, assets held for 365 days or less are considered short-term, and assets held for more than 365 days are long-term. Short-term gains are often taxed at higher ordinary income rates, while long-term gains often receive lower preferential rates.
This calculator automatically uses your holding period to choose the short-term or long-term federal rate, then adds your state/local rate for a combined estimate.
What to include in your inputs
Include these items when possible
- Broker commissions and transaction fees
- Exchange fees for crypto trades
- Transfer costs directly tied to acquisition/disposition
Common mistakes to avoid
- Ignoring fees and overstating gains
- Using the wrong holding period
- Forgetting state taxes
- Assuming all gains are taxed at one flat rate
Example scenario
Suppose you bought 100 shares at $25 each and paid $9.99 in buy fees. Later, you sold at $40 and paid $9.99 in sell fees. If you held the shares for 500 days and your long-term rate is 15% with a 5% state rate:
- Cost basis = $2,509.99
- Net proceeds = $3,990.01
- Capital gain = $1,480.02
- Combined tax rate = 20%
- Estimated tax = $296.00
- After-tax gain ≈ $1,184.02
Planning tips for investors
- Hold a bit longer when appropriate: Crossing into long-term treatment can materially reduce tax.
- Tax-loss harvesting: Realized losses may offset gains, lowering your tax bill.
- Watch position size: Large concentrated exits can create large one-year tax spikes.
- Estimate before you sell: Run scenarios using different sale prices and dates.
Frequently asked questions
Does this include NIIT or special surtaxes?
No. This tool uses the rates you enter. If additional surtaxes apply to your situation, include them in your state/local field or adjust your tax assumptions manually.
Can I use this for crypto?
Yes. The same gain/loss concept applies to many asset classes, including cryptocurrency, as long as you provide accurate purchase, sale, and fee data.
What if I have a capital loss?
The calculator will show a negative gain and estimate a tax benefit based on your entered rates. Actual deductibility may be limited, so consult tax guidance for your jurisdiction.