Stock Profit Calculator
Calculate your profit or loss on a stock sale after fees, your percentage return, and your average cost per share when you bought in more than once.
Profit / Loss on This Trade
How It Works
Profit on a stock trade is simpler than it looks, but fees make it easy to get wrong. The formula is: profit = (sell price − buy price) × shares − fees. Both sides have fees — what you paid to buy and what you pay to sell — and both come off the profit. The return on investment (ROI) is the profit divided by the total cost, including the buy fee, expressed as a percentage. And the break-even sell price is the price at which the sale proceeds exactly cover the purchase cost plus both fees: (buy price × shares + buy fee + sell fee) ÷ shares. Sell above it and you profit; sell below it and you lose.
Average cost matters when you buy the same stock more than once at different prices. Your average cost per share is the total amount spent divided by the total number of shares: (shares&sub1; × price&sub1; + shares&sub2; × price&sub2;) ÷ (shares&sub1; + shares&sub2;). It is a weighted average, so a large buy at a high price pulls the average up more than a small buy at a low price pulls it down. Comparing the current price with your average cost — not with any single buy price — tells you whether your position as a whole is up or down.
All figures here are before tax. In the United States, profits on shares held for a year or less are generally taxed as ordinary income (short-term capital gains), while profits on shares held for more than a year are generally taxed at lower long-term capital gains rates. The holding period can therefore change the after-tax profit significantly, which is why this calculator shows pre-tax figures and leaves the tax calculation to you or a tax professional.
Worked Example
Buy 100 shares at $45 with a $10 commission: total cost is $4,500 + $10 = $4,510. Sell all 100 shares at $62 with another $10 commission: proceeds are $6,200 − $10 = $6,190. Profit is $6,190 − $4,510 = $1,680, and the return on investment is $1,680 ÷ $4,510 = 37.25%. The break-even sell price is ($4,500 + $10 + $10) ÷ 100 = $45.20 a share — anything above $45.20 is profit, anything below is a loss.
For average cost: buy 50 shares at $40 ($2,000) and later 50 shares at $50 ($2,500). Total spent is $4,500 for 100 shares, so the average cost is $4,500 ÷ 100 = $45.00 a share. If the stock now trades at $62, the position is up $17.00 a share on average — even though the second buy, taken alone, is only up $12.00 a share.
Assumptions and What This Calculator Leaves Out
- All figures are pre-tax. Short-term and long-term capital gains are taxed differently, and your after-tax profit will be lower.
- It assumes you sell all shares at one price. Selling in stages at different prices needs a separate calculation for each sale.
- It does not include dividends received while holding the shares, which add to the total return.
- It does not model wash-sale rules, which can disallow a loss if you buy the same stock shortly before or after selling it.
- Average cost here is the simple weighted average of purchase prices. For tax purposes, brokers may use other cost-basis methods (FIFO, specific identification), which can give different taxable gains.
Profit on the worked example (100 shares bought at $45, $20 total fees) at different sell prices:
| Sell price | Proceeds | Profit / loss | ROI |
|---|---|---|---|
| $40.00 | $3,990.00 | −$520.00 | −11.53% |
| $45.20 | $4,510.00 | $0.00 | 0.00% |
| $50.00 | $4,990.00 | $480.00 | 10.64% |
| $62.00 | $6,190.00 | $1,680.00 | 37.25% |
| $80.00 | $7,990.00 | $3,480.00 | 77.16% |
At $45.20 the trade breaks even exactly — the $20 of fees is the only reason the break-even price is above the $45 buy price. On a small trade, fees matter more: the same $20 of fees on 10 shares instead of 100 would push the break-even price to $47.00.
How to Use This Calculator
Enter the buy price, the number of shares, the sell price, and the fees on each side — the result shows your profit or loss, your percentage return, and the break-even sell price. The second section calculates your average cost per share across two buys at different prices: enter the shares and price of each buy and the weighted average appears in the results. Use the Reset button to return to the worked example.
Tips and Practical Advice
Always include fees before judging a trade. A stock that rises 2% can still lose money after commissions on a small position, and frequent trading multiplies the fee drag. If your broker charges per trade, fewer, larger trades beat many small ones. If your broker is commission-free, check for other costs — bid-ask spreads and payment-for-order-flow arrangements still cost you something on every trade, even when no fee is printed on the statement.
Use average cost to judge a position, not your most recent buy price. It is natural to anchor on the price you paid last, but the position's real gain or loss is measured against the weighted average of everything you paid. And remember the tax angle: holding a winning position past the one-year mark generally moves the gain into the lower long-term capital gains rates, which can be worth more than a small extra price rise. That is a decision for your own tax situation, not a rule — but it is worth knowing before you sell.
No market data or prices are quoted on this page — every figure is calculated from the numbers you enter. Tax treatment described is general US information, not tax advice. Last reviewed: 13 November 2026.
Frequently Asked Questions
How do I calculate profit on a stock sale?
Profit = (sell price − buy price) × shares − fees. For 100 shares bought at $45 and sold at $62 with $20 of total fees: ($62 − $45) × 100 − $20 = $1,680. Both the buy fee and the sell fee come off the profit.
What is the break-even price for a stock trade?
The sell price at which proceeds exactly cover your costs: (buy price × shares + buy fee + sell fee) ÷ shares. For 100 shares bought at $45 with $20 of fees, the break-even price is $45.20 a share.
How do I calculate average cost per share?
Divide the total amount spent by the total number of shares. Buying 50 shares at $40 and 50 at $50 costs $4,500 for 100 shares, so the average cost is $45.00 a share. It is a weighted average, so larger buys count more.
What is a good return on investment for a stock?
There is no single good number — it depends on the holding period, the risk taken, and the market. A 37% return in a year is strong; the same return over ten years is modest. Compare returns over the same period, and always count fees and tax.
Do I pay tax on stock profits?
In the US, profits are generally subject to capital gains tax. Shares held for a year or less are usually taxed as ordinary income (short-term gains); shares held for more than a year are generally taxed at lower long-term capital gains rates. This calculator shows pre-tax figures only.
Last updated: