This stock-basis calculator computes quantity-weighted average purchase price, total cost basis, and optional unrealized return at a current price.
Finance
Stock Average Calculator
Calculate quantity-weighted stock cost basis and optional unrealized return.
Calculator
About this calculator
Formula notes
average price = total cost basis / total shares; unrealized P/L = current price x total shares - total cost basis.
Worked examples
- Example: buying 100 at 10 and 50 at 20 gives an average price of 13.33 and total cost basis of 2000.
- Buying 200 shares at 25 and 100 at 40 gives an average price of 30 and a cost basis of 9000.
How to use it
- Enter purchase prices and share quantities as matched lists.
- Optionally enter the current price.
- Read the average price, cost basis, current value, and unrealized return.
Frequently asked questions
Do the price and quantity lists need the same length?
Yes. Each price is paired with its quantity, so the lists must match in length.
Is the current price required?
No. Leave it empty to see only the average price and cost basis.
Limits and interpretation
- The average is quantity-weighted across all entered lots; fees and commissions are not included unless you add them to a price.
- Unrealized return is based only on the entered current price and does not include dividends or taxes.