What Is the FIFO Method and Why Does India Mandate It?
When you sell shares of a stock, a fundamental question arises: which shares did you sell? If you bought Infosys shares on five different dates at five different prices, and you sell some of them today, which purchase lot should be matched against the sale?
India's Income Tax Act answers this question with a clear rule: First In, First Out. The shares you purchased earliest are deemed to be sold first, regardless of which specific shares you intended to sell. This is not optional. Unlike some countries where investors can choose between FIFO, LIFO (Last In, First Out), or specific identification, Indian tax law mandates FIFO for all equity transactions.
The FIFO method has three critical implications for your tax liability. First, it determines your holding period, which decides whether a gain is classified as short-term or long-term. Second, it establishes your cost basis, which is the purchase price subtracted from the sale price to calculate gain or loss. Third, it determines the applicable tax rate, since short-term capital gains on listed equity are taxed at 20% while long-term capital gains above Rs 1.25 lakh are taxed at 12.5%.
Understanding FIFO is not merely academic. A single misidentification of which lot was sold can swing your tax calculation by tens of thousands of rupees.
How FIFO Works: A Simple Walkthrough
Imagine you built a position in Tata Motors over three separate purchases:
- 1 March 2023: Bought 100 shares at Rs 400
- 15 August 2023: Bought 50 shares at Rs 450
- 10 February 2024: Bought 75 shares at Rs 500
Your total holding is 225 shares. Now suppose you sell 120 shares on 15 March 2025 at Rs 550 each.
Under FIFO, the 120 shares sold are matched as follows. The first 100 shares come from the 1 March 2023 lot, purchased at Rs 400. The remaining 20 shares come from the 15 August 2023 lot, purchased at Rs 450.
For the first 100 shares, the holding period is over 12 months (March 2023 to March 2025), so the gain is long-term. Cost basis is Rs 400, sale price is Rs 550, so LTCG per share is Rs 150, total LTCG is Rs 15,000.
For the next 20 shares, the holding period is also over 12 months (August 2023 to March 2025), so this is also LTCG. Cost basis is Rs 450, gain per share is Rs 100, total LTCG is Rs 2,000.
Total LTCG from this sale is Rs 17,000. After applying the Rs 1.25 lakh exemption (if not used elsewhere), the tax could be zero. But if your exemption is already consumed, tax at 12.5% would be Rs 2,125.
FIFO and the Holding Period: Short-Term vs Long-Term
The holding period is perhaps the most consequential outcome of the FIFO method. For listed equity shares, a holding period exceeding 12 months qualifies the gain as long-term. Anything 12 months or less is short-term.
This distinction matters enormously because of the tax rate differential. Short-term capital gains on listed shares are taxed at 20%, while long-term gains are taxed at 12.5% but only above the Rs 1.25 lakh annual exemption threshold. In many cases, LTCG may be entirely tax-free.
Here is where FIFO creates surprising outcomes. Suppose you hold 200 shares of HDFC Bank. You bought 100 shares 14 months ago and 100 shares 2 months ago. You want to sell 100 shares. You might think you are selling the recent lot (short-term), but FIFO mandates that the older lot (long-term) is sold first.
This can work in your favour or against you. If you have unrealized short-term losses you want to harvest, FIFO forces you to sell through the long-term lots first before reaching the short-term lots. This sell-through effect is one of the most misunderstood aspects of Indian capital gains taxation and is covered in detail in our article on FIFO sell-through.
The key takeaway is that you cannot cherry-pick which lot to sell. The holding period is always determined by the purchase date of the oldest unsold shares.
FIFO Cost Basis: Why Your Purchase Price Matters
The cost basis under FIFO is simply the purchase price of the shares identified by the FIFO method. But when you have accumulated shares across multiple purchases at different prices, the cost basis for a single sale can span multiple lots, each with a different cost per share.
Consider this scenario. You purchased shares of Reliance Industries as follows:
- Lot A: 50 shares at Rs 2,000 (bought January 2023)
- Lot B: 100 shares at Rs 2,400 (bought July 2023)
- Lot C: 80 shares at Rs 2,200 (bought March 2024)
You sell 130 shares at Rs 2,600 in April 2025. Under FIFO, the cost basis is calculated across lots:
- First 50 shares from Lot A at Rs 2,000 each: cost = Rs 1,00,000
- Next 80 shares from Lot B at Rs 2,400 each: cost = Rs 1,92,000
- Total cost basis for 130 shares = Rs 2,92,000
Sale proceeds = 130 x Rs 2,600 = Rs 3,38,000. Capital gain = Rs 46,000. Both lots are long-term, so this entire gain is LTCG and falls within the Rs 1.25 lakh exemption.
Note that Lot B still has 20 shares remaining. These will be the first to be sold in any future transaction. This running ledger of remaining lots is what TaxHarvestLab tracks automatically when you upload your trade history.
Common Mistakes When Applying FIFO
The most frequent mistake investors make is confusing the average price displayed by their broker with the FIFO cost basis. Brokers like Zerodha, Groww, and Angel One show a weighted average purchase price in your holdings dashboard. This average is useful for tracking your overall position, but it has no relevance for tax computation. Tax must always be calculated on a FIFO lot-by-lot basis.
A second common error is ignoring corporate actions. If a stock has undergone a split, bonus issue, or rights issue, the FIFO order must reflect the adjusted lots. Bonus shares, for instance, enter the FIFO queue at zero cost on the date of allotment, not the date of the original purchase.
A third mistake is not accounting for delivery-based versus intraday trades. Intraday trades do not create a holding and are treated as business income, not capital gains. Only delivery-based trades create lots that enter the FIFO queue.
Finally, some investors assume FIFO applies per broker. It does not. FIFO applies per stock across your entire portfolio, regardless of which broker or demat account holds the shares. If you bought 100 shares of TCS through Zerodha and 100 shares through Groww, and you sell 150 shares from Zerodha, the FIFO cost basis must consider all 200 shares chronologically. In practice, matching across brokers can be complex, which is why having a unified view of your portfolio is essential.
FIFO in Practice: What Your Broker Does vs What You Should Do
Your broker executes your sell order and generates a contract note. The contract note shows the sale price and quantity but does not specify which FIFO lot was sold. That matching is your responsibility when filing your income tax return, specifically while filling out Schedule CG (Capital Gains).
Zerodha provides a Tax P&L report that attempts FIFO matching within its own platform. This report is helpful, but it has limitations. It only covers trades executed through Zerodha. If you transferred shares in from another demat account or broker, the cost basis may be missing or incorrect. The Tax P&L also does not optimize for tax-loss harvesting opportunities.
What you should do is maintain a share lot register, a running log of all purchase lots for each stock, sorted by date. Each time you sell, match the sale against the oldest lot first. Deduct the sold quantity from that lot. If the sold quantity exceeds the lot, move to the next lot. Continue until the entire sale quantity is accounted for.
TaxHarvestLab automates this entire process. When you upload your Zerodha tradebook CSV, the tool reconstructs your complete FIFO lot register, correctly handles partial lot consumption, and computes both realized and unrealizable gains on a per-lot basis.
FIFO and Tax-Loss Harvesting: The Strategic Connection
Understanding FIFO is critical if you want to practice tax-loss harvesting. Tax-loss harvesting involves deliberately selling stocks at a loss to offset capital gains and reduce your tax bill. But FIFO determines which lot's cost basis applies, which directly affects whether a sale results in a gain or a loss.
For instance, suppose you hold a stock with two lots. Lot 1 was bought at Rs 500 (long-term) and Lot 2 at Rs 800 (short-term). The current price is Rs 700. If you wanted to harvest the short-term loss (bought at Rs 800, selling at Rs 700, loss of Rs 100 per share), you cannot do so without first selling through Lot 1, which has an unrealized gain of Rs 200 per share.
This FIFO sell-through effect means that harvesting a short-term loss often triggers a long-term capital gain. Whether the overall trade is beneficial depends on the size of each lot, the magnitude of the gains and losses, and your remaining Rs 1.25 lakh LTCG exemption.
This is exactly the kind of multi-variable optimization that TaxHarvestLab performs. It evaluates whether harvesting a particular loss is truly tax-efficient after accounting for all FIFO sell-through effects. In some cases, it recommends partial harvesting, selling only enough shares to achieve the desired offset without triggering excessive forced gains.
Key Takeaways: FIFO Is the Foundation of Tax Calculations
The FIFO method is not just a rule; it is the foundation upon which all capital gains calculations rest in India. Every decision about tax-loss harvesting, gain harvesting, and year-end tax planning depends on correctly applying FIFO.
Here are the essential points to remember:
- FIFO is mandatory for all listed equity in India. You cannot choose another method.
- The oldest unsold shares are always deemed sold first, determining both holding period and cost basis.
- Average purchase price shown by brokers is for display purposes only. It has no role in tax computation.
- FIFO applies across all demat accounts and brokers for the same stock.
- Corporate actions such as splits, bonuses, and rights issues alter the FIFO lot queue and must be accounted for.
- Tax-loss harvesting strategies must factor in FIFO sell-through effects, where selling short-term shares forces the sale of long-term shares first.
If you hold stocks across multiple purchase dates, understanding FIFO is essential to accurately estimating your tax liability. Tools like TaxHarvestLab compute FIFO automatically, but knowing the logic helps you make better trading and tax planning decisions throughout the year.
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
Is FIFO mandatory for calculating capital gains on stocks in India?
Yes, the Income Tax Act mandates the FIFO (First In, First Out) method for computing capital gains on shares and securities in India. You cannot choose LIFO, specific identification, or any other method. The shares purchased earliest are always treated as sold first.
Does FIFO apply separately for each broker or across all accounts?
FIFO applies per stock across your entire portfolio, regardless of which broker or demat account holds the shares. If you hold the same stock in Zerodha and Groww accounts, the FIFO queue considers all purchases chronologically from both accounts.
Can I use average cost instead of FIFO for tax calculation?
No. The average cost displayed by your broker is for portfolio tracking purposes only. For income tax computation, you must use the FIFO method to determine cost basis and holding period for each lot sold. Using average cost would result in incorrect tax computation.
How does FIFO affect tax-loss harvesting decisions?
FIFO directly impacts tax-loss harvesting because you must sell the oldest lots first. If you want to harvest a loss on recently purchased shares, you may be forced to sell through older lots that have gains first. This sell-through effect can make some harvesting strategies unprofitable.