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.

Frequently Asked Questions

How do you calculate profit on a stock trade?

The basic formula is (sale price × shares sold) minus (purchase price × shares bought) minus total commissions, and dividing that profit by your total cost gives your percentage return. For example, buying 100 shares at $50 with a $2 commission and selling at $65 with a $2 commission yields a profit of $1,496, or roughly a 29.9% return. Always factor in both buy-side and sell-side commissions for an accurate figure.

Should dividends be included when calculating total stock return?

Yes — if you received dividends while holding a stock, your true total return is your capital gain (or loss) plus dividends received, not just the price change alone. For positions enrolled in a Dividend Reinvestment Plan (DRIP), your share count also grows over time as dividends buy additional shares, adding complexity to tracking total return. Ignoring dividends can meaningfully understate your actual investment performance.

How does the holding period affect the tax on stock profit?

In the U.S., profits on shares held for less than one year are generally taxed as short-term capital gains at your ordinary income tax rate, while shares held for one year or longer typically qualify for the lower long-term capital gains rates (commonly 0%, 15%, or 20% depending on income). This means the pre-tax profit you calculate is not the same as what you actually keep after taxes. Because tax situations vary, consulting a tax professional is generally recommended for significant gains.

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