b2KIT

Stock Profit Calculator

Calculate gains or losses from stock trades with buy/sell price, shares, and commission inputs.

Tested tool guide Tested browser tools Checked August 16, 2026

What Stock Profit Calculator does, with a checked example

This calculator works out the real result of a stock trade: enter the price you paid per share, the price you sold at, how many shares, and the commissions charged on both legs, and it returns your net profit or loss in dollars and as a percentage of what you actually invested. The arithmetic is simple: price difference times shares, minus fees. But the part that most often surprises people is that commissions apply on both sides of the trade, so two small flat fees can turn a marginal gain into a loss, particularly on small positions.

Worked example

A concrete input and expected output from the current implementation.

Input

Buy 100 shares of XYZ at $50.00, sell all 100 at $62.50, commission $10.00 on each side of the trade.

Expected output

Net profit: $1,230.00. Total cost: $5,010.00 ($5,000.00 purchase plus $10.00 buy commission). Net proceeds: $6,240.00 ($6,250.00 sale minus $10.00 sell commission). Return: 24.55% on invested capital.

The gross gain is $12.50 per share on 100 shares, or $1,250.00, and the two $10.00 commissions reduce that to $1,230.00. Dividing by the $5,010.00 actually invested gives 24.55%, slightly less than the stock's 25% price move.

How the result is produced

1

Both sides of the trade

Total cost equals shares multiplied by buy price plus the buy-side commission; net proceeds equal shares multiplied by sell price minus the sell-side commission. Profit is proceeds minus cost, and the percentage return divides profit by the total cost. Because the buy commission sits in the denominator and both commissions reduce the numerator, the reported return is always a bit below the stock's own price move.

2

Scope of the result

The output is the nominal cash result of a single buy-and-sell pair. There is no time dimension, so nothing is annualized and holding period plays no part. It also assumes every share was bought at one price and sold at one price, so trades built from multiple lots, or stocks that paid dividends or split, need those events folded into the entered prices first to stay accurate.

Good uses

  • Checking before you sell whether a planned gain survives both commissions, especially on small positions where flat fees bite hardest.
  • Recording the realized result of a completed trade so your own records match what your broker statement shows.
  • Comparing brokers: entering the same prices with different commission levels shows what a given fee schedule costs you per trade.

Limits and checks

  • This is a nominal trade result, not a taxable gain. No tax rate, tax amount, or wash-sale logic appears here, so do not use the dollar figure as your taxable profit.
  • The percentage return is computed on the money actually invested, including the buy commission, so it will not match the stock's simple price move; the difference grows as commissions do.
  • Entering an average buy price for shares accumulated at several different prices distorts the result, and for partial sells the outcome can be sensitive to which cost basis method applies.

Common questions

If my broker charges no commission, should I still use this calculator?

Yes, but with zero fees the percentage comes out matching the price move and the profit is simply shares times the price difference. The tool still helps because it forces you to state both prices explicitly, and if your broker charges any other per-trade fee, you can fold it in as the commission.

Does the percentage account for how long I held the stock?

No. There is no holding period or annualization anywhere in the calculation, so a 10% gain realized in a week and the same gain realized over three years both report 10%. If you need a rate comparable across different holding periods, convert the result to an annualized return or CAGR separately.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools