Add up the total dollars you spent across all your purchases, then divide by the total number of shares you own. That single number is your average cost basis per share, and it’s what most brokers use to calculate your gain or loss when you sell.
For example, say you bought 10 shares at $30 and later bought 20 shares at $45. You’ve spent $300 + $900 = $1,200 for 30 shares total, so your average cost basis is $40 per share. It doesn’t matter that you never actually paid $40 for any individual share; the average is what counts for tax and performance purposes.
One caveat: if you sell only part of your position, some brokerages let you pick a different accounting method (like FIFO or specific-lot identification) instead of the average, which can change your reported gain. Check your brokerage statement to see which method was actually applied.
You can plug your own purchase history into our Average Cost Basis Calculator to get the exact number in seconds.