Free calculator

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.

Last reviewed by the MarketPro research desk · Editorial policy

For a short, this is the price you sold at to open.
Charged once on the buy and once on the sell. Enter 0 for commission-free brokers.

Everything is calculated in your browser. Nothing you type is sent anywhere, stored, or logged.

Short answer

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.

  1. Cost basis: 100 × $50.00 + $1 = $5,001.00.
  2. Proceeds: 100 × $57.50 − $1 = $5,749.00.
  3. Profit: $5,749 − $5,001 = $748.00.
  4. Return: $748 ÷ $5,001 = 14.96%.
  5. 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.

Add this calculator to your website

Free for any site, blog or forum. Paste the code where you want the calculator to appear. It resizes itself, works on phones, sends no tracking and needs no account. The only condition is that the credit line under it stays in place.

Preview

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.

Written and reviewed by the MarketPro research desk

MarketPro is a trading-signal and trading-education app operated by Harajuku Holdings LTD (Cyprus). Our signal desk publishes and tracks every trade idea in-app, and every page here is checked against the app's live behaviour before publishing. Last reviewed . How we produce signals and content · About MarketPro

FAQ

Stock profit calculator: questions

How do I calculate profit on a stock?
Subtract the buy price from the sell price, multiply by the number of shares, then subtract the commission paid on both trades. For 100 shares bought at $50 and sold at $57.50 with $1 commission each way, that is 100 × $7.50 − $2 = $748.
How do I calculate the percentage gain on a stock?
Divide the profit by the cost basis (shares × buy price plus the buy commission) and multiply by 100. A $748 profit on a $5,001 cost basis is a 14.96% gain. Using the share price change alone (15% in that example) slightly overstates the return because it leaves out costs.
What is a break-even price for a stock?
It is the sell price at which a trade makes exactly zero after costs. For a long trade it equals the buy price plus total commissions divided by the number of shares. The fewer shares you trade, the further above your buy price it sits.
Does this stock calculator include taxes and dividends?
No. It shows the trading result before tax and leaves out dividends received while you held the shares. Add any dividends to the profit yourself, and check how capital gains are taxed where you live, as rates often depend on how long the shares were held.
How is profit calculated on a short sale?
The same way with the order reversed: (price you sold at − price you bought back at) × shares − commissions. Selling 200 shares short at £35 and buying back at £30 with £5 per trade gives £990. A short also pays borrow fees and any dividends, which this calculator does not include.
Trade · Learn · Earn

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.