Stock profit calculator
Enter the number of shares, the price you paid, the price you sold at and the commission to see the profit, the total cost and the percentage return.
Before tax and any account-level fees you did not enter. Not investment advice.
How this calculator works
The cost of a trade is not just price times shares: commission (and any regulatory fees) are charged on both sides, so they reduce the profit twice. The return on cost divides the profit by what you actually put in, which is the number to compare with an index fund or a savings rate.
This calculator covers long trades: buy first, sell later. For a short sale the order is reversed and the loss can exceed the initial cost.
The formula
total cost = shares × buy price + commission
net proceeds = shares × sell price − commission
profit = net proceeds − total cost
return on cost = profit ÷ total cost × 100100 shares bought at $50 and sold at $62 with $5 commission per trade: cost $5,005, proceeds $6,195, profit $1,190 — a 23.8% return.
Worked example
The trade cost $5,005 and returned $6,195, so the profit is $1,190 — 23.8% on cost.
Common mistakes
- Ignoring taxes. Short-term gains are taxed as ordinary income in the US; the after-tax return can be several points lower.
- Comparing to price change only. A 24% price rise with two commissions is not a 24% return — the calculator shows the real figure.
- Forgetting currency and platform fees. Add them to the commission field so the return reflects everything you paid.
Frequently asked questions
Does the calculator handle short selling?
No. It assumes you buy at the buy price and sell at the sell price. For a short sale, swap the prices and note that the loss is not capped.
Are dividends included?
No — only the capital gain or loss between the two prices. Add dividends you received to the profit if you want the total return.
What counts as commission?
Any fee charged to execute the trade, including platform fees and regulatory charges.
Related calculators
ROI CalculatorDividend Income CalculatorCompound Interest Calculator · All Investing calculators