Stock Average Calculator

Fractional shares are fine. The purchases filled in are only an example.

Used to show your gain or loss. Enter today's price.

More options

Fees you paid to buy are part of your cost.

Average cost per share$47.50
Total shares40.0000
Total cost$1,900.00
Value at the current price$2,200.00
Gain (+) or loss (-)$300.00
Gain or loss as a share of cost15.79%
Simple average of your purchase prices (for comparison)$50.00

  • Average cost is total cost, including fees, divided by total shares, the same way the IRS describes average basis.
  • Leave unused purchases at 0 shares; they are ignored.
  • Gains are before tax. For tax, shares you sell are usually matched to your earliest purchases unless you choose otherwise; average basis is mainly for mutual fund and dividend reinvestment shares.
  • Stock splits, sales and reinvested dividends are not included unless you enter them as purchases.

Bought the same stock or fund more than once, at different prices? Enter each purchase to see your average cost per share, what the shares are worth today and your gain or loss.

How to use the calculator

  • Purchases: for each buy, enter the number of shares and the price you paid per share. Fractional shares are fine. Purchases 4 and 5 are under More options.
  • Commissions and fees: anything you paid to buy, which adds to your cost.
  • Current price: today’s price, to see what your shares are worth.

For example, 10 shares at $50, 20 at $40 and 10 at $60 cost $1,900 for 40 shares, an average of $47.50 per share. At $55, they are worth $2,200: a gain of $300, or 15.79%.

How average cost is worked out

Add up what you paid for all the shares, including fees, and divide by the total number of shares. That is the same calculation the IRS describes for average basis.

It is not the same as averaging the prices. In the example above, the simple average of $50, $40 and $60 is $50, but you bought twice as many shares at $40, so your real average is $47.50. The calculator shows both so you can see the difference.

Average cost and dollar-cost averaging

If you invest the same dollar amount each time, you buy more shares when the price is low and fewer when it is high. Your average cost then comes out below the average of the prices. For example, $1,000 at each of $100, $80, $125, $50 and $200 buys 55.5 shares at an average of $90.09, while the prices average $111.

Average cost and taxes

  • Average basis is mainly for funds: the IRS lets you use the average basis method for identical shares held with a custodian, such as mutual fund shares and shares bought through a dividend reinvestment plan.
  • Stocks usually use first-in, first-out: if you sell some shares and cannot identify which ones, IRS Publication 550 treats the ones you bought first as sold first. Your taxable gain can then differ from what average cost suggests.
  • Check with your broker: your broker reports cost basis on Form 1099-B, and you may be able to choose which shares you sell.

Use this calculator to understand what you paid and where you stand. For your tax return, use the figures your broker reports, or ask a tax professional.

Frequently asked questions

Should I include fees in my average cost?

Yes. Commissions and fees you paid to buy are part of what the shares cost you, so they raise your average cost.

Does buying more at a lower price lower my average?

Yes. Each new purchase below your current average pulls it down; the more shares you buy, the more it moves. It does not change whether the stock itself recovers.

What about stock splits and reinvested dividends?

Enter reinvested dividends as extra purchases. After a split, adjust the share counts and prices of earlier purchases by the split ratio, or use the figures your broker shows.

Is my information saved anywhere?

No. The calculation runs in your browser. Nothing you type is stored or sent to us or anyone else.

Related calculators

Reviewed by Maxwell. Last reviewed October 23, 2026. Methodology: total cost including fees divided by total shares, as the IRS describes average basis; gain or loss at the current price, before tax.

Back to top button