Stock profit calculator

A stock profit calculator takes what you paid for your shares, the price you sold or could sell at, and any commissions, and returns your profit or loss, return on cost and break-even price.

This one starts from what you actually paid. Enter each purchase, the sell price and any commissions to get your profit or loss, the return on cost (ROI), and the break-even price — whether you bought once or several times, sold all of it or only part.

What you bought

Add every purchase of the same stock. One row if you bought once; fractional shares are fine.

What you sold, or plan to

The price you sold at, or the price you are considering. Leave shares blank to sell the whole position.

Most US brokers charge no commission on stock and ETF trades, so the fee fields can stay empty. Dates add the holding period and an annualized figure.

Profit
+$1,350.00+52.94%
Return on the $2,550.00 those shares cost you
Break-even sell price
$170.00
Sell above this per share and you come out ahead; below it, behind
Net proceeds
$3,900.00
15 × $260.00
Cost of shares sold
$2,550.00
15 × $170.00 average cost
Average cost per share
$170.00
$2,550.00 across 15 shares

Runs in your browser. Nothing is saved or sent anywhere.

How stock profit is calculated

Profit on a sale is what came back minus what went in, with any commissions on the right side of the line. The return on cost is that profit as a share of what the sold shares cost you. Nothing about it changes when the numbers get bigger; what changes is how often the “what went in” part is remembered correctly.

profit = (shares sold × sell price − sale commission) − (shares sold × average cost)
where average cost = (total paid + purchase commission) ÷ total shares

Worked example

You bought 10 shares at $150 and later 5 more at $210. You sell all 15 at $260, no commissions either way.

  • Total cost: (10 × $150) + (5 × $210) = $2,550
  • Average cost per share: $2,550 ÷ 15 = $170
  • Net proceeds: 15 × $260 = $3,900
  • Profit: $3,900 − $2,550 = +$1,350
  • Return on cost: $1,350 ÷ $2,550 = +52.94%
  • Break-even sell price: $170 — the average cost, because there are no fees to recover

Measure the sale against the most recent purchase instead — $210 — and the “profit” per share looks like $50 when it is $90 on the blended cost. Measure it against the first — $150 — and it looks like $110. Neither is what the trade made. This is why the average, or a proper lot match, has to come first.

The calculator uses the average-cost method, which is what every tool on this subject uses and what most people mean by “what I paid”. Brokers may match a sale to specific lots instead, which changes the taxable figure but not the arithmetic; average cost vs. FIFO vs. specific lots sets the methods side by side. If you only need the blended cost and are not selling yet, the cost basis calculator is the shorter route.

Break-even, and why it is usually just your average cost

The break-even sell price is the price at which the sale returns exactly what the shares cost you. Older calculators make a lot of it, because they were written when every trade carried a commission on both ends and the two fees had to be recovered before a cent of profit existed. The formula still allows for that:

break-even price = (cost of shares sold + sale commission) ÷ shares sold

But most US brokers now charge no commission on stock and ETF trades, so for most readers both fee fields stay empty and break-even collapses to the average cost per share. In the example above it is $170. Add a $4.95 commission on each side and it moves to $170.66 — the purchase fee raises the average cost, the sale fee has to be covered by the proceeds. Real, but small, and not worth a tool that hides the simple answer behind it.

What actually moves break-even is buying more. Every purchase at a different price resets the average, and the price you need to get out clean moves with it. That is the number that drifts, and it drifts on exactly the days you are least likely to recalculate it.

Selling part of a position

A simple profit calculator assumes you sell everything. Sell 5 of the 15 shares above at $260 and the easy mistake is to measure the $1,300 you received against the full $2,550 you paid, which reports a loss on a trade that made money.

The right answer measures the 5 shares sold against their share of the cost — 5 × $170 = $850 — for a profit of $450, the same 52.94% as selling everything. The 10 shares still held keep a cost basis of $1,700, and their gain stays on paper until you sell them. Realized vs. unrealized is the whole distinction: the $450 is locked in, whatever the price does next; the other 10 shares are not.

One thing this calculation leaves out on purpose: dividends. A profit figure on the sale is price return only. If the holding paid dividends while you held it, the total return is higher, and total return vs. price return shows how large that gap can get.

That was one position, on the day you asked.

The arithmetic takes a second. What this page cannot do is remember what you paid the next time you ask, notice the purchase you add next month, or show the same figure for the other twelve holdings spread across three brokerages — each of which reports a confident number for its own slice and nothing else.

StoxDeck keeps every position, priced live, measured from what you actually paid. Enter each purchase once — shares, price, date, no brokerage login — and the deck shows realized and unrealized gain and loss for every holding, across every account, on every load.

Build your first deck

Or try the demo deck first — it needs no signup. Want the return as a rate per year, with each purchase on its own date? The annualized return calculator does that properly.

More free tools

Common questions

How do you calculate profit on a stock?

Take what you received for the shares, subtract any commission on the sale, then subtract what those shares cost you including any commission on the purchase. Buying 15 shares for a total of $2,550 and selling them for $3,900 with no fees is a profit of $1,350. Divide the profit by the cost — $1,350 ÷ $2,550 — and the return on cost is 52.94%.

What is the break-even price for a stock?

The sell price at which you get back exactly what the shares cost you, after every commission. With no fees it is simply your average cost per share. With fees it is slightly higher: the cost of the shares plus the commission on the sale, divided by the number of shares sold. Sell above it and the trade is a gain; sell below it and the trade is a loss, however the share price compares to what you paid.

How is profit calculated if I bought the same stock at several prices?

The calculator blends every purchase into one average cost per share — total cost divided by total shares — and measures the sale against that. It is the average-cost method, the same one every stock profit calculator uses. Brokers can instead match a sale to specific lots, first-in-first-out or lots you choose, which changes which cost the sale is measured against and can change the taxable figure. The post on cost basis methods explains the differences.

What if I only sold some of my shares?

Enter the number sold. The profit and break-even figures then cover those shares only, and the calculator shows how many you still hold and what they cost you. That remaining figure is your cost basis going forward, and the gain or loss on it stays unrealized until you sell.

Should the return be annualized?

Only if the holding period matters to the question you are asking. A 52.94% gain over six weeks and over six years are very different results, and entering the purchase and sale dates shows the rate per year that explains the one you got. It is a measurement of what already happened, not a forecast. For a position bought on several different dates, the annualized return calculator does the job properly with each lot dated.

Is the profit shown here what I will be taxed on?

Not necessarily. The taxable gain depends on which shares your broker treats as sold, how long each was held, and rules that differ by account type and jurisdiction. The calculator shows the economic result of the trade on the average-cost method. For what that means on your return, talk to a tax professional.

Does it work for options, crypto or non-US stocks?

It is built for shares of US-listed stocks and ETFs, which is what StoxDeck tracks. The arithmetic is the same for any asset bought and sold by the unit, but options contracts, multipliers and foreign-exchange effects are not modelled.

Does StoxDeck track my profit and loss?

Yes. StoxDeck records every purchase you enter — shares, price, date — prices the position live on every load, and shows the gain or loss in dollars and percent measured from what you actually paid, for every holding across every brokerage in one deck. Realized and unrealized are shown separately. There is no brokerage login: you enter each position once and it stays current.

Is anything I type here saved or sent anywhere?

No. The calculator runs entirely in your browser. Nothing is transmitted, stored, or logged, and there is no account to create to use it.

Disclaimer. This calculator is informational only and is not investment, tax, or financial advice. It measures the result of a trade on the figures you enter and makes no forecast of future performance. StoxDeck is a portfolio-tracking tool, not a broker or an adviser. How any gain or loss is taxed depends on your own circumstances — check with a professional.