Cost basis is the total amount you paid to buy an investment, including the fees and commissions. If you buy the same stock or fund several times at different prices, the cost basis per share is the total paid divided by the total number of shares held, which is also called the average cost (the PRU in France, the prezzo medio di carico in Italy, the Einstandskurs in Germany). It is the starting point for working out whether a sale made a gain or a loss: you compare the sale price with the cost basis.
Worked example
You buy 10 shares at $50 and pay a $5 fee: that costs $505. Later you buy 10 more at $40 with another $5 fee: that costs $405. In total you paid $505 + $405 = $910 for 20 shares, so your average cost is $910 ÷ 20 = $45.50 per share. Now you sell 5 shares at $60. With the average-cost method, each share sold has a cost of $45.50, so the gain is 5 × ($60 − $45.50) = $72.50 (before any selling fee). With first-in, first-out (FIFO), the 5 shares sold are the oldest ones, which cost $505 ÷ 10 = $50.50 each, so the gain is 5 × ($60 − $50.50) = $47.50. Same sale, two different gains.
Why it matters
Your cost basis decides how big a gain or loss you report when you sell, so a wrong figure means a wrong tax number. Buying more at a lower price pulls the average cost down, and buying more at a higher price pushes it up, but the average only changes with what you actually paid, not with what the price does afterwards. Fees count: leaving them out makes your cost look lower and your gain look bigger than it was. Be careful with the method, too. Some countries tax sales using the average cost, others use FIFO or let you pick specific lots, and the rules differ for funds, shares and crypto. This page explains the mechanism only. Check which method your country and your broker use, and ask a qualified tax adviser if the amounts are large.
Frequently asked questions
Add up everything you paid for all your purchases, fees included, and divide by the total number of shares you hold. For example, $910 spent on 20 shares gives an average cost of $45.50 per share. After a sale, the remaining shares keep the same average cost under the average-cost method.
With FIFO (first in, first out), the shares you sell are treated as the oldest ones you bought, so the gain uses their purchase price. With average cost, every share is treated as costing the same blended price. The same sale can show a different gain under each method, so use the one your country and broker apply.
Yes, in general the commission and fees you pay when buying are added to the cost basis, which lowers the gain you report when you sell. The exact treatment depends on your country's tax rules, so check them or ask a tax adviser.
Related terms
Built & maintained by Worthmap · Last updated November 1, 2026
Educational use only. This tool provides estimates for informational purposes and does not constitute financial, investment, tax, or legal advice. Results are based on inputs you provide and mathematical models, they do not guarantee future performance. Always consult a qualified financial adviser before making investment decisions.