Capital Gains Calculator Guide: Cost Basis, Holding Periods & Tax Framing
Capital gain is the difference between what you realize on sale and your adjusted cost basis—simple algebra wrapped in jurisdiction-specific rules.
Capital Gains Calculator Guide: Cost Basis, Holding Periods & Tax Framing
Updated May 2026 · ~8 min read
Capital gain is generally the difference between amount realized and adjusted basis under applicable rules, but recognition, character, holding period, lot selection, currency, corporate actions, losses, wash-sale or similar provisions, and account type vary by jurisdiction. A calculator cannot determine actual tax liability.
When capital-gain framing matters
- Exit planning: you estimate taxable gain magnitude before deciding timing—not as the only decision driver.
- Cost-basis hygiene: you reconcile purchase lots, splits, and reinvestment history before claiming figures.
- Education: you compare how basis versus proceeds shifts gain when markets gap around sales.
- Not legal advice: cross-check every assumption with a qualified professional where stakes are high.
The formula
Capital gain (conceptual) = Amount realized on sale − Adjusted cost basis Amount realized often equals sale price × shares − selling commissions (policy-dependent) Basis commonly starts at purchase price + purchase fees ± subsequent adjustments
Adjusted basis and amount realized can include fees and other adjustments depending on the rule set. Unrealized appreciation, deemed dispositions, derivatives, gifts, inheritance, and fund distributions can require different treatment.
A basis calculation before tax classification
Selling for $15,000 with a documented adjusted basis of $10,500 creates a $4,500 modeled gain before classification, netting, exclusions, currency, and tax-rate analysis.
Common mistakes
- Using purchase price alone when basis adjustments apply.
- Applying one universal short-term or long-term rule.
- Ignoring lot selection, wash-sale or similar rules, and loss netting.
- Treating unrealized appreciation as an ordinary realized gain without checking the rule set.
- Using a flat tax percentage as actual liability.
Try the calculator
Use the interactive calculator to plug in your numbers and see results instantly—without redoing the math by hand.
Open capital gains calculator →FAQ
Does the calculator determine tax due?
No. It estimates arithmetic under selected inputs and does not apply every jurisdiction-specific rule.
What is adjusted basis?
A rule-dependent starting cost modified by applicable fees, reinvestments, corporate actions, depreciation, and other adjustments.
Are holding-period rules universal?
No. Definitions and rates vary by jurisdiction, asset, account, and year.
Can losses offset gains?
Often under specific ordering, basket, annual-limit, and carryforward rules that vary.
Related calculators
Educational Disclaimer
This article is for educational and informational purposes only and should not be considered investment, financial, tax, or legal advice. Market information may change over time, and readers should verify important details independently before making financial decisions.