Combine multiple purchases of the same security into a weighted average cost per share. Include purchase fees and optionally enter a market or target sell price to estimate the value and potential gain of the entire holding.
Entering your purchases
Add one purchase per line in the form shares, price, optional fee. For example, 10, 20, 2 means ten shares bought at 20 each plus a fee of 2 for that purchase. Paste up to 200 lines. Do not use thousands separators, currency symbols, or column headings. A fee belongs to the entire row, not each share.
Use only purchases belonging to the position you are evaluating, in the same currency and adjusted to a consistent share basis. Enter the optional sell price per share if you want a valuation. The currency selector changes labels and does not convert currencies.
Reading the results
Total invested includes all entered purchase fees. Average cost is total invested divided by total shares. Potential gain or loss compares the value at the sell price with that cost. It excludes sale fees, taxes, dividends, and previously realized gains. The purchase table lets you check each row before relying on the total.
Examples
Unequal purchases with a fee
Buy 10 shares at 20 with a 2 fee, then 5 shares at 10 with no fee. You hold 15 shares with 252 invested, so average cost is 16.80 per share. An unweighted average of 20 and 10 would incorrectly give 15.
Value the position at 18 per share
Those 15 shares would be worth 270 at 18 each. Compared with the 252 purchase cost, potential gain is 18, or approximately 7.1429%, before any selling costs or taxes.
Formula
Total shares = sum of shares in each purchase
Total cost = sum of (shares × price + purchase fee)
Average cost = total cost / total shares
Potential gain = total shares × sell price − total cost
If all purchase costs are zero, the average is zero and percentage return is omitted because its denominator would be zero.
Purchase average versus tax basis
This calculator does not track disposals or choose which tax lots were sold. Stock splits, transferred holdings, reinvested distributions, and tax adjustments need careful records. For US tax context, the IRS overview of asset basis explains why basis may require adjustments beyond an initial purchase price.