Toolstia / Stock average calculator

Stock average calculator

Enter each purchase as a number of shares and a price, and get your average cost per share, the total you have invested and the total number of shares. Add a fee per purchase and a current price to see your gain or loss.

Your average cost is the total you paid, including fees, divided by the number of shares you hold. Each line is one purchase, written as shares then price, separated by a space, a comma, or an @ sign. It helps when buying in several steps, for example when averaging down. It is not tax advice, since tax lots can follow different rules.

How it works

  1. Type one purchase per line, such as 10 @ 100.
  2. Add a fee per purchase and the current price if you like.
  3. Read the average cost and the gain or loss.

The formula

Average cost is the total spent on all purchases, including fees, divided by the total number of shares.

Averaging down

Buying more after a price drop lowers your average cost. The calculator shows where you stand after each extra buy.

Gain or loss

The current value is shares times the current price. The gain is that value minus everything you paid.

Input formats

Each line takes two numbers separated by a space, comma or @. Dollar signs and thousands commas are ignored.

Questions

Is this tax advice?

No. Tax rules can use specific lots, not the average. Everything happens in your browser, and nothing you enter is sent anywhere.

Can I use fractional shares?

Yes. Decimals are fine in the share count.

What if a line is wrong?

It is skipped, and the tool tells you how many lines were ignored.