Stock Average Calculator
Enter up to three purchases of the same stock to see your weighted average cost per share, total cost basis, and profit or loss at the current price.
What this calculator returns
Enter up to three purchases — shares and price for each — plus the current market price. You get the weighted average cost per share, your total cost basis, the market value at the current price, and the profit or loss in both dollars and percent.
Set any purchase’s share count to zero to skip it, so the same tool handles two purchases as easily as three. The average is not the arithmetic mean of your three prices; it is weighted by how many shares you bought at each one.
The average cost formula
The numerator is your total cost basis: each purchase contributes shares × price. The denominator is the sum of the share counts. Dividing one by the other gives the single price at which your entire position would break even before fees and taxes.
Weighing by shares is the whole point. Buying 100 shares at $50 and 10 shares at $20 gives an average of $47.27, not $35. The cheap purchase barely moves the number because it barely moved your position.
Why three purchases is enough
Three lots cover the common cases: an initial buy, an add on a dip, and a later top-up. If you have more than three, combine the oldest lots into one weighted entry — 40 shares at $30 and 60 at $32 is 100 shares at $31.20, and the average cost of the combined position is identical.
Worked example at the defaults
Buy 100 shares at $50 ($5,000), 50 at $45 ($2,250) and 100 at $40 ($4,000). Total cost is $11,250 across 250 shares, so the average cost is $11,250 ÷ 250 = $45.00. The simple average of the three prices would be $45.00 only by coincidence here — the weighting happens to balance.
At a current price of $48 the position is worth $12,000, for a gain of $750, or 6.67%. The stock is 6.7% above your average cost, and 4% below your first purchase price. Both statements are true, and only the average cost tells you whether the position as a whole is winning.
How the running average moves
| Purchase | Shares | Price | Cost | Average after |
|---|---|---|---|---|
| Buy 1 | 100 | $50.00 | $5,000 | $50.00 |
| Buy 2 | 50 | $45.00 | $2,250 | $48.33 |
| Buy 3 | 100 | $40.00 | $4,000 | $45.00 |
The average falls with each purchase because every buy is below the running average. Buy 2 drops it $1.67, and Buy 3 drops it another $3.33. A purchase 17% below the running average moved the whole position’s breakeven by 6.9% — useful, but far less than the decline itself, because the earlier shares were bought higher.
What moves the average
- Size of the new lot: buying 100 shares at $40 moves the average $3.33; buying 25 shares moves it $1.19.
- Gap to the current average: a purchase far below the average pulls harder than one just under it.
- Existing position size: the larger your holding, the more shares a new lot needs to shift the average.
- Commissions and fees: adding $5 of commission to a $4,000 purchase raises the per-share cost by $0.05.
- Splits: a 2-for-1 split halves the price and doubles the share count, leaving total cost and average cost per pre-split share unchanged in value terms.
The trap in averaging down
A lower average feels like progress, but it only helps if the stock recovers. At the defaults, buying the third tranche at $40 turned a 250-share position with a $48.33 average into one with a $45 average — and $4,000 more at risk. If the price instead keeps falling to $30, the larger position loses more than the smaller one would have.
Cost basis and taxes
Brokers report cost basis to the IRS on Form 1099-B, and the method they use determines your realized gain. Average cost is mandatory for most mutual funds and permitted for stocks; specific-lot identification lets you choose which shares to sell and is usually better for tax planning on individual stocks.
The difference is not academic. Sell 100 of the 250 shares at $48 using average cost and the basis is $4,500, for a $300 gain. Sell the specific lot bought at $50 instead and the basis is $5,000, for a $200 loss. Same sale, opposite tax outcome.
What the average hides
A single average cost cannot tell you which shares are long-term and which are short-term. Each purchase starts its own holding clock, so a position bought over three years has three different tax treatments. Before selling, check the lot detail in your account rather than the average on the summary screen.
Common mistakes
- Averaging the three prices instead of weighting by shares, which gives $45.00 here but the wrong answer in most real portfolios.
- Leaving commissions out of the cost basis, which overstates the gain slightly on every sale.
- Forgetting that a reinvested dividend is a purchase with its own cost and holding period.
- Treating the average as a target price. It is a breakeven, not a forecast.
- Mixing accounts. A position held in a taxable account and an IRA should not be averaged together.
The most expensive version of the first mistake is averaging the percentage returns instead of the prices. A position that falls 50% and then rises 50% is not back to even — it is down 25%. Averaging the prices of your purchases handles this correctly; averaging the returns does not.
Frequently asked questions
How do I calculate my average stock price?
Add up shares × price for every purchase, then divide by total shares. At the defaults that is $11,250 ÷ 250 = $45.00 per share.
Why is my average cost not the midpoint of my purchase prices?
Because the midpoint ignores how many shares you bought at each price. Buying 100 shares at $50 and 50 at $45 gives $48.33, not $47.50, since the larger lot carries more weight.
Does the average cost include brokerage fees?
This calculator does not. Add commissions to total cost for an accurate basis: a $5 fee on the $4,000 purchase raises the effective price from $40.00 to $40.05.
What is averaging down?
Buying more at a lower price to cut your breakeven. At the defaults the third buy at $40 lowered the average from $48.33 to $45.00, but it also added $4,000 of exposure to a falling stock.
At what price do I break even?
At your average cost, before fees and taxes. The defaults need $45.00. At the current $48.00 you are $750 ahead on 250 shares, a 6.67% gain.
Should I use average cost or specific lots for taxes?
Specific-lot identification usually gives more control on individual stocks, since you can choose to realize a loss or a long-term gain. Average cost is required for most mutual funds and is simpler to administer.
How does a stock split affect the average cost?
A 2-for-1 split doubles the share count and halves the per-share price, so total cost is unchanged and the position value is identical. The reported average cost per share halves, which can look alarming for no reason.
Can I average positions across accounts?
You can compute a combined figure for your own tracking, but keep the tax basis separate per account. Averaging a taxable position with an IRA position produces a number that matches neither tax return.
What if I bought more than three times?
Merge the earliest lots into one weighted entry. 40 shares at $30 plus 60 at $32 equals 100 shares at $31.20, and using that combined lot gives the identical average for the whole position.
Method and sources
- Weighted average cost = total cost basis / total shares.
For educational purposes only — not financial, tax, or legal advice. Verify figures with a qualified professional before acting.