Skip to content

Stock Investment Calculator

The trade

The price you sold at, or today's price to value a position you still hold.

Dividends and fees

All dividends paid per share while you held it, added together.

Net profit or loss —
Total return
—
Outcome
—
Amount invested (with fee)
—
Cash back after the sale
—
Price gain or loss
—
Dividend income
—
Break-even sale price
—

A stock's total return is the price gain plus dividends, minus commissions, divided by what you paid. Buy 50 shares at $40 with a $5 commission, collect $1.50 a share in dividends and sell at $52 for another $5: the net profit is $665 on $2,005 invested, a total return of 33.17%.

About this tool

Brokerage statements often show the price change on a holding but leave dividends and commissions in separate lines, which makes the real result of a trade hard to see. This calculator puts them together. Enter the share count, the price you paid, the price you sold at (or today's quote for a position still open), the dividends received per share and the commission on each side. It returns the net profit or loss in dollars, the total return as a percentage of the money you put in, the split between price gain and dividend income, and the sale price at which the trade would break even. It does not account for taxes, currency moves on foreign shares, or how long the shares were held, so two trades with the same percentage can be very different over one month and ten years.

How to use it

  1. Describe the trade

    Enter the number of shares, the purchase price per share and the sale price, or the current price for a holding you still own.

  2. Add dividends

    Type the total dividends received per share over the whole holding period.

  3. Add commissions

    Enter the broker fee on the purchase and on the sale; leave them at 0 for a commission-free broker.

  4. Read the result

    Check the net profit, total return, dividend share of the gain and the break-even sale price, with the working shown underneath.

Examples

One share, $100 to $110 plus a $4 dividend

Number of shares
1
Purchase price per share
100
Sale price per share
110
Dividends received per share
4
Commission on purchase
0
Commission on sale
0

Result Net profit or loss: $14.00
Total return: 14%
Outcome: Gain
Amount invested (with fee): $100.00
Cash back after the sale: $114.00
Price gain or loss: $10.00
Dividend income: $4.00
Break-even sale price: $96.00

  1. Purchase cost = 1 × $100.00 + $0.00 fee = $100.00
  2. Sale proceeds = 1 × $110.00 = $110.00
  3. Dividends = 1 × $4.00 = $4.00
  4. Net profit = $110.00 + $4.00 − $100.00 − $0.00 fees = $14.00
  5. Total return = $14.00 ÷ $100.00 × 100 = 14%

The classic holding-period return case: $10 of price gain and $4 of dividend on a $100 outlay is a 14% total return.

50 shares from $40 to $52, $5 commissions

Number of shares
50
Purchase price per share
40
Sale price per share
52
Dividends received per share
1.5
Commission on purchase
5
Commission on sale
5

Result Net profit or loss: $665.00
Total return: 33.17%
Outcome: Gain
Amount invested (with fee): $2,005.00
Cash back after the sale: $2,670.00
Price gain or loss: $600.00
Dividend income: $75.00
Break-even sale price: $38.70

  1. Purchase cost = 50 × $40.00 + $5.00 fee = $2,005.00
  2. Sale proceeds = 50 × $52.00 = $2,600.00
  3. Dividends = 50 × $1.50 = $75.00
  4. Net profit = $2,600.00 + $75.00 − $2,000.00 − $10.00 fees = $665.00
  5. Total return = $665.00 ÷ $2,005.00 × 100 = 33.17%

$600 of price gain plus $75 of dividends, less $10 in commissions, leaves $665 on $2,005 invested, a 33.17% return. Any sale above $38.70 a share would still have come out ahead.

200 shares bought at $25, sold at $20

Number of shares
200
Purchase price per share
25
Sale price per share
20
Dividends received per share
0
Commission on purchase
0
Commission on sale
0

Result Net profit or loss: -$1,000.00
Total return: -20%
Outcome: Loss
Amount invested (with fee): $5,000.00
Cash back after the sale: $4,000.00
Price gain or loss: -$1,000.00
Dividend income: $0.00
Break-even sale price: $25.00

  1. Purchase cost = 200 × $25.00 + $0.00 fee = $5,000.00
  2. Sale proceeds = 200 × $20.00 = $4,000.00
  3. Dividends = 200 × $0.00 = $0.00
  4. Net profit = $4,000.00 + $0.00 − $5,000.00 − $0.00 fees = -$1,000.00
  5. Total return = -$1,000.00 ÷ $5,000.00 × 100 = -20%

A $5 drop on each of 200 shares is a $1,000 loss, a 20% fall on the $5,000 invested.

How it is calculated

Total return = (N × P1 + N × D − N × P0 − Fb − Fs) ÷ (N × P0 + Fb) × 100

N
number of shares
P0
purchase price per share
P1
sale price per share
D
dividends received per share
Fb, Fs
commission paid on the purchase and on the sale

This is the holding-period return used in investment textbooks, extended to a whole position and to trading costs. The numerator is the net profit: what the sale brought in plus dividends, minus the purchase cost and both commissions. The denominator is the cash actually put in, purchase cost plus the buying commission. The break-even sale price is (N × P0 + Fb + Fs − N × D) ÷ N, the price that brings the net profit to zero. Dividends are counted as cash received, not reinvested.

Sources

  • Stocks — U.S. Securities and Exchange Commission, Investor.gov

When not to use it

  • For dividends that were reinvested into more shares, enter the final share count and treat the reinvested cash as part of the cost instead.
  • For positions built from several purchases at different prices, find the average cost per share first.
  • For after-tax results, since capital gains and dividend taxes are not deducted here.

Common mistakes

  • Leaving out dividends, which understates the return of income stocks by several percentage points.
  • Forgetting the sale commission, so a small gain looks profitable when the fee wipes it out.
  • Comparing total returns of trades held for very different lengths of time as if they were equal.

Frequently asked questions

What is the difference between price gain and total return?

Price gain counts only the change in share price. Total return adds dividends received and subtracts trading costs, then expresses the result as a share of the money invested. For a share bought at $100, sold at $110 with a $4 dividend, the price gain is 10% but the total return is 14%.

Can I use this for shares I still own?

Yes. Put today's market price in the sale price box. The result is then an unrealised profit or loss: it shows where the position stands now, but nothing is locked in until the shares are sold, and the sale commission is only an estimate.

How is the break-even sale price worked out?

It is the sale price that makes net profit exactly zero. Take the purchase cost plus both commissions, subtract the dividends already received, and divide by the number of shares. Dividends lower the break-even point, so an income stock can be sold below its purchase price without a loss.

Why is the return measured against the cost including the buying commission?

The commission is cash that left your account to open the position, so it is part of what was invested. Measuring against the share cost alone would show a slightly higher percentage than the money you actually committed earned.

Does the calculator include taxes?

No. Capital gains tax and tax on dividends depend on where you live, your income and how long the shares were held. The profit shown is before tax, so the amount you keep will usually be lower.

How do I compare a return earned over three months with one earned over five years?

The percentage here covers the whole holding period, whatever its length. To compare trades of different lengths, convert each to a yearly figure first; a 10% gain in three months and a 10% gain over five years are very different outcomes.

Cite this tool

Using this tool in an assignment, article or report? Copy a citation, or a link for your website.

APA

Tools Directory Editorial Team. (2026, October 26). Stock Investment Calculator. Tools Directory. Retrieved October 27, 2026, from https://tools.milunir.com/finance/stocks-and-dividends/stock-investment-calculator/

MLA

Tools Directory Editorial Team. “Stock Investment Calculator.” Tools Directory, 26 Oct. 2026, https://tools.milunir.com/finance/stocks-and-dividends/stock-investment-calculator/. Accessed 27 Oct. 2026.

Chicago

Tools Directory Editorial Team. “Stock Investment Calculator.” Tools Directory. Last modified October 26, 2026. Accessed October 27, 2026. https://tools.milunir.com/finance/stocks-and-dividends/stock-investment-calculator/.

Link<a href="https://tools.milunir.com/finance/stocks-and-dividends/stock-investment-calculator/">Stock Investment Calculator – Tools Directory</a>