Stock Calculator

Stock Profit Calculator

One buy, one sell, commissions on both sides — profit, ROI, and break-even, computed exactly as you type. Editing the buy shares mirrors to the sell row until you change it yourself.

Enter your trades to see live results:

Settings
Buy fee
Sell fee
Decimal places
Percent
Amounts
Shares
shares at each
shares at each

One trade per line — shares@price, a leading minus means sell. Example: 100@50 or -40@65.

$48.8$57.5$66.2#1 BUY 100 @ $50.00 · avg $50.05#2 SELL 100 @ $65.00#1 BUY 100 @ $50.00 · avg $50.05#2 SELL 100 @ $65.00#1#2
Total P/L
Open position (shares)
Average cost basis
Total invested
Realized P/L
Unrealized P/L
Return on investment
Break-even price
After-tax P/L (illustrative)
Keyboard shortcuts
b / s Set the focused trade to buy / sell
Tab / Shift+Tab Next / previous field
↑ / ↓ Step a value by 1 (Shift: 10, Alt: 0.1)
Enter Copy the primary result
[ / ] Fewer / more decimal places (percent)
Esc Clear the field

The stock profit formula

A round-trip trade has four numbers: shares n, buy price b, sell price s, and what the broker charged. Put together:

profit = n × (s − b) − fees

The worked example: 100 shares at $50 cost $5,000 plus a $5 commission — $5,005 invested. Selling at $65 brings $6,500, minus another $5. Net profit $1,490, ROI +29.77% on the money that actually left your account.

Break-even is where the same formula crosses zero: (cost + fees) ÷ shares — here $50.10, not $50.00. Ten cents sounds trivial; it means the stock must rise 0.2% before you've made anything at all, and at higher commission rates or smaller positions the hurdle grows. That asymmetry — costs are certain, gains are not — is why the research finds frequent traders underperform; Trading costs: how commissions eat returns walks through the numbers with the study attached.

Profit on paper vs. profit realized

Until you sell, a gain is unrealized: real enough to watch, not real enough to spend, and taxed differently in most places. This page's engine is the same multi-lot calculator as the homepage — add rows for scaling in and out, and it will split your result into realized and unrealized automatically. For the reverse question ("what do I need to sell at just to get out even?") the break-even calculator answers it standalone.

Stock profit FAQ

What is the stock profit formula?

Profit = (sell price − buy price) × shares − total commissions. The worked example above: 100 shares bought at $50 and sold at $65 with $5 commissions each side is (65 − 50) × 100 − 10 = $1,490. Skip the commissions and you overstate the result by exactly what your broker kept.

How is return on investment (ROI) calculated for a stock trade?

ROI = net profit ÷ total invested × 100, where invested includes the buy commission. The example trade invested $5,005 and returned $1,490, so ROI is 1,490 ÷ 5,005 × 100 = +29.77%. ROI answers "how hard did my money work" — dollar profit alone can't compare a $5,000 trade with a $50,000 one.

What if I sold only part of my shares?

Toggle the sell row's shares down, or add more rows — this page runs the full position engine underneath. Partial sells realize profit at your average cost and leave the rest as an open position; enter Share price now to value it. The full calculator shows the same math with the complete results panel.

Are percentage commissions supported?

Yes — flip either fee's $/% control. A 0.1% commission on a $5,000 buy is $5; on the $6,500 sell it's $6.50. Percentage fees also move your break-even differently: instead of adding a flat amount, they shrink what you keep from every dollar of the sale.