Stock Average Calculator

Calculate the weighted average cost per share when you buy stock at different prices.

Money Up to 5 buys Weighted avg Multi-currency
Rate this calculator · 5.0 (1)

Stock Average Calculator

Add 2-5 buy lots. Results update live.

Instructions — Stock Average Calculator

  1. Select how many buys to include (2-5 lots).
  2. For each buy, enter the number of shares purchased and the price per share.
  3. The headline shows your weighted average cost per share.
  4. Stats below show total shares, total invested, break-even price, and the price range of your purchases.

Your average cost is also your break-even price. To turn a profit, the stock must trade above this figure when you sell.

Formulas

Weighted average cost per share:

Avg Cost = Σ(sharesi × pricei) / Σ(sharesi)

Total invested (cost basis):

Cost Basis = Σ(sharesi × pricei)

Unrealized gain or loss:

Gain = (Current Price × Total Shares) − Cost Basis

Reference

Tax reporting: The IRS taxes capital gains on the difference between sale price and cost basis. Accurate records can save substantial tax across many trades. The SEC and IRS Publication 550 both detail the rules.

Lot accounting methods: When selling part of a holding, you can use FIFO (first in, first out), average cost, or specific identification. The method affects tax owed; specific identification typically gives the most control.

Dollar-cost averaging: Investing a fixed amount on a schedule mechanically lowers your average cost when prices fall and raises share count when prices dip.

Article — Stock Average Calculator

Stock average calculator: weighted cost basis explained

Stock average — also called cost basis per share — is the weighted average price you paid across all your purchases of the same security. Buy 10 shares at $150 and 15 shares at $165 and your average cost is $159, not $157.50, because the larger lot pulls the average toward its price.

The figure shows up everywhere in investing: as your break-even price for selling at a profit, as the baseline for capital gains tax, and as the anchor for evaluating dollar-cost averaging strategies. Get it wrong and you over- or under-report income to the IRS.

What is stock average cost?

Average cost per share is total dollars invested divided by total shares owned. Unlike a simple arithmetic average of purchase prices, it weights each price by the size of that lot. A $50 buy of 100 shares carries 10× the weight of a $50 buy of 10 shares.

The SEC Investor.gov resources stress that cost basis is the foundation of accurate tax reporting. Brokers are required to track and report cost basis for shares acquired after 2011, but the responsibility for accuracy ultimately falls on the investor — especially for shares transferred between accounts.

Did you know

The IRS Publication 550 explicitly addresses cost basis methods, lot identification, and the wash-sale rule. The wash-sale rule disallows a loss if you buy the same security within 30 days before or after the loss sale.

The stock average formula

Two equations cover the calculation. First, total invested. Second, average cost per share.

  • Total invested = Σ(sharesi × pricei)
  • Average cost = Total invested / Total shares
  • Break-even price = Average cost
  • Unrealized gain = (current price − average cost) × total shares
  • Gain % = (current price − average cost) / average cost × 100

Worked example with three buy lots

Suppose you bought Apple in three separate trades over a year:

Buy log
10 sh @ $150 = $1,500
15 sh @ $165 = $2,475
20 sh @ $145 = $2,900
Total 45 sh = $6,875

Average cost equals $6,875 divided by 45 shares, or $152.78 per share. That is also your break-even price. If Apple trades at $170 today, you have an unrealized gain of ($170 − $152.78) × 45 = $774.90, which is 11.27% on your invested capital.

Dollar-cost averaging strategy

Dollar-cost averaging (DCA) is the practice of investing a fixed amount on a fixed schedule regardless of price. The mechanical effect is that you buy more shares when prices are low and fewer when prices are high, which tends to push your weighted average cost below the simple average of the prices you bought at.

Federal Reserve research on household saving behavior consistently finds that automatic, scheduled contributions outperform discretionary timing decisions for the typical investor. The reason is behavioral: rules-based investing removes the temptation to wait for a better price that often never comes.

Tip

A 2012 Vanguard study compared lump-sum investing to DCA across rolling 10-year windows from 1926 to 2011. Lump-sum won about two-thirds of the time on raw returns, but DCA reduced regret-driven selling during drawdowns — a tradeoff worth taking for most retail investors.

Averaging down: when it backfires

Averaging down concentrates risk

Buying more of a falling stock lowers your average cost but increases the dollars at risk. If the price keeps falling, the loss is now spread over a larger position. Averaging down is profitable only if the original investment thesis still holds.

Example: buy 100 shares at $100 for $10,000. Stock drops to $80, you buy another 100 for $8,000. New average cost is $90. The stock now only needs to recover to $90 (not $100) for you to break even — but if it falls to $50, your loss is $8,000 rather than $5,000, because you put more capital in.

Cost basis and capital gains tax

When you sell shares, the IRS calculates taxable gain as sale price minus cost basis. For the same gross sale proceeds, a higher cost basis means lower tax.

US federal long-term capital gains rates (for assets held more than one year) are 0%, 15%, or 20% based on income level. Short-term gains are taxed as ordinary income, which can be more than double the long-term rate for high earners. Selling shares with the highest cost basis first usually minimizes immediate tax.

FIFO vs specific identification

When you sell part of a holding, the IRS allows three lot-assignment methods. FIFO (first in, first out) sells the oldest shares first — usually the lowest cost basis if the stock has gone up, producing the highest tax. Average cost uses the weighted average across all lots, common for mutual funds. Specific identification lets you nominate which lots to sell, maximizing tax efficiency.

Specific ID requires explicit instructions to your broker before the trade settles. Most major brokerages (Fidelity, Schwab, Vanguard) support it through their trading platforms. Done well, specific ID can save thousands of dollars on a multi-lot sale.

Stock average mistakes to avoid

Three errors dominate stock average mistakes. First, ignoring partial sales — selling some shares changes your remaining cost basis depending on the lot method you chose. Second, forgetting dividends — if you reinvest dividends, each reinvestment creates a new lot with its own cost basis. Third, mishandling stock splits — a 2-for-1 split doubles your shares and halves your cost basis per share, leaving total invested unchanged.

A subtler mistake involves cross-broker transfers. When you transfer shares from one brokerage to another, the receiving broker is supposed to inherit the cost basis from the sending broker, but this can fail for older lots or for shares originally acquired through employer stock purchase plans. After any transfer, verify the cost basis displayed in your new account against your own records before placing your next sale.

Did you know

The IRS requires brokers to report cost basis on Form 1099-B for "covered" securities — stocks acquired since 2011, mutual funds since 2012, and most other instruments since 2013-2014. For older "non-covered" lots, you supply the cost basis yourself, which is why long-term records are essential.

Finally, watch for return of capital (ROC) distributions, common in REITs, MLPs, and some closed-end funds. ROC is not taxable when received, but it reduces your cost basis on a per-share basis. Investors who reinvest these distributions without adjusting cost basis can end up dramatically overstating their tax liability when they eventually sell.

FAQ

The weighted average price you paid for each share across all your purchases. Calculated as total invested divided by total shares. It is also your break-even price.
For full cost basis, yes. Most US brokers now charge zero commission on stock trades, but if you do pay fees, add them to the purchase price for that lot. This calculator focuses on share price; you can roll fees into the per-share price.
A strategy where you invest a fixed dollar amount on a regular schedule regardless of price. When prices fall, your fixed budget buys more shares; when prices rise, it buys fewer. The mechanical effect tends to lower your weighted average cost in volatile markets.
It is risky. Buying more shares as a stock falls lowers your average cost but concentrates more capital in a position that is moving against you. If the decline reflects deteriorating fundamentals, you are doubling down on a losing thesis.
Your cost basis is subtracted from your sale price to compute capital gain or loss. Long-term gains (held over one year) are taxed at preferential US federal rates of 0%, 15%, or 20%. Short-term gains are taxed as ordinary income. Accurate cost basis matters.
First-in, first-out. When you sell part of a holding, FIFO assumes you sold the oldest shares first. Many brokers default to FIFO. The alternative, specific identification, lets you choose which lot to sell — useful for tax optimization.
Yes. The same weighted average math applies to any security you bought in multiple lots. Note that mutual funds default to the average cost method for tax purposes unless you opt out.