Stock Calculator

Stock Profit Calculator

One buy and one sell with fees on both sides: profit, ROI and break-even, exact as you type.

Type a ticker or a company name. The search runs in your browser.
Settings
Buy fee
Sell fee
Decimal places
Percent
Amounts
Shares

Enter your trades to see live results:

shares at each
shares at each

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

How to read this chart
  • Each column is one trade, in order from left to right. ▲ is a buy and ▼ is a sell, drawn at the price of that trade. On a computer, point at a column to see its details.
  • The solid line is your average cost per share after each trade. A buy pulls it up if its cost per share, including fees, is above the line, and down if that cost is below it. The price you sell at does not move it.
  • At each sell, a bar runs from what the sold shares cost you, fees included, to the sell price. That gap times the shares sold is the profit or loss you locked in, printed next to the bar in green for a gain and red for a loss.
  • Enter “Share price now” to add a dashed line at that price. The shaded band between it and your average cost is the unrealized profit or loss on the shares you still hold. If the price is far from your trades, the line sits at the edge with an arrow so the trades stay readable.
  • The bars at the bottom show how many shares you hold after each trade. The bright part is what a buy added, and a red outline is what a sell took away.
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.

How to read your trades

Video tutorial · English with captions · 4:37

The player loads from youtube-nocookie.com only when you open it. Watch on YouTube ↗