How it's calculated
Total shares S = s1 + s2 + … + sk
Total cost C = s1·p1 + s2·p2 + … + sk·pk + (all fees)
Average cost = C / S (break-even sale price, before selling costs)
Gain / loss = S · current price − C
Shares x to reach target average T when buying at price p with fee F:
(C + F + x·p) / (S + x) = T ⇒ x = (C + F − T·S) / (T − p)
- Fees are added to cost, so they raise your average and your break-even price. (For US tax purposes, cost basis generally includes commissions.)
- A target is only reachable if it lies between the next buy price and your current average. You can't average down by buying above your average, and you can never get all the way down to the buy price.
- The whole-share answer rounds up, so the resulting average is at or slightly beyond your target.
- This is a simple weighted average across all lots. Brokers may report tax cost basis by specific lot or first-in-first-out, which matters when you sell only part of a position. Sales and splits aren't modeled.
Worked examples
1. Two equal buys
100 shares at $50 and 100 more at $30: (5,000 + 3,000) ÷ 200 = $40.00 average cost. The stock has to get back to $40, not $50, for you to break even. Load this example
2. Unequal buys with fees
10 shares at $100 and 30 at $80, with a $5 commission on each: (1,000 + 5 + 2,400 + 5) ÷ 40 = 3,410 ÷ 40 = $85.25. The larger second buy pulls the average closer to $80. Load this example
3. How many shares to average down?
You own 100 shares at $50; the price is now $32 and you want a $45 average. x = (5,000 − 45 × 100) ÷ (45 − 32) = 500 ÷ 13 = 38.46 shares. In whole shares that is 39 shares costing $1,248.00, for a new average of $44.95. Load this example
Frequently asked questions
How do I calculate my average stock price after multiple buys?
Multiply each purchase's shares by its price, add them up (plus any fees), and divide by the total number of shares. Example: 100 @ $50 and 100 @ $30 gives $8,000 ÷ 200 = $40.
How many shares do I need to buy to average down?
Use x = (current total cost − target × current shares) ÷ (target − buy price). The calculator does this for you and also gives the whole-share answer and its cost.
Is averaging down a good idea?
This calculator does the arithmetic, not the judgment. Averaging down lowers your break-even price, but it also puts more money into a position that has fallen. Whether that makes sense depends on why it fell and how it fits your plan.
Should I include commissions?
Yes, if you paid them. Fees increase your total cost and your break-even price. Many brokers now charge $0 commissions on stock trades, in which case leave the fee at $0.
Is my average cost the same as my tax cost basis?
Not always. Average cost across all lots is what most investors mean by "my average price." For taxes, US brokers often track each lot separately (for example first-in, first-out), so the gain on a partial sale can differ. Mutual funds can use an average-cost method.