Transparent method
The formula
Worked example
Example inputs
How to interpret the result
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.
Before you rely on it
What to check
Include both the purchase-side fee and the sale-side fee in the calculation, not just one. Both were paid, and both reduce the real return.
The common error
Where people go wrong with stock profit calculator
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 actually totaled.
Sensitivity evidence
How shares changes the net profit or loss
| Shares | Net profit or loss | Return on cost |
|---|---|---|
| 80 | $1,180 | 36.8% |
| 90 | $1,330 | 36.8% |
| 100worked example | $1,480 | 36.9% |
| 110 | $1,630 | 37.0% |
| 120 | $1,780 | 37.0% |
Every input, tested
Which input moves the net profit or loss most
| Input | Tested from | To | Net profit or loss at each end | Swing |
|---|---|---|---|---|
| Sale price | $50 | $61 | $980 to $2,080 | $1,100 (74%) |
| Average buy price | $36 | $44 | $1,880 to $1,080 | $800 (54%) |
| Shares | 90 | 110 | $1,330 to $1,630 | $300 (20%) |
| Trading fees | $9.00 | $11 | $1,482 to $1,478 | $4.00 (0.3%) |
Two variables at once
Net profit or loss by shares and average buy price
| 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 |
Step by step
The worked example, input by input
| Input | 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% |
Where the inputs come from
Shares is the number sold, average buy price is your cost per share including any earlier purchases averaged together, and sale price is what each share sold for. Trading fees are the total commissions and regulatory fees on both buying and selling. If you bought in lots at different prices, the tax basis depends on which lots your broker treats as sold, so use the cost basis on your confirmation.
Using the net profit or loss in a real decision
Then subtract the tax you will owe to see what you keep.
When the result stops applying
The result is before tax. A gain on shares held under a year is taxed as ordinary income in the United States, while longer holds get lower long-term rates. It ignores dividends received, which belong in a total return, and it assumes one buy price. Wash-sale rules apply to losses if you buy the same stock within 30 days.
What to compare it with
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.
People also ask
Frequently asked questions
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.