Use this stock calculator to estimate your profit or loss from buying and selling shares, including dividends, trading commissions, and estimated tax. It shows both the dollar result and your net return on investment, helping you see how much of a price gain remains after costs.
How to use the stock profit calculator
- Enter the number of shares. Use the quantity you are evaluating for both the purchase and sale.
- Enter the purchase price per share. This is the share price before the buy commission.
- Enter the sell price per share. Use your actual sale price or a hypothetical price to explore a possible outcome.
- Add total dividends received. Enter the total cash dividends for those shares over the period you are measuring—not the dividend per share. Use zero if there were no dividends.
- Set each commission and its unit. A percentage buy commission applies to the purchase value; a percentage sell commission applies to the sale proceeds. A fixed commission is the total fee for that transaction, not a fee per share.
- Enter an estimated tax rate from 0% to 50%. The calculator applies this rate to positive gross return, including dividends, before deducting commissions.
Keep all prices, dividends, and fixed fees in the same currency. For multiple purchases at different prices, establish a suitable purchase price for the shares being evaluated before using this calculator; a simple average may not reflect the cost basis of a particular sale.
How stock profit is calculated
The calculation starts with the value of the shares bought and sold:
- Share cost = Number of shares × Purchase price per share
- Sale proceeds = Number of shares × Sell price per share
- Capital gain or loss = Sale proceeds − Share cost
- Gross return = Capital gain or loss + Total dividends
The calculator then accounts for commissions and estimated tax:
- Estimated tax = max(0, Gross return) × Tax rate, with the percentage expressed as a decimal.
- Total invested = Share cost + Buy commission
- Total costs = Buy commission + Sell commission + Estimated tax
- Net profit = Gross return − Total costs
- Net ROI (%) = Net profit ÷ Total invested × 100
Important: this tax estimate does not deduct commissions before calculating tax. It also assigns zero tax when gross return is zero or negative; it does not estimate tax credits or benefits from losses.
Worked example: a stock gain after fees and tax
Suppose you buy 100 shares at $50 and sell them at $60. You receive $100 in total dividends, pay a 0.5% buy commission and a $10 fixed sell commission, and enter a 20% tax rate.
| Result | Calculation | Amount |
|---|---|---|
| Share cost | 100 × $50 | $5,000 |
| Sale proceeds | 100 × $60 | $6,000 |
| Capital gain | $6,000 − $5,000 | $1,000 |
| Gross return | $1,000 + $100 | $1,100 |
| Buy commission | $5,000 × 0.5% | $25 |
| Estimated tax | $1,100 × 20% | $220 |
| Total costs | $25 + $10 + $220 | $255 |
| Total invested | $5,000 + $25 | $5,025 |
| Net profit | $1,100 − $255 | $845 |
| Net ROI | $845 ÷ $5,025 × 100 | 16.82% |
The share price rose 20%, but the net return is 16.82% after including dividends, commissions, and the calculator’s estimated tax.
How to interpret your results
Summary: the overall outcome
Net profit is your estimated gain after the modeled costs; a negative value means a loss. Net ROI expresses that result relative to the purchase value plus the buy commission. Gross return is the gain or loss plus dividends before any modeled costs.
Return breakdown: price changes versus dividends
The capital gain rate equals capital gain divided by share cost, multiplied by 100. It isolates the share-price change and excludes dividends and fees.
The displayed dividend yield equals total dividends entered divided by share cost, multiplied by 100. In the example, that is $100 ÷ $5,000 × 100 = 2%. This is a yield on purchase cost for the period represented by your dividends—not necessarily an annual dividend yield.
Costs: what reduces your return
Review the buy commission, sell commission, and estimated tax separately. Fixed fees can have a larger percentage impact on smaller trades, while percentage commissions scale with transaction value. A small price gain can still produce a net loss if it does not cover these costs.
Using the estimate to compare trades
- Test sale-price scenarios. Change the sell price while keeping the other assumptions consistent to see how different outcomes affect net profit.
- Compare commission structures. Enter fixed and percentage fees separately to assess their effect on the same trade.
- Separate income from price performance. Check whether dividends offset a price decline or supplement a capital gain.
The calculator does not use a holding period, so its ROI is not annualized. A 10% return over three months is not directly comparable with 10% over three years. Actual taxes may also differ because of holding periods, dividend classifications, deductions, loss offsets, and local rules. Treat the tax figure as a simplified estimate, not a tax liability calculation.
Related investment calculators
- Stock Cost Basis Calculator: calculate an average purchase price when you bought shares at different prices.
- Holding Period Return Calculator: examine the combined return from price changes and dividends over a holding period.
- Dividend Yield Calculator: explore dividend income relative to share price.
For an investing education website, Calcopolis lets you build a customized stock return calculator so visitors can explore scenarios using fee assumptions relevant to your audience.