Stock Calculator

Calculate your stock investment profit or loss, total return percentage, and cost basis. Enter buy and sell prices along with the number of shares to see your gains including commission costs.

Stock Profit / Loss

Stock Return Formulas

Cost Basis = (Buy Price × Shares) + Buy Commission Proceeds = (Sell Price × Shares) − Sell Commission Net Profit = Proceeds − Cost Basis Total Return % = (Net Profit / Cost Basis) × 100 Break-Even Price = (Cost Basis + Sell Commission) / Shares

Frequently Asked Questions

What is cost basis?+
Cost basis is what you paid for your investment, including commissions and fees. It's used to calculate capital gains taxes when you sell. If you've bought shares at different prices over time (averaging in), your cost basis is the weighted average purchase price times total shares.
How are stock gains taxed?+
In the US, short-term gains (held <1 year) are taxed as ordinary income. Long-term gains (held >1 year) are taxed at 0%, 15%, or 20% depending on income level. Always consult a tax professional for advice specific to your situation.

Profit and return

Profit = (sell price − buy price) × shares − fees Return % = profit ÷ total cost × 100

Example: 50 shares bought at $42, sold at $51, with $10 total fees.

  • Gross gain: (51 − 42) × 50 = $450
  • Net profit: $440
  • Return: 440 ÷ (42 × 50 + 10) = 20.9%

Include fees on both sides. Ignoring them overstates return, and on small positions the distortion is substantial.

Total return includes dividends

Price change alone understates the result for dividend-paying holdings. Total return adds dividends received, which over long periods can represent a large share of the overall gain.

Why annualising matters

A 20% return means very different things over six months and over five years. Comparing investments requires putting them on the same time basis:

Annualised = ((end ÷ start) ^ (1 ÷ years)) − 1

A 50% gain over 4 years annualises to about 10.7% a year — respectable, but not the headline figure.

Percentage gains and losses are asymmetric

A 50% loss requires a 100% gain to recover. Down from $100 to $50, you need to double just to return to where you started.

LossGain needed to break even
10%11%
25%33%
50%100%
75%300%

This asymmetry is the mathematical argument for limiting large drawdowns.

Figures here exclude tax, which varies by jurisdiction, holding period and account type. This is general information, not investment advice.