Stock Profit: formula
SEC Investor.gov: financial calculators · IRS Publication 550: Investment income and expenses
Stock Profit: worked example
| Shares | 100 |
|---|---|
| Average buy price | $40 |
| Sale price | $55 |
| Trading fee per side | $10 |
| Net profit or loss | $1,480 |
| Return on cost | 36.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
| Shares | Net profit or loss | Return on cost |
|---|---|---|
| 80 | $1,180 | 36.8% |
| 90 | $1,330 | 36.8% |
| 100 (example) | $1,480 | 36.9% |
| 110 | $1,630 | 37.0% |
| 120 | $1,780 | 37.0% |
Stock Profit: compare input ranges
| Input | Tested from | To | Net profit or loss: low input | Net profit or loss: high input | Swing |
|---|---|---|---|---|---|
| Sale price | $50 | $61 | $980 | $2,080 | $1,100 (74%) |
| Average buy price | $36 | $44 | $1,880 | $1,080 | $800 (54%) |
| Shares | 90 | 110 | $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
| Input | Value | Net profit or loss | Return on cost |
|---|---|---|---|
| Shares | 80 | $1,180 | 36.8% |
| 90 | $1,330 | 36.8% | |
| 100 | $1,480 | 36.9% | |
| 110 | $1,630 | 37.0% | |
| 120 | $1,780 | 37.0% | |
| Average buy price | $32 | $2,280 | 71.0% |
| $36 | $1,880 | 52.1% | |
| $40 | $1,480 | 36.9% | |
| $44 | $1,080 | 24.5% | |
| $48 | $680 | 14.1% | |
| Sale price | $44 | $380 | 9.5% |
| $50 | $980 | 24.4% | |
| $55 | $1,480 | 36.9% | |
| $61 | $2,080 | 51.9% | |
| $66 | $2,580 | 64.3% | |
| Trading fee per side | $8.00 | $1,484 | 37.0% |
| $9.00 | $1,482 | 37.0% | |
| $10 | $1,480 | 36.9% | |
| $11 | $1,478 | 36.8% | |
| $12 | $1,476 | 36.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: values and definitions
| Quantity and definition | Value used |
|---|---|
| Shares | 100 |
| 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 cost | 36.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
| Shares | 100 |
|---|---|
| Average buy price | $40 |
| Sale price | $55 |
| Trading fees | $10 |
| Net profit or loss | $1,480 |
| Return on cost | 36.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
| Shares | Net profit or loss | Return on cost |
|---|---|---|
| 80 | $1,180 | 36.8% |
| 90 | $1,330 | 36.8% |
| 100 (example) | $1,480 | 36.9% |
| 110 | $1,630 | 37.0% |
| 120 | $1,780 | 37.0% |
Stock Average Cost: compare input ranges
| Input | Tested from | To | Net profit or loss: low input | Net profit or loss: high input | Swing |
|---|---|---|---|---|---|
| Sale price | $50 | $61 | $980 | $2,080 | $1,100 (74%) |
| Average buy price | $36 | $44 | $1,880 | $1,080 | $800 (54%) |
| Shares | 90 | 110 | $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
| Input | Value | Net profit or loss | Return on cost |
|---|---|---|---|
| Shares | 80 | $1,180 | 36.8% |
| 90 | $1,330 | 36.8% | |
| 100 | $1,480 | 36.9% | |
| 110 | $1,630 | 37.0% | |
| 120 | $1,780 | 37.0% | |
| Average buy price | $32 | $2,280 | 71.0% |
| $36 | $1,880 | 52.1% | |
| $40 | $1,480 | 36.9% | |
| $44 | $1,080 | 24.5% | |
| $48 | $680 | 14.1% | |
| Sale price | $44 | $380 | 9.5% |
| $50 | $980 | 24.4% | |
| $55 | $1,480 | 36.9% | |
| $61 | $2,080 | 51.9% | |
| $66 | $2,580 | 64.3% | |
| Trading fees | $8.00 | $1,484 | 37.0% |
| $9.00 | $1,482 | 37.0% | |
| $10 | $1,480 | 36.9% | |
| $11 | $1,478 | 36.8% | |
| $12 | $1,476 | 36.8% |
Stock Average Cost: 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 Average Cost: values and definitions
| Quantity and definition | Value used |
|---|---|
| Shares | 100 |
| Average buy price | $40 |
| Sale price | $55 |
| Trading fees | $10 |
| Net profit or loss | $1,480 |
| Return on cost | 36.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.