How the stock profit/loss calculator works
Calculating your real profit or loss on a stock trade takes more than just subtracting the buy price from the sell price — you also need to account for the number of shares and any fees charged on either side of the trade. This calculator handles all of that for you in one step.
First, it calculates your total cost: the buy price multiplied by the number of shares, plus any fees you paid to make the purchase. This is the true amount of money that left your account to open the position. Next, it calculates your total proceeds: the sell price multiplied by the number of shares, minus any fees charged when you closed the position. This is the true amount of money that actually landed back in your account.
Your profit or loss in dollars is simply total proceeds minus total cost. Your profit or loss percentage expresses that dollar figure as a percentage of what you originally put in — profit ÷ total cost × 100 — which is the number you want when comparing the performance of this trade against other trades or against a benchmark like the S&P 500, regardless of how much money was involved in each.
Worked example
Suppose you bought 100 shares at $45.50 per share, paying a $4.95 brokerage fee on the purchase. Later, you sold all 100 shares at $62.75 per share, paying another $4.95 fee on the sale.
Total cost = (100 × $45.50) + $4.95 = $4,550.00 + $4.95 = $4,554.95
Total proceeds = (100 × $62.75) − $4.95 = $6,275.00 − $4.95 = $6,270.05
Profit = $6,270.05 − $4,554.95 = $1,715.10
Profit % = $1,715.10 ÷ $4,554.95 × 100 ≈ 37.65%
That's a healthy trade — but notice that the two $4.95 fees, while small individually, still shave a small but real amount off both your entry and exit. On a much smaller trade, those same flat fees could eat a meaningful chunk of your return.
Finding your break-even price
A related, useful number this calculator can help you back into is your break-even price — the exact sell price at which your profit/loss would be exactly $0, after fees. Using the worked example above (100 shares bought at $45.50 with a $4.95 buy fee, and a $4.95 sell fee), your total cost was $4,554.95. To break even, your total proceeds need to equal that same $4,554.95, which means selling at approximately $45.60 per share — just 10 cents above your buy price, entirely to cover the two flat fees. Try entering $45.60 as your sell price in the calculator above; you'll see the profit/loss drops to roughly zero. This is a useful sanity check before placing a sell order: if your target sell price is only pennies above your break-even price, fees and slippage could easily turn what looks like a "profit" on paper into a real-world loss.
This effect is far more pronounced on small trades. A $4.95 fee on each side of a $500 trade represents about 2% of your position just in fees — meaning the stock needs to move roughly 2% in your favor before you've even broken even, let alone turned a profit. The same $4.95 fee on a $50,000 trade is a rounding error. If you trade frequently in small dollar amounts, it's worth comparing brokers on commission structure, since fee drag compounds the same way returns do.
Common mistakes to avoid
1. Forgetting fees entirely
Many investors mentally calculate profit as just (sell price − buy price) × shares and forget that brokerage commissions, regulatory fees, or spread costs reduce the real number on both ends of the trade. This is especially significant for smaller trades or frequent traders, where flat-fee costs represent a larger percentage of the total.
2. Confusing dollar profit with percentage return
A $1,715 profit sounds great, but it means something very different if it came from a $4,555 investment (37.65% return) versus a $45,550 investment (3.76% return). Always look at both numbers together — the dollar amount tells you how much money you made, the percentage tells you how efficiently your capital was used.
3. Ignoring taxes on realized gains
This calculator shows your pre-tax profit or loss. In a taxable brokerage account, realized gains are typically subject to capital gains tax — short-term rates (for positions held under a year) are usually higher than long-term rates. The profit shown here is not what actually lands in your pocket after tax season; consult a tax professional for your specific situation.
Dividends aren't included
This calculator measures capital gains only — the change in the share price itself, times your number of shares, minus fees. If you held a dividend-paying stock during the period between your buy and sell dates, any dividends you collected along the way are real return that this tool doesn't count. For a full picture of total return on a dividend-paying position, add the sum of dividends received (after any withholding tax, if applicable) to the profit/loss figure shown here. This matters most for slower-growing, income-oriented stocks, where dividends can represent a meaningful share of the total return — and matters least for high-growth stocks that pay no dividend at all, where price appreciation is the whole story.