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.
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:
10 sh @ $150 = $1,50015 sh @ $165 = $2,47520 sh @ $145 = $2,900Total 45 sh = $6,875Average 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.
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
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.
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.