Calculating profit on a stock trade looks simple — sale price minus cost — but commissions, lots and dividends add small wrinkles that matter for taxes.

The Basic Formula

Profit = (Sale price × Shares) − (Buy price × Shares) − Total commissions

Percentage return = Profit ÷ Total cost × 100

A Worked Example

You buy 100 shares of XYZ at $50 with a $2 commission. You sell at $65 with a $2 commission.

  • Cost: 100 × $50 + $2 = $5,002
  • Proceeds: 100 × $65 − $2 = $6,498
  • Profit: $1,496
  • Return: $1,496 / $5,002 = 29.9%

Or just enter it into our Stock Profit Calculator and the math is instant.

Multiple Buys

If you bought shares in multiple lots at different prices, use average cost or FIFO depending on your tax method. Our Stock Cost Basis Calculator handles unlimited lots.

Don't Forget Dividends

If you received dividends while holding, total return = profit + dividends received. For DRIP positions, your share count grew over time — the DRIP Calculator tracks this.

Taxes

Short-term gains (held < 1 year) are taxed at your ordinary income rate. Long-term gains (held ≥ 1 year) get the preferred 0/15/20% rate. The pre-tax profit number is what you got; the after-tax number is what you keep.

Bottom Line

Always include commissions and dividends for a true picture, separate short-term from long-term lots before April, and verify your broker's reported numbers — the math is too simple to be wrong but the inputs occasionally are.

Run the numbers yourself

Plug your own inputs into our free calculators — no signup.

Browse calculators →
S

Editorial Team

Investment calculators & education

Share X f in