Stock profit calculator
Enter how many shares you traded, the price you paid, the price you sold at and what your broker charged. The calculator returns the profit or loss, the return on what you put in, and the price you needed just to break even.
Everything is calculated in your browser. Nothing you type is sent anywhere, stored, or logged.
Profit = (sell price − buy price) × shares − commissions. Return % = profit ÷ cost basis × 100. Buying 100 shares at $50 and selling at $57.50 with $1 commission each way makes $748, a 14.96% return on the $5,001 you paid in.
Key takeaways
- Your cost basis is what you paid including the buy commission. Return is measured against it, not against the share price alone.
- The break-even price sits slightly above your buy price, because both commissions have to be earned back first. On small positions that gap is larger than it looks.
- A short profits when the price falls, using the same arithmetic with the order reversed, but it carries borrow fees, dividend payments and a loss with no ceiling.
- The figure is before tax. What you keep depends on capital gains rules where you live and how long you held the shares.
What a stock profit calculator works out
A share trade has two prices and a quantity. The difference between the prices, multiplied by the number of shares, is the gross result. Everything else in this calculator exists to turn that gross figure into the number that actually lands in your account, and to put it in a form you can compare against other trades.
It returns five things. The cost basis is the total you paid to open the position, including the commission on the buy. The proceeds are what you received when you sold, after the commission on the sell. The profit or loss is the gap between the two. The return expresses that gap as a percentage of the cost basis, which is what lets you compare a $300 gain on a $2,000 position with a $300 gain on a $20,000 position (15% against 1.5%). The break-even price is the sell price at which the trade would have made exactly nothing once both commissions are paid.
You can use it before a trade, to see what a target price is worth and how far the price has to move just to cover costs, or afterwards, to record the real result. If you are building up a position over several purchases, work out the average price first with the stock average calculator and enter that as the buy price.
The formulas
For a normal (long) trade, where you buy first and sell later:
Cost basis = shares × buy price + buy commission
Proceeds = shares × sell price − sell commission
Profit = proceeds − cost basis
Return % = profit ÷ cost basis × 100
The break-even price is the sell price that makes the profit zero. Rearranging the formula gives:
Break-even = buy price + (buy commission + sell commission) ÷ shares
That last term is why commission matters more on small trades. Two $5 commissions on 1,000 shares add one cent to the break-even. The same $10 on 10 shares adds a dollar.
For a short sale, the order is reversed: you sell borrowed shares first and buy them back later. The profit is still (sell price − buy price) × shares − commissions, so a short makes money when the buy-back price is lower than the price you sold at. The break-even buy-back price sits below the sale price by the same commission amount per share, and this calculator measures the return against the value of the original sale. Your broker will hold margin against a short, so your return on the cash actually tied up can differ.
A worked example
A hypothetical trade: you buy 100 shares at $50.00 and later sell them at $57.50. Your broker charges $1 per trade.
- Cost basis: 100 × $50.00 + $1 = $5,001.00.
- Proceeds: 100 × $57.50 − $1 = $5,749.00.
- Profit: $5,749 − $5,001 = $748.00.
- Return: $748 ÷ $5,001 = 14.96%.
- Break-even: $50.00 + $2 ÷ 100 = $50.02.
Now the same idea as a short, with different hypothetical numbers: you sell short 200 shares at £35.00, buy them back at £30.00, and pay £5 per trade. The sale brings in £6,995 after commission, the buy-back costs £6,005, and the profit is £990, a 14.15% return on the sale value. The break-even buy-back price is £34.95: above that, the short loses money.
Those are the figures the calculator above shows for the same inputs, so you can check one against the other.
Common mistakes when working out stock profit
Measuring return against the share price instead of the cost basis. A move from $50 to $57.50 is 15%, but once costs are included your return is slightly lower. On a cheap stock traded in small size, the difference can be most of the gain.
Forgetting one of the two commissions. Every round trip pays twice. "Commission-free" brokers usually earn instead from the spread or from payment for order flow, which shows up as a slightly worse fill rather than a fee. Our guide to the bid-ask spread explains why that is still a cost.
Ignoring currency. If you bought a US stock from a euro or sterling account, your profit in your own currency depends on the exchange rate on both days, and most brokers charge a conversion fee each way. Run the calculator in the currency the shares trade in, then convert the result.
Treating a short like a long with the sign flipped. The arithmetic is symmetrical, the risk is not. A long position can lose at most what you paid. A short position loses more the higher the price goes, and has no natural limit. Shorts also pay a borrow fee and must pay out any dividend the company declares while the position is open.
Getting partial sales wrong. If you sell only some of your shares, the profit on that sale uses your average cost for the shares sold, not the price of the last purchase. Sell 50 of 200 shares bought at a $45 average for $52, and the gain is 50 × $7 less commission, whatever you paid for the most recent lot. Some countries require a specific matching method instead (first in, first out, or same-day and 30-day rules), so check which applies before filing a return.
Confusing profit with what you keep. This calculator stops before tax. Capital gains rules differ by country and often by holding period, and losses can sometimes be set against gains. Check the rules that apply to you, or ask a qualified adviser.
Profit figures are only half of a trading decision. The other half is how much you were prepared to lose to get them. The risk management guide covers sizing a position from the stop-loss first, which works the same way for shares as it does for currencies.
More widgets: all free calculator widgets for your website.
Trade forex and gold too?
MarketPro publishes forex and gold trade ideas with exact entry, stop and take-profit levels, plus a free trading academy. Get MarketPro freeGet MarketPro free, in your browser or on your phone. Vetted free signals every week, no card needed.
Stock profit calculator: questions
How do I calculate profit on a stock?
How do I calculate the percentage gain on a stock?
What is a break-even price for a stock?
Does this stock calculator include taxes and dividends?
How is profit calculated on a short sale?
Size the trade, then take the trade
MarketPro publishes every signal with an explicit entry, stop and take-profit levels, which is what makes these calculations possible before you click. Start with the free weekly signals.
Same account as the app · No install · Free to start
Not investment advice. Past performance is not indicative of future results.