Capital Gains Calculator
Calculate realized capital gain or loss from purchase and sale prices, quantity, and fees, with an optional user-supplied estimated tax rate on positive gain. Cost basis here is a simplified cost basis — not a legally adjusted tax basis.
Your results will appear here
Enter your assumptions and calculate to see the estimated result and supporting details.
How this calculator works
Enter purchase price, sale price, quantity, purchase fees, sale fees, and an optional estimated tax rate.
Results show simplified cost basis, net sale proceeds, gain or loss, return on basis, and estimated tax on positive gain only.
Formula / methodology
simplified cost basis = (purchase price × quantity) + purchase fees net sale proceeds = (sale price × quantity) − sale fees gain/loss = net sale proceeds − simplified cost basis return = gain/loss ÷ simplified cost basis estimated tax = max(gain, 0) × user-supplied tax rate
- Actual tax basis may differ due to reinvested distributions, stock splits, corporate actions, return of capital, wash-sale adjustments, and other factors not modeled here.
- This calculator does not estimate tax deductions, credits, loss carryforwards, loss offsets, or other tax treatment arising from an investment loss.
Worked example
Buy at $50, sell at $70, 100 units, $20 purchase fees, $30 sale fees, 15% user-supplied tax → cost basis $5,020, net proceeds $6,970, gain $1,950, return ≈ 38.84%, estimated tax $292.50, after-tax gain $1,657.50.
Important assumptions
- Simplified cost basis = gross purchase cost + purchase fees.
- Estimated tax uses only the user-supplied rate and applies only to positive gain.
- No short-term vs long-term classification, brackets, or jurisdiction rules are applied.
- Holding period and wash-sale treatment are not modeled.
Common questions
Not necessarily. Legal adjusted basis can differ for many reasons this calculator does not model. Treat results as educational arithmetic.
Capital Gains divides by simplified cost basis (purchase plus purchase fees). Investment Return divides by initial investment alone when mapping equivalent cash flows. Dollar gain can still match.
Estimated tax is $0. No tax deduction or loss benefit is calculated.
Yes. Quantity must be greater than zero and may include decimals.