The Average Price Trap: What Every Investor Gets Wrong
Open your Zerodha Kite or Groww app and look at any stock you hold. You will see a number labelled "Avg. cost" or "Average price." This is the weighted average of all your purchase prices for that stock. It is clean, simple, and easy to understand.
It is also completely irrelevant for your taxes.
This might be the single most widespread misunderstanding among Indian retail investors. The average price your broker displays is a convenience metric for tracking your overall position profitability. When it comes to calculating capital gains tax, India mandates the FIFO (First In, First Out) method, which assigns cost on a lot-by-lot basis.
The difference between average cost and FIFO cost can be dramatic. In some cases, FIFO shows a much larger gain than the average would suggest. In others, FIFO shows a gain when the average suggests a loss, or vice versa. Relying on your broker's average price to estimate your tax bill is like using the speedometer to estimate your fuel consumption. It is related, but it gives you the wrong answer.
This article explains exactly how average price and FIFO cost basis differ, when the gap is largest, and how to calculate the correct cost basis for your tax returns.
How Brokers Calculate Average Price
When your broker shows an average purchase price, they are computing a weighted average across all your open lots for that stock. The formula is straightforward:
Average Price = Total Amount Invested / Total Shares Held
For example, suppose you made two purchases of HDFC Bank:
- Purchase 1: 100 shares at Rs 1,500 (total Rs 1,50,000)
- Purchase 2: 100 shares at Rs 1,700 (total Rs 1,70,000)
Total investment = Rs 3,20,000. Total shares = 200. Average price = Rs 3,20,000 / 200 = Rs 1,600.
Your broker app shows "Avg. cost: Rs 1,600" and calculates your unrealized P&L against this number. If the current market price is Rs 1,800, it shows a profit of Rs 200 per share, or Rs 40,000 total.
This is accurate as a portfolio-level metric. It tells you your overall return on this position. But the moment you sell a portion of your holding, this average breaks down for tax purposes because the tax department does not care about your average. They care about which specific lot you sold, determined by FIFO.
The Critical Example: Same Sale, Different Tax
Let us work through a concrete example that demonstrates why this matters.
Purchases of Infosys: - Buy 100 shares at Rs 200 on 1 January 2024 - Buy 100 shares at Rs 400 on 1 July 2024
Total holding: 200 shares. Average price: Rs 300.
Now you sell 100 shares at Rs 450 on 15 March 2025.
Using average price (incorrect for tax): Cost = 100 x Rs 300 = Rs 30,000. Sale = 100 x Rs 450 = Rs 45,000. Gain = Rs 15,000.
Using FIFO (correct for tax): The oldest 100 shares (bought at Rs 200) are sold first. Cost = 100 x Rs 200 = Rs 20,000. Sale = 100 x Rs 450 = Rs 45,000. Gain = Rs 25,000.
The FIFO gain is Rs 25,000, not the Rs 15,000 that average price would suggest. That is a 67% higher gain, and the tax difference at 12.5% LTCG rate is Rs 1,250 more than expected.
Now consider a scenario where you sell 100 shares at Rs 250. Average price method suggests a loss of Rs 5,000 (cost Rs 300, sale Rs 250). But FIFO says the cost is Rs 200, so you actually have a gain of Rs 5,000. You thought you had a loss but you actually owe tax. This is the average price trap.
When Does the Gap Between Average and FIFO Matter Most?
The divergence between average price and FIFO cost is largest when two conditions are met: you have accumulated shares at significantly different prices, and you are selling a partial quantity.
If you sell your entire holding, the total gain is the same under both methods. The lot-level breakdown differs, but the aggregate gain is identical. The problem arises only with partial sales, which is exactly what happens in most real-world scenarios.
Here are situations where the gap is most dangerous:
- You built a position gradually in a stock that has risen steadily. Your early lots have a very low cost, and your recent lots have a high cost. Selling partially triggers FIFO gains that are much larger than the average suggests.
- You bought heavily during a dip and then again at higher prices. The average is pulled down by the cheap purchase, but FIFO still sells the oldest lot first, which may be more expensive if you first bought at a high price, then averaged down.
- You have lots spanning the 12-month boundary. FIFO may classify a sale as long-term (lower tax, with exemption) while you assumed it was short-term based on your most recent purchase.
The takeaway is simple: never use average price to estimate your tax liability on a partial sale. Always reconstruct the FIFO lots.
Impact on Tax-Loss Harvesting Decisions
The average-vs-FIFO gap is particularly treacherous for tax-loss harvesting. Tax-loss harvesting requires selling stocks at a loss. But "at a loss" must be evaluated against the FIFO cost basis, not the average price.
Consider this scenario. You hold a stock with these lots: - Lot 1: 200 shares at Rs 100 (bought 18 months ago, long-term) - Lot 2: 100 shares at Rs 300 (bought 3 months ago, short-term)
Average price: (200 x 100 + 100 x 300) / 300 = Rs 166.67
Current market price: Rs 250. Your broker shows a profit of Rs 83.33 per share against the average.
But look at the FIFO reality. If you sell 100 shares to harvest the loss on Lot 2 (cost Rs 300, price Rs 250, loss Rs 50/share), FIFO says the first 100 shares sold come from Lot 1, not Lot 2. Those shares have a cost of Rs 100 and a gain of Rs 150 per share.
To reach Lot 2, you must sell through all 200 shares in Lot 1 first, triggering Rs 30,000 in LTCG. Only then can you sell the 100 short-term shares for a Rs 5,000 loss. The net effect is a gain of Rs 25,000, not a loss. Your harvesting strategy has backfired because you relied on the average price instead of understanding the FIFO lot structure.
This is exactly why TaxHarvestLab computes the net impact of every harvesting opportunity after accounting for FIFO sell-through.
What Your Broker's P&L Report Actually Shows
To be fair to brokers, the average price displayed in your holdings is different from the Tax P&L report that brokers like Zerodha provide. The Tax P&L report does attempt to use FIFO matching and separates gains into short-term and long-term categories. It is a much more accurate reflection of your tax liability.
However, the Tax P&L report has its own limitations:
- It only covers trades executed through that specific broker. If you hold the same stock across multiple demat accounts, the FIFO matching may be incorrect because it does not see lots purchased elsewhere.
- It may not correctly handle transferred-in shares, where shares were moved from another demat account. The original cost basis may be lost.
- It does not show optimization opportunities. The report tells you what happened, but not what you could have done differently or what you should do before the financial year ends.
- The report is typically available as a yearly summary and may lag real-time activity.
The ideal approach is to use the Tax P&L as a starting point but cross-verify it against your own FIFO lot register. TaxHarvestLab generates this lot register automatically from your uploaded trade data and highlights where the broker's P&L and the true FIFO computation diverge.
How to Calculate the Correct FIFO Cost for Any Sale
Here is a step-by-step method to compute the correct FIFO cost basis for any sale:
Step 1: List all purchase lots for the stock in chronological order. Include the date, quantity, and price per share for each lot.
Step 2: When a sale occurs, begin matching from the oldest lot. Deduct the sale quantity from the oldest lot first. If the sale quantity exceeds the oldest lot, move to the next lot.
Step 3: For each lot consumed (fully or partially), compute the gain or loss separately. Note whether the holding period is over 12 months (LTCG) or not (STCG).
Step 4: Sum up all lot-level gains and losses to get the total capital gain from the sale.
Step 5: Update your lot register. Remove fully consumed lots and reduce the quantity of partially consumed lots.
This is straightforward for a single stock with a few lots. But if you actively trade or hold positions across 30 to 50 stocks with multiple purchase dates each, maintaining this manually becomes error-prone. A single mistake in lot ordering, a missed corporate action, or a forgotten transfer can cascade errors through all subsequent calculations.
This is the core problem that TaxHarvestLab solves. Upload your tradebook once, and the tool reconstructs every lot, applies every corporate action adjustment, and computes accurate FIFO cost for each potential sale.
Summary: Stop Using Average Price for Tax Estimates
The average price your broker shows is a useful portfolio metric, but it is the wrong number for tax planning. Here is what you need to remember:
- Average price is a single blended number across all lots. FIFO assigns cost on a lot-by-lot basis, oldest first.
- For partial sales, average price and FIFO can give very different gain or loss figures. The gap widens when lots were purchased at vastly different prices.
- FIFO determines both the cost basis and the holding period. Average price does neither correctly.
- The Tax P&L report from your broker is better than average price but may still be incomplete if you have shares across multiple brokers.
- For tax-loss harvesting decisions, always evaluate against FIFO lots. A stock that appears to be at a loss on average might actually trigger gains under FIFO because older, cheaper lots are sold first.
- The only reliable way to estimate your tax liability is to maintain a proper FIFO lot register or use a tool like TaxHarvestLab that computes it automatically.
The difference between average and FIFO is not a technicality. It can change your tax bill by thousands or even lakhs of rupees. Understanding this distinction is the first step toward accurate tax planning.
See how this applies to your portfolio
Upload your Zerodha or Groww reports and get personalized recommendations in under 2 minutes.
Analyze My Portfolio FreeFrequently Asked Questions
Why does my Zerodha app show average price instead of FIFO cost?
Zerodha shows the weighted average purchase price in the holdings screen because it is a simpler metric for tracking overall position performance. Computing and displaying lot-by-lot FIFO cost in the app interface would be more complex. However, Zerodha's Tax P&L report (available in Console) does use FIFO matching for tax computation.
Is the total gain different between average and FIFO if I sell all shares?
No. If you sell your entire holding of a stock in a single transaction, the total aggregate gain is the same under both methods. The difference only arises for partial sales, where FIFO assigns cost from the oldest lots first rather than using a blended average.
Can the average price method ever show a loss when FIFO shows a gain?
Yes. If your oldest lots were purchased at a very low price and your recent lots at a high price, the average is pulled up. But FIFO sells the cheap old lots first, resulting in a gain even when the current price is below the average cost. This is a common trap for investors who averaged up on a stock.