Stock Average Calculator
Calculate your weighted average cost basis when you accumulate shares through multiple purchases at different prices. The result tells you the break-even price for your position.
About this tool
The Stock Average Calculator is a weighted-average cost-basis tool that turns multiple share lots, each bought at a different price and quantity, into a single break-even price per share. It is the standard math behind dollar-cost averaging (DCA), 401(k) contributions, and any portfolio that accumulates a position over time rather than in one trade.
How it works
Average price = sum(Lot price x Lot shares) / sum(Lot shares) Total invested = sum(Lot price x Lot shares) Break-even price = Average price (ignoring commissions) Unrealised P/L = (Current price - Average price) x Total shares
- Lot = a single purchase transaction with a fixed price and share count, including DRIP reinvestments, stock splits adjusted, and any commission baked into the per-share price.
- Weighted means each lot's price is multiplied by its share count before averaging, so big lots dominate small ones. A simple average of prices is wrong unless every lot is the same size.
- Break-even is the price the current quote must reach for unrealised profit to be zero. Above the average you are in the green, below it you are red.
- Tax basis diverges from the average the moment you sell part of the position. The IRS default is FIFO, which uses the oldest lot's price, not the weighted average.
Worked example
Suppose an investor accumulates 400 shares of an S&P 500 ETF across three lots in 2026:
- Lot 1 (January 2026): 100 shares at 50.00 USD = 5,000 USD invested.
- Lot 2 (March 2026): 200 shares at 60.00 USD = 12,000 USD invested.
- Lot 3 (May 2026): 100 shares at 80.00 USD = 8,000 USD invested.
- Total shares: 100 + 200 + 100 = 400 shares.
- Total invested: 5,000 + 12,000 + 8,000 = 25,000 USD.
- Weighted average: 25,000 / 400 = 62.50 USD per share.
Cost-averaging reference table
How adding a second equal-dollar lot at a lower price shifts the weighted average. Useful for sizing a "double down" purchase:
| Original average | New lot price | Equal dollar add | New average | Average reduction |
|---|---|---|---|---|
| 100.00 USD | 80.00 USD | same as original | 88.89 USD | -11.1% |
| 100.00 USD | 50.00 USD | same as original | 66.67 USD | -33.3% |
| 100.00 USD | 50.00 USD | 2x original | 60.00 USD | -40.0% |
| 100.00 USD | 25.00 USD | same as original | 40.00 USD | -60.0% |
| 50.00 USD | 75.00 USD | same as original | 60.00 USD | +20.0% |
Common pitfalls
- Confusing average price with tax basis. They are equal only on a full liquidation. On a partial sale the IRS uses FIFO unless you specify lots, so the basis on the shares you sold is the oldest lot's price, not the average.
- Forgetting commissions and fees. Brokerage commission, SEC fee, and FINRA TAF (for sells) all push the effective lot price up. Bake them into the lot price before averaging or the break-even is too optimistic.
- Ignoring stock splits and spin-offs. A 2-for-1 split doubles your share count and halves the average price retroactively for every prior lot. Most brokers handle this automatically, but transferred shares can land at the wrong basis.
- Treating wash sales as fresh lots. If you sell at a loss and rebuy the same security within 30 days, the IRS disallows the loss and adds it to the replacement lot's basis. The weighted average changes but the realised loss vanishes.
- Forgetting currency conversion on ADRs. For foreign stocks priced in USD via ADRs, the local-currency price moves with the FX rate and the per-share cost in your home currency can drift even if no shares trade.
- Confusing simple and weighted averages. A simple mean of lot prices ignores the share count and gives the wrong break-even any time the lots are not the same size.
Related calculators and glossary
Frequently asked questions
How is weighted average price calculated?
Sum the total dollars invested across all lots, then divide by total shares owned. Each lot's contribution to the average is proportional to its share count, not the price. A 1,000-share lot at 10 USD weighs ten times more than a 100-share lot at 100 USD even though both invested the same dollars.
Is my average price the same as my tax basis?
Only if you sell every share at once. The IRS default for partial sales is FIFO (first in, first out), which sells the oldest lot first and ignores the average. You can elect Specific Identification at the time of sale to pick which lots to dispose of, which lets you harvest losses or defer gains, but the broker needs the lot IDs before settlement.
Does dividend reinvestment affect my average price?
Yes. Each reinvested dividend is treated as a new lot at the prevailing price on the reinvestment date and folds into the weighted average. Most brokers track this automatically on the 1099-B, but if you transfer shares between brokers the cost basis sometimes resets to zero and needs to be reentered manually.
Does the stock average change when the price moves?
No. The weighted average cost is a historical fact set by the prices you paid, not the current quote. The current price only matters for unrealised gain or loss, which is the difference between current price and your average. Splits and stock dividends do adjust the average, since they change the share count without a cash transaction.
Sources and further reading
- U.S. Securities and Exchange Commission, Cost Basis: An Introduction - Investor.gov primer on FIFO, average cost, and Specific Identification.
- Internal Revenue Service, Publication 550: Investment Income and Expenses - basis rules for stocks, mutual funds, and wash sales.
- FINRA, Understanding Stock Splits and Cost Basis - split adjustment math.
- Investopedia, Weighted Average Cost Basis - the standard textbook formula.
