Utilia

Investment and Stock Profit Calculator

Calculate the profit or loss on a stock trade with commissions, the return in percent, the break-even sell price and the average cost of several purchases.

Results are estimates for information only, not financial advice. Check with a professional before making decisions.

Purchases
Gain or loss
–
Return
–
Break-even sell price
–
Average cost per share
–
Cost of the shares sold
–
Net sale proceeds
–
Total commissions
–
Shares kept
–
How it was calculated

How to use the stock profit calculator

  1. Under Purchases, enter the number of Shares and the Buy price per share. If you bought in several steps, click Add a buy for each purchase (up to ten); Remove deletes one. Fractional shares and prices with more than two decimals are accepted.
  2. Enter the Sell price per share, or the current price to see an unrealized gain.
  3. Leave Shares sold (empty = all) empty to sell the whole position, or enter a smaller number for a partial sale.
  4. Choose the Commission per trade: a Flat amount (for example $9.95) or a Percent of the trade, then enter the Commission. It applies to every buy and to the sale. Enter 0 for commission-free trading.
  5. Pick the Currency for display.

The results show the Gain or loss, the Return, the Break-even sell price, the Average cost per share (with and without commissions), the Cost of the shares sold, the Net sale proceeds, the Total commissions and the Shares kept. Copy summary copies the figures, and How it was calculated lists every step.

The formulas

For each purchase, the cost is shares × price + commission. With several purchases, the average cost per share is:

Average cost = (sum of purchase costs including commissions) ÷ total shares

When you sell, the shares sold carry that average cost (the average cost method):

  • Cost of the shares sold = average cost × shares sold
  • Net sale proceeds = shares sold × sell price − sell commission
  • Gain or loss = net proceeds − cost of the shares sold
  • Return = gain or loss ÷ cost of the shares sold × 100

The break-even sell price is the price at which the gain is exactly zero once the sell commission is paid: (cost + flat commission) ÷ shares, or cost ÷ (shares × (1 − commission %)) with a percentage commission.

Example: 100 shares bought at $25 and sold at $32 with a $9.95 commission on each trade. The cost is $2,509.95, the proceeds $3,190.05, the gain $680.10, a return of 27.10%. The break-even price is $25.199: the stock has to rise almost 20 cents just to cover the two commissions.

Tips

  • Add dividends received separately: this tool measures the price gain only. For a total return including dividends, use the final value in a return on investment calculation.
  • Currency conversion fees on foreign stocks work like an extra commission; include them in the prices for a realistic result.
  • The return is not annualized. To compare trades held for different periods, compute the compound annual growth rate.

A note on taxes

Tax rules differ by country and account type, and this tool does not calculate tax. In Canada, the adjusted cost base (ACB) also uses the average cost of identical shares and includes commissions, and only part of a capital gain is taxable; gains in a TFSA are not taxed. In the US, short-term and long-term gains are taxed differently. Check official guidance or a tax professional for your situation. The results are estimates, not investment or tax advice.

Frequently asked questions

How do I calculate the profit on a stock?

Multiply the shares sold by the sell price, subtract the sell commission, then subtract what those shares cost you, commissions included. The tool does it for you and shows each step.

How is the average cost calculated with several buys?

It adds up every purchase (shares × price + commission) and divides by the total number of shares. Buying more at a lower price lowers your average cost.

What is the break-even price?

The sell price at which you neither gain nor lose after all commissions. Selling above it gives a profit; below it, a loss.

Should I include commissions?

Yes. Commissions reduce your gain on both sides of the trade, and for small positions they can wipe out a modest price rise.

Can I see a partial sale?

Yes. Enter the number of shares in Shares sold (empty = all). The cost uses the average cost per share, and Shares kept shows what is left.