Why quantity-weighted averaging is necessary
If you buy 10 shares of a company at $50 and later buy 90 shares of the same company at $100, what is your average stock price?
A simple arithmetic average of the two price tags ($50 + $100) / 2 suggests $75. However, this is mathematically incorrect because you bought nine times as many shares at the higher price. When you buy the same stock at different average prices over time, the simple average breaks down — your true weighted average, also called the stock average price, is $95.00, significantly closer to $100.
To determine your accurate break-even point and track position performance, you must use a quantity-weighted average that weights each purchase price by the volume of shares acquired. You can calculate this instantly with our free Stock Average Calculator.
What is the average stock price?
Your average stock price is the quantity-weighted cost of a single share across every purchase you have made of that stock: add up all the cash you spent, including broker fees, and divide by the total number of shares you own. It is the same figure as the weighted average cost per share — and the price the stock must reach for you to break even.
In the worked example below, you spent $11,010.00 in total, including $10.00 of fees, for 200 shares — so the average stock price is $55.05 per share. To calculate your average stock price for your own trades, enter each lot's price and share count in the calculator and it does the weighting for you.
The weighted average cost formula
The mathematical formula sums the total capital expended across all purchases (including any transaction commissions or regulatory fees you wish to attribute) and divides that total dollar sum by the aggregate number of shares owned.
Hypothetical worked example
Let us walk through a practical scenario with two separate purchases and broker fees.
Illustrative 2-Lot Purchase Example
- Lot 1: 50 shares purchased at $40.00 each = $2,000.00 (plus $5.00 transaction fee).
- Lot 2: 150 shares purchased at $60.00 each = $9,000.00 (plus $5.00 transaction fee).
- Total cash spent before fees = $2,000 + $9,000 = $11,000.00.
- Total transaction fees = $10.00.
- Total cost basis = $11,010.00 across 200 total shares.
- Weighted Average Cost Per Share = $11,010 ÷ 200 = $55.05 per share.
How transaction fees affect your break-even
While many modern retail brokerages offer commission-free trading on major US equities, institutional investors, options traders, OTC stock buyers, and foreign market investors frequently incur per-order ticket charges, exchange fees, or currency conversions.
Incorporating these fees into your average cost per share provides an honest evaluation of your net break-even price. In the example above, without fees your average was $55.00, but fees increased your actual required exit price to $55.05. Once you establish your true cost basis, calculate your eventual return on capital using our ROI Calculator.
Average cost vs. IRS tax cost basis rules
It is crucial to recognize that an internal weighted average cost calculation may not match your official tax reporting basis when you sell a portion of your position.
In the United States, under IRS Publication 550 (Investment Income and Expenses) and Treasury Regulation § 1.1012-1(c), the default accounting method for individual equities is First-In, First-Out (FIFO). Under FIFO, when you sell 50 shares from the example above, the IRS treats the earliest lot purchased at $40.00 as sold first, resulting in a different realized capital gain than if an average basis was applied.
Average cost accounting is generally permitted by the IRS under Treas. Reg. § 1.1012-1(e) for mutual funds and dividend reinvestment plans (DRIPs), while individual equities require specific share identification (SpecID) or default to FIFO. Outside the US, statutory rules differ substantially: the UK HMRC mandates Section 104 holding pools (HMRC HS284), and the Canada Revenue Agency (CRA) mandates Adjusted Cost Base (ACB) pooling. Always verify tax lots with your brokerage tax statements (such as Form 1099-B in the US) and consult a qualified tax advisor.