Cost Basis Calculator
Calculate your exact average cost per share across multiple purchase lots for stocks, ETFs, and crypto.
Whether you are dollar-cost averaging into an index fund or buying the dip on individual stocks, knowing your exact average cost basis is critical. It determines your break-even point and is mathematically necessary for calculating your true return on investment (ROI).
Our interactive cost basis calculator below allows you to input an unlimited number of purchase lots (individual trades) to determine your weighted average cost per share, total investment value, and current profit or loss if you provide a current market price.
Average Cost per Share Calculator
How is Cost Basis Calculated?
The mathematical formula for calculating your average cost basis per share across multiple purchases is straight-forward. It is simply your total capital invested divided by your total number of shares.
To find your "Total Capital Invested", you must multiply the number of shares bought in each individual lot by the price paid for that lot, and add them all together.
Cost Basis Example Calculation
Let's say you are buying shares of Apple (AAPL) over several months:
- Lot 1: You buy 10 shares at $150 each ($1,500 total).
- Lot 2: The price drops. You buy 20 shares at $130 each ($2,600 total).
- Lot 3: The price drops further. You buy 10 shares at $120 each ($1,200 total).
First, calculate your total capital invested: $1,500 + $2,600 + $1,200 = $5,300.
Next, calculate your total shares owned: 10 + 20 + 10 = 40 shares.
Finally, divide your total capital by total shares: $5,300 / 40 = $132.50 per share.
Even though you paid $150 for your first batch of shares, your dollar-cost averaging strategy successfully lowered your break-even point to $132.50.
Why Do Commissions Matter?
If you are using a modern zero-commission broker (like Wealthsimple Trade in Canada or Robinhood in the US), you can likely ignore trading fees.
However, if you are paying flat fees (e.g., $9.99 per trade at a big bank), those commissions legally increase your cost basis. By factoring them into your purchase cost, you lower your calculated profit, which ultimately saves you money on capital gains taxes when you eventually sell.
You can use our Brokerage Fee Calculator to see exactly how much commissions are dragging down your portfolio returns over time.
Cost Basis vs. FIFO (First-In, First-Out)
It is important to understand that while an "average" cost basis is useful for tracking your personal break-even point, it is not always how the government taxes you.
In the United States, the IRS default accounting method for individual stocks is FIFO (First-In, First-Out). If you own 100 shares of a stock bought at different times and decide to sell 50 shares, the IRS assumes you are selling the oldest 50 shares you bought. Your tax bill will be based on the cost basis of those specific 50 shares, not your average across the 100.
In Canada, however, the CRA requires you to use the Adjusted Cost Base (ACB) method—which is essentially a rolling average cost basis calculation across all identical properties (shares) you hold in non-registered accounts.