Buying a share at 45 and selling it at 52 looks like a simple 7-per-share gain, but commissions on both legs, dividends collected along the way and the time you held the stock all change what the trade really earned. This stock profit calculator puts those pieces together.
Enter the number of shares, your buy and sell prices and the broker’s commission — either a flat fee per order or a percentage of the trade value — and you get the gross profit, the total fees, the net profit and the return on the money you put in. Add the dividends you received and the holding period, and the calculator also gives the annualized return, the yearly rate that would have produced the same result, so you can compare a three-month trade with a five-year investment.
The break-even sell price tells you the minimum price at which the trade stops losing money once both commissions are paid. With Solve for → Sell price you can also work backwards: type the profit you are aiming for and get the selling price it requires. It works for shares, ETFs and any asset bought and sold per unit.
How to use this calculator
- Enter the number of shares (fractional shares are fine) and the buy price per share.
- Enter the sell price — or the price you are targeting if you have not sold yet.
- Choose how your broker charges: a flat amount per trade or a percentage of each order, and fill in the buy and sell commissions.
- Optionally add the dividends received and the holding period in days, months or years.
- Read the net profit, the return, the annualized return and the break-even price. Open the steps to see each calculation.
The formula
For shares bought at and sold at , with buy commission , sell commission and dividends :
With percentage commissions, and . The break-even sell price, where the net profit is zero, is for flat fees and for percentage fees.
Over a holding period of years, the annualized return is the compound rate
Worked example
You buy 200 shares at 45.50 and sell them 18 months later at 52.75, paying a flat commission of 7 on each order.
- Cost:
- Net proceeds:
- Net profit: 10,543.00 − 9,107.00 = 1,436.00 (gross profit before fees: 1,450.00)
- Return: 1,436.00 / 9,107.00 = 15.77%
- Annualized over 1.5 years:
The break-even sell price is 45.57. With a 0.5% commission on each order instead, the fees total 98.25, the net profit drops to 1,351.75 and the break-even price rises to 45.9573.
Gross profit, net profit and return
Gross profit is the price difference times the number of shares. Net profit subtracts what the trade cost you to execute — commissions, and in some markets stamp duty or a financial transaction tax — and adds any dividends received. The return divides the net profit by the total amount invested, buy commission included, so a 1,000 gain on 10,000 is 10% while the same gain on 50,000 is only 2%.
For tax purposes the logic is the same in most countries: your basis is the purchase price plus buying costs, and the amount realized is the sale price minus selling costs. Taxes themselves are not deducted here, since rates depend on your country, account type and holding period.
Why annualize the return?
A 15% gain earned in six months and a 15% gain earned in five years are very different results. Annualizing converts both to a yearly compound rate: about 32% a year for the first and 2.8% for the second. That makes trades of different lengths comparable with each other and with a savings rate or an index. Be careful with very short periods: a 5% gain in two weeks annualizes to more than 200%, which no one should expect to repeat; performance standards such as the CFA Institute’s GIPS do not annualize periods shorter than a year.
Frequently asked questions
How do I calculate profit on a stock?
Multiply the number of shares by the sell price, subtract the sell commission, then subtract what you paid (shares × buy price + buy commission) and add any dividends. The result is your net profit.
What is the break-even price of a stock trade?
It is the sell price at which the net profit is exactly zero. It sits above your buy price because both commissions must be covered, and below it when dividends already paid part of the cost.
Does the calculator handle losses?
Yes. Enter a sell price below the buy price and the net profit and return are shown as negative values, with the commissions making the loss larger.
Can I find the sell price needed for a target profit?
Yes. Choose Sell price under Solve for and type the net profit you want. The calculator finds the price that delivers it after commissions.
Should I use flat or percentage commissions?
Use whatever your broker charges. Many online brokers bill a flat fee per order, while banks often charge a percentage with a minimum. Check your broker’s fee schedule for the exact figures.
Sources
- IRS Publication 550 — Basis of stock and amount realized on a sale
- OpenStax, Principles of Finance, §15.1 Risk and Return to an Individual Asset
- Investor.gov (SEC) — Brokerage fees
Last updated: