Stock average cost calculator
Work out the average cost of your stocks, ETFs, funds or crypto from your buys and sells, including fees, the realized gain or loss on each sale and the result at market price.
How to useAverage purchase cost
Enter the transactions in chronological order. The data stays on this page only.
Stock average cost calculator: what it is for
Enter your buys and sells in order, with quantity, price and fees. The calculator keeps the average purchase cost, starts over when the position goes to zero, shows the realized gain or loss on each sale and, with the current price, the unrealized result of the position.
The calculations run in your browser and are a simulation only; they are not investment advice.
How to use
- Add your buys and sells in order.
- Enter the fees for each transaction.
- See the average cost and the results.
When to use it
- Tracking the cost basis for taxes.
- Following your average cost after new purchases.
- Working out the gain on a sale.
Frequently asked questions
How is the average cost calculated?
Add up what you paid on every purchase, including fees and commissions, and divide by the total number of shares. When you sell, the average cost does not change: the number of shares goes down and the gain or loss is the difference between the sale price and the average cost.
Why does the average cost matter for taxes?
In many countries the cost basis of a sale is based on the average purchase price (in others, on the specific lots sold, so check your local rules). Purchase fees are added to the cost, and sale fees reduce the amount received.
What if I sell everything and buy again?
When the position goes to zero, the average cost starts over on the next purchase. The calculator does this automatically, following the order of the transactions.
Is it really free?
Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.