StockCalc

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

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

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.

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.