How profit on a stock trade is calculated
The profit on a trade is what you received from the sale minus everything the position cost you. Two things are easy to forget: the fee you paid when buying is part of the cost, and the fee you pay when selling reduces what you actually receive. A trade that looks profitable on the price alone can turn into a loss once both fees are counted, especially when the amounts are small.
Total cost = shares × buy price + buy fee
Net proceeds = shares × sell price − sell fee
Profit before tax = net proceeds − total cost
Net profit = profit before tax − tax (only if there is a gain)
The return on cost is the net profit divided by the total cost. The break-even sell price is the price at which the trade covers its cost and both fees exactly: (shares × buy price + buy fee + sell fee) ÷ shares. Choose the currency of your amounts in the calculator; it only sets the unit and converts nothing.
Worked example
You buy 100 shares at 50 with a fee of 5 and later sell them at 65 with another fee of 5:
- Total cost: 100 × 50 + 5 = 5,005
- Net proceeds: 100 × 65 − 5 = 6,495
- Profit before tax: 6,495 − 5,005 = 1,490, a return on cost of 29.77%
- Break-even sell price: (5,000 + 5 + 5) ÷ 100 = 50.10
If a tax of 15% applies to the gain, the tax is 223.50 and the net profit 1,266.50, a return of 25.30%. If instead you sell at 45, the net proceeds are 4,495 and the result is a loss of −510, or −10.19% of the cost. No tax is calculated on a loss.
Fees and the break-even price
The break-even price shows how far the price must rise just to get your money back. With a flat fee, the effect shrinks as the trade gets larger: two fees of 5 add only 0.10 per share to a 100-share trade at 50, but 1.00 per share to a 10-share trade. If your broker charges a percentage instead of a flat amount, work out the fee in money for the trade and enter that amount.
Several purchases
If you bought the position in several steps at different prices, the buy price to use is your average cost per share. The stock average calculator works it out from every buy and sell, and the average down calculator shows what a further purchase would do to it. For a holding that also paid dividends, the ROI calculator adds that income to the result.
About the tax field
The tax rate is applied as a simple percentage of the profit. Real tax rules are more detailed: some countries tax short-term and long-term gains differently, allow yearly allowances, let you offset losses against gains or withhold tax at the broker. In the United States, IRS Publication 550 explains how gains and losses from selling investments are reported. Use the tax field for a rough estimate only and check your own situation with your broker's statements or a tax adviser.
What the result does not include
- Currency conversion: if you bought in a foreign currency, exchange-rate changes between buying and selling are not part of the calculation.
- Dividends received while you held the shares.
- Inflation, so the profit is nominal.
- This page does not recommend buying or selling any security and is not investment or tax advice.