How to use this calculator
- Enter the Number of shares you bought or plan to buy.
- Fill in the Buy price per share and the Sell price per share (use your target price for a what-if).
- Add Total fees for both sides of the trade (commissions, regulatory fees, spreads you paid if you know them).
- Set Tax on profit to the rate you expect to pay on the gain, or leave it at 0 to see the pre-tax result.
How stock profit is calculated
The calculator works from your total cost, your sale proceeds and the costs that sit between them. The gain is what you receive minus what you paid minus fees. Tax is applied only when that gain is positive, because a loss does not create a tax bill on the trade itself.
Gain = (Shares × Sell) − (Shares × Buy) − Fees; Net profit = Gain − Tax; Return = Net profit / (Shares × Buy + Fees)- Shares = number of shares traded
- Buy and Sell = price per share when you bought and sold
- Fees = total commissions and other costs for the round trip
- Tax = Gain × your tax rate, only if Gain is above zero
The return is expressed against everything you put in, which is the purchase cost plus fees. That makes it comparable with other investments, since fees are money you could not use elsewhere.
Example: a winning trade and a losing one
Say you buy 250 shares at $42.80 and sell at $58.40, paying $18 in total fees. You invested $10,700 and received $14,600. With a 15% tax rate on the gain, the calculator shows a net profit of $3,299.70, a return of 30.79% and tax of $582.30. Without tax, the profit would be $3,882 and the return 36.22%.
Now suppose you sold at $40.00 instead. The same trade loses $718.00, a return of −6.70%, and no tax is due. Notice that the loss is larger than the $700 price drop alone would suggest, because the $18 in fees adds to it.
Reading the break-even price
The break-even sell price is your purchase cost plus fees, divided by shares. In the example above it is $42.87, slightly above the $42.80 you paid. Any sale below that number loses money before tax.
This figure matters most for small positions and frequent traders, where fees are a large share of the cost. If break-even sits well above your buy price, either the position is too small for the fee schedule or you should compare brokers before the next trade.
Improving your net result
You control costs more than you control prices. Keep fees low, avoid many tiny orders, and check how long you held the shares: in the United States, gains on assets held longer than a year are generally taxed at different rates than shorter holdings, so the holding period can change your tax input. Your tax authority or adviser can confirm which rate applies to you.
Also compare the result with alternatives. A 30% return over three years is very different from 30% over three months, so pair this tool with the CAGR calculator or the ROI calculator to annualize it.
What the calculator leaves out
It treats the trade as one purchase and one sale at fixed prices. It does not model dividends received while you held the stock, multiple purchase lots, currency conversion, stock splits, the wash-sale rule or loss offsets against other gains. The tax field is a single flat rate that you choose; real tax depends on your income, jurisdiction and how long you held the position.
Use the result as a quick, honest estimate. For tax filing, use your broker's cost-basis report.
Frequently asked questions
How do I calculate profit on a stock sale?
Multiply shares by the sell price, subtract shares times the buy price, then subtract fees. Subtract any tax due on the gain to get net profit.
What is the break-even price of a stock trade?
It is the sell price at which proceeds exactly cover your purchase cost plus fees. Selling above it gives a pre-tax profit, below it a loss.
Do I pay tax if I sell a stock at a loss?
There is no tax on the loss itself. In many countries a loss can offset other capital gains, which the calculator does not model.
Should I include dividends in the calculation?
Dividends are not included. Add them to your result yourself if you want total return, since the calculator only looks at the price change.
What tax rate should I enter?
Use the capital gains rate that applies to your income and holding period, or 0 for a pre-tax view. Check your tax authority's current rules or ask a tax professional.