Stock Profit Calculator

For 100 shares bought at $40 and sold at $55, the price difference produces $1,500 before fees. A $10 purchase fee and a $10 sale fee reduce gain to $1,480. Return uses $4,010 initial cash cost, giving 36.91%.

A precomputed weighted average purchase price can supply the basis input, but this tool does not calculate an average from several individual purchase lots.

Stock Profit Calculator: inputs

Calculated result
Net profit or loss$1,480
Return on cost36.9%

Stock Profit Calculator: Shares sensitivity

Stock Profit Calculator: Shares and Net profit or loss5 calculations vary the “Shares” input while holding the other entered inputs constant.80$1,18090$1,330100$1,480110$1,630120$1,780

Stock Profit: formula

Net gain = sale proceeds − purchase cost − fees; return = net gain ÷ total purchase cost

SEC Investor.gov: financial calculators · IRS Publication 550: Investment income and expenses

Stock Profit: worked example

Shares100
Average buy price$40
Sale price$55
Trading fee per side$10
Net profit or loss$1,480
Return on cost36.9%

The calculation excludes dividends and taxes. A blended average price can describe an economic position without being the tax basis permitted for a particular sale. IRS Publication 550 explains basis, fees and lot-identification rules; use the brokerage’s applicable lot records.

Splits change shares and per-share basis, and a wash sale can defer a loss. Do not treat every economic loss shown here as an immediately deductible tax loss.

Stock Profit: changing Shares

SharesNet profit or lossReturn on cost
80$1,18036.8%
90$1,33036.8%
100 (example)$1,48036.9%
110$1,63037.0%
120$1,78037.0%

Stock Profit: compare input ranges

InputTested fromToNet profit or loss: low inputNet profit or loss: high inputSwing
Sale price$50$61$980$2,080$1,100 (74%)
Average buy price$36$44$1,880$1,080$800 (54%)
Shares90110$1,330$1,630$300 (20%)
Trading fee per side$9.00$11$1,482$1,478$4.00 (0.3%)

Stock Profit: individual input comparisons

InputValueNet profit or lossReturn on cost
Shares80$1,18036.8%
90$1,33036.8%
100$1,48036.9%
110$1,63037.0%
120$1,78037.0%
Average buy price$32$2,28071.0%
$36$1,88052.1%
$40$1,48036.9%
$44$1,08024.5%
$48$68014.1%
Sale price$44$3809.5%
$50$98024.4%
$55$1,48036.9%
$61$2,08051.9%
$66$2,58064.3%
Trading fee per side$8.00$1,48437.0%
$9.00$1,48237.0%
$10$1,48036.9%
$11$1,47836.8%
$12$1,47636.8%

Stock Profit: combined input changes

Shares / Average buy price$32$40$48
80$1,820$1,180$540
90$2,050$1,330$610
100$2,280$1,480$680
110$2,510$1,630$750
120$2,740$1,780$820

Stock Profit: which assumptions move the result?

Stock Profit: Net profit or loss as Sale price changesNet profit or loss starts at $380. Moving Sale price from $44 to $66 changes it to $2,580, with Shares 100; Average buy price $40; Trading fee per side $10 kept fixed.$44$380$50$980$55$1,480$61$2,080$66$2,580
Chart quantityDisplayed settings
Sale price$44 → $66
Net profit or loss$380 → $2,580
Shares100
Average buy price$40
Trading fee per side$10
Stock Profit: Net profit or loss as Average buy price changesNet profit or loss starts at $2,280. Moving Average buy price from $32 to $48 changes it to $680, with Shares 100; Sale price $55; Trading fee per side $10 kept fixed.$32$2,280$36$1,880$40$1,480$44$1,080$48$680
Chart quantityDisplayed settings
Average buy price$32 → $48
Net profit or loss$2,280 → $680
Shares100
Sale price$55
Trading fee per side$10

Stock Profit: values and definitions

Quantity and definitionValue used
Shares100
Average buy price$40
Sale price$55
Trading fee per side — The model deducts this amount once at purchase and once at sale.$10
Net profit or loss$1,480
Return on cost36.9%

Enter shares sold, an entered per-share purchase basis, sale price and an equal trading fee for each side. The equal fee applies to both sides. Total fees are twice the entered amount.

If charges differ, account for them separately before using this equal-fee model. Keep prior acquisition fees out of the per-share basis if they will be included again through this fee input.

Common error: Computing gain from price difference alone and ignoring transaction costs entirely. On frequent, smaller trades, the accumulated fees can turn a series of profitable-looking trades into a net loss once totaled.

Investing & Returns calculators: Portfolio Rebalancing Calculator, Sharpe Ratio Calculator, Sortino Ratio Calculator, Maximum Drawdown Calculator, Tax-Loss Harvesting Calculator, Rule of 72 and 115 Doubling and Tripling Calculator.

A stock sale's headline gain and its actual profit are two different numbers once trading fees enter on both ends: the buy and the sell each typically carry their own cost, and both need subtracting before the real return shows up. On a small trade with a flat per-transaction fee, that combined cost can consume a disproportionate share of a modest gain.

Purchase and sale fees both reduce the net gain. The calculation needs both paid amounts.

For several purchase lots, the average stock cost calculator finds the blended price. For total return including dividends use the investment return calculator, and the annualized return page for the yearly rate. To plan the tax effect, the capital gains tax calculator estimates the bill.

Stock Profit Calculator: application examples

Stock Average Cost Calculator

Measure profit or loss against an entered average purchase price. Use the correct total cost basis.

Stock Average Cost Calculator: full formula

Shares100
Average buy price$40
Sale price$55
Trading fees$10
Net profit or loss$1,480
Return on cost36.9%

The blended cost is what you compare a current price with to see whether the position is up or down. Averaging down by buying more at lower prices lowers the blend and raises the price you need to break even less than you might expect, and it increases how much money is tied to one stock. Decide in advance how much of your portfolio one holding can be.

Use this when you bought the same stock at different prices. Share count, average purchase price, sale price and total fees determine the gain or loss. The blended purchase price equals total dollars spent divided by total shares.

An unweighted average of lot prices ignores differences in share count. Brokerage cost-basis reports do this automatically.

Average purchase price and total cost basis look similar but answer subtly different questions once trading fees and multiple purchase lots enter the picture, and using the wrong one of the two against an entered average price can produce a profit or loss figure that doesn't match what a brokerage statement or tax form reports.

Confirm the entered average price reflects the correct total cost basis, fees included, across all purchase lots, rather than a simple average of quoted share prices alone.

Calculating profit or loss against a simple average of purchase prices that excludes trading fees or misses a purchase lot. The resulting figure can diverge from the actual cost basis a brokerage statement or tax form would show.

Use the stock profit calculator for a complete profit figure and the stock split calculator if a split changed your share count. The position size calculator helps decide how much to add. Look at the cost-basis method in your brokerage settings before selling, since changing it later is usually not possible.

How do I calculate my average cost per share?

Divide the total dollars spent on all purchases, including fees, by the total shares owned. Averaging the prices instead gives the wrong answer when the share counts differ.

Does averaging down make sense?

It can lower your break-even, but it also increases exposure to a stock that has fallen. It makes sense only if you would buy the stock at the lower price anyway.

Which lots does my broker sell first?

Most default to first-in, first-out, but you can usually pick specific lots or another method, which affects your tax bill.

Stock Average Cost: changing Shares

Stock Average Cost Calculator: net profit or loss and return on cost across a range of shares, every other input held at the worked-example value.
SharesNet profit or lossReturn on cost
80$1,18036.8%
90$1,33036.8%
100 (example)$1,48036.9%
110$1,63037.0%
120$1,78037.0%

Stock Average Cost: compare input ranges

Stock Average Cost Calculator: net profit or loss with each input moved on its own, every other input held at the worked-example value.
InputTested fromToNet profit or loss: low inputNet profit or loss: high inputSwing
Sale price$50$61$980$2,080$1,100 (74%)
Average buy price$36$44$1,880$1,080$800 (54%)
Shares90110$1,330$1,630$300 (20%)
Trading fees$9.00$11$1,482$1,478$4.00 (0.3%)

Stock Average Cost: individual input comparisons

Stock Average Cost Calculator: each input varied independently; remaining quantities retain their worked-example settings.
InputValueNet profit or lossReturn on cost
Shares80$1,18036.8%
90$1,33036.8%
100$1,48036.9%
110$1,63037.0%
120$1,78037.0%
Average buy price$32$2,28071.0%
$36$1,88052.1%
$40$1,48036.9%
$44$1,08024.5%
$48$68014.1%
Sale price$44$3809.5%
$50$98024.4%
$55$1,48036.9%
$61$2,08051.9%
$66$2,58064.3%
Trading fees$8.00$1,48437.0%
$9.00$1,48237.0%
$10$1,48036.9%
$11$1,47836.8%
$12$1,47636.8%

Stock Average Cost: combined input changes

Stock Average Cost Calculator: net profit or loss at each combination of shares (rows) and average buy price (columns).
Shares / Average buy price$32$40$48
80$1,820$1,180$540
90$2,050$1,330$610
100$2,280$1,480$680
110$2,510$1,630$750
120$2,740$1,780$820

Stock Average Cost: values and definitions

Stock Average Cost Calculator: worked-example quantities, units and calculated results.
Quantity and definitionValue used
Shares100
Average buy price$40
Sale price$55
Trading fees$10
Net profit or loss$1,480
Return on cost36.9%

Enter average buy price in dollars, sale price in dollars and trading fees in dollars.

The tax basis is not always the blended average: brokers default to specific methods such as first-in, first-out for shares, and average cost applies mainly to mutual funds. The lot you sell determines the taxable gain. The result also ignores dividends, splits and reinvested shares, each of which changes basis.

How can I obtain a weighted average purchase price?

Divide aggregate purchase cost by total shares, keeping fee treatment consistent. Do not take a simple mean of quoted prices when the purchases used different share quantities.

Is my blended average always the taxable basis of shares sold?

No. Tax basis depends on applicable identification and reporting rules. Confirm the lots and adjustments in the brokerage record rather than replacing them with a portfolio-wide average.

Do trading fees matter?

Many brokers charge no commissions on stock trades now, but regulatory fees, spreads and any account charges still reduce the gain. On small trades even a few dollars matter.

How is the gain taxed?

In the US, stock held for more than a year is taxed at long-term capital gains rates, which are lower than the rates on shorter holds, and losses can offset gains.

Should I include dividends in profit?

Yes, if you want total profit. Dividends received while you held the stock are income in addition to the price gain and are taxed separately.