LTCG & Gain Harvesting

How to Calculate LTCG on Shares in India (FIFO Method)

10 min read ยท Updated 22 February 2026

Why FIFO Is Mandatory for LTCG Calculation

When you sell shares of a company that you bought in multiple lots at different times and prices, the Income Tax Act mandates the use of the First-In-First-Out (FIFO) method to determine which shares are being sold. FIFO means the shares you purchased earliest are considered sold first, regardless of your intention.

This is not optional. The Income Tax Act does not allow you to choose specific lots, use the Last-In-First-Out (LIFO) method, or apply average cost for equity shares. FIFO is the only accepted method for computing capital gains on listed equity shares and most other securities.

The FIFO rule has significant implications for your LTCG calculation because it determines both the cost of acquisition and the holding period. Consider an investor who bought 100 shares in January 2024 at Rs 500 and another 100 shares in January 2025 at Rs 700. If they sell 100 shares in February 2026 at Rs 900, FIFO dictates that the January 2024 lot is sold first. The cost basis is Rs 500 per share, the holding period is over 12 months (making it LTCG), and the gain is Rs 400 per share.

If the investor wanted to sell the January 2025 lot instead (Rs 200 gain per share), FIFO does not permit it. Understanding this rule is fundamental to accurate tax calculation and effective tax planning. Every gain harvesting and loss harvesting decision must account for FIFO order.

Basic LTCG Calculation with Single Lot

Let us start with the simplest case: a single purchase lot.

Ankur bought 500 shares of Asian Paints on June 15, 2024, at Rs 3,200 per share. Total cost of acquisition: Rs 16,00,000. He sells all 500 shares on August 20, 2025, at Rs 3,800 per share. Total sale proceeds: Rs 19,00,000.

Step 1: Determine the holding period. Purchase date: June 15, 2024 Sale date: August 20, 2025 Holding period: 14 months and 5 days Since the holding period exceeds 12 months, the gain is long-term.

Step 2: Calculate the gain. Sale price per share: Rs 3,800 Cost of acquisition per share: Rs 3,200 Gain per share: Rs 600 Total LTCG: 500 x Rs 600 = Rs 3,00,000

Step 3: Apply the exemption. LTCG: Rs 3,00,000 Exemption under Section 112A: Rs 1,25,000 Taxable LTCG: Rs 1,75,000

Step 4: Calculate tax. Tax at 12.5%: Rs 1,75,000 x 12.5% = Rs 21,875 Cess at 4%: Rs 875 Total LTCG tax: Rs 22,750

This is straightforward because there is only one lot. The complexity arises when you have multiple purchase lots of the same stock, which is the more common real-world scenario.

FIFO Calculation with Multiple Lots

Now let us work through a multi-lot example that demonstrates FIFO in action.

Sneha made the following purchases of Tata Motors shares: - Lot 1: 200 shares on March 10, 2023, at Rs 420 per share - Lot 2: 150 shares on September 5, 2023, at Rs 580 per share - Lot 3: 300 shares on June 20, 2024, at Rs 750 per share

Total holdings: 650 shares

On March 15, 2026, Sneha sells 300 shares at Rs 850 per share. Under FIFO, the shares sold are from the earliest lots first.

FIFO allocation: - 200 shares from Lot 1 (March 2023, cost Rs 420) - 100 shares from Lot 2 (September 2023, cost Rs 580)

Gain from Lot 1 shares: 200 x (Rs 850 - Rs 420) = 200 x Rs 430 = Rs 86,000 Holding period for Lot 1: March 2023 to March 2026 = 36 months (LTCG)

Gain from Lot 2 shares: 100 x (Rs 850 - Rs 580) = 100 x Rs 270 = Rs 27,000 Holding period for Lot 2: September 2023 to March 2026 = 30 months (LTCG)

Total LTCG: Rs 86,000 + Rs 27,000 = Rs 1,13,000

Since Rs 1,13,000 is below the Rs 1,25,000 exemption, Sneha pays zero LTCG tax.

Remaining holdings after the sale: - 50 shares from Lot 2 (cost Rs 580) - 300 shares from Lot 3 (cost Rs 750)

Notice that Lot 3 was not touched at all because FIFO consumed Lot 1 fully and Lot 2 partially before reaching it.

Handling the Grandfathering Clause

For shares purchased before February 1, 2018, a special grandfathering provision applies. When LTCG tax under Section 112A was introduced in Budget 2018, the government protected gains accrued before the announcement date. The grandfathering clause says that for pre-February 1, 2018 purchases, the cost of acquisition is the higher of the actual purchase price or the fair market value (FMV) as of January 31, 2018.

The FMV is defined as the highest price of the share on the stock exchange on January 31, 2018. If the share was not traded on that date, the FMV is the highest price on the most recent trading day before January 31, 2018.

There is an additional cap: the cost of acquisition cannot exceed the actual sale price. This prevents creating an artificial loss using the grandfathering clause.

Here is the formula: Cost of acquisition = Min(Sale Price, Max(Actual Purchase Price, FMV on Jan 31, 2018))

Example: Deepak bought 1,000 shares of ITC in 2015 at Rs 150 per share. The FMV on January 31, 2018 was Rs 270. He sells in March 2026 at Rs 450.

Step 1: Determine the grandfathered cost. Actual purchase price: Rs 150 FMV on Jan 31, 2018: Rs 270 Higher of the two: Rs 270 Sale price: Rs 450 Cost of acquisition: Min(Rs 450, Rs 270) = Rs 270

Step 2: Calculate LTCG. LTCG per share: Rs 450 - Rs 270 = Rs 180 Total LTCG: 1,000 x Rs 180 = Rs 1,80,000

Without grandfathering, the LTCG would be Rs 3,00,000 (Rs 450 - Rs 150 per share). The grandfathering clause saves Deepak tax on Rs 1,20,000 of gains that accrued before the LTCG tax was introduced.

FIFO with Mixed Short-Term and Long-Term Lots

One of the trickiest aspects of FIFO is when you have multiple lots of the same stock with different holding periods, making some short-term and others long-term. FIFO determines which lot is sold first, and this in turn determines whether the gain is short-term or long-term.

Example: Priyanka holds Bajaj Finance shares purchased in two lots: - Lot 1: 100 shares bought on February 1, 2025, at Rs 6,800 (holding period as of March 2026: 13 months = long-term) - Lot 2: 100 shares bought on August 15, 2025, at Rs 7,200 (holding period as of March 2026: 7 months = short-term)

If Priyanka sells 150 shares on March 20, 2026, at Rs 7,500, FIFO dictates: - First 100 shares come from Lot 1 (February 2025, long-term) - Next 50 shares come from Lot 2 (August 2025, short-term)

LTCG from Lot 1: 100 x (Rs 7,500 - Rs 6,800) = Rs 70,000 STCG from Lot 2: 50 x (Rs 7,500 - Rs 7,200) = Rs 15,000

The LTCG of Rs 70,000 is within the Rs 1,25,000 exemption, so tax on LTCG is zero. The STCG of Rs 15,000 is taxed at 20% = Rs 3,000 plus cess.

Now, if Priyanka could choose to sell Lot 2 first (which FIFO does not allow), her entire gain of Rs 15,000 would be short-term and the Rs 70,000 LTCG would remain unrealized. This shows how FIFO can force a mixed short-term and long-term outcome. Understanding this before you sell is essential for tax planning.

TaxHarvestLab shows you exactly which lots will be consumed under FIFO for any quantity you plan to sell, along with the resulting tax classification for each portion.

Calculating LTCG for Bonus Shares and Stock Splits

Bonus shares and stock splits create additional complexity in LTCG calculations because they change the number of shares and potentially the cost basis.

Bonus shares: When a company issues bonus shares, the cost of acquisition of the bonus shares is zero (Rs 0). However, the holding period for bonus shares starts from the date of allotment, not from the date you bought the original shares. If a company issues 1:1 bonus shares, you receive one new share for every share you hold. The new shares have a cost of Rs 0 and the holding period starts from the bonus allotment date.

Example: Rohit held 100 shares of Company X bought at Rs 500 in January 2024. The company issues 1:1 bonus in June 2024. Rohit now has 200 shares (100 original at Rs 500 cost, 100 bonus at Rs 0 cost). Under FIFO, if he sells 150 shares in March 2026, the first 100 sold are the original shares (cost Rs 500, long-term), and the next 50 are bonus shares (cost Rs 0, long-term since allotted in June 2024, over 12 months ago).

Stock splits: When a company does a stock split, the cost of acquisition per share is adjusted proportionally. If a Rs 1,000 face value share is split into 10 shares of Rs 100, your cost per share becomes one-tenth of the original cost. The holding period does not change; it continues from the original purchase date.

For both bonus shares and stock splits, the FIFO order is maintained based on the allotment or adjustment date. TaxHarvestLab automatically processes corporate actions from your broker data to calculate the correct cost basis and FIFO order after bonus issues and splits.

Practical Tips for Accurate LTCG Calculation

Accurate LTCG calculation requires discipline in record-keeping and a systematic approach. Here are practical tips that every equity investor should follow.

Tip 1: Maintain a lot-level purchase register. For every stock you own, keep a record of each purchase lot with the date, quantity, price per share, and total cost including brokerage. This is your source of truth for FIFO calculations.

Tip 2: Account for brokerage in the cost of acquisition. The purchase price for LTCG purposes is the total cost you paid, which includes brokerage, stamp duty, and other charges. While these amounts are small, they reduce your taxable gain. On a Rs 5,00,000 purchase, brokerage and charges might be Rs 300-500, reducing your LTCG by the same amount.

Tip 3: Track corporate actions. Every time a company issues bonus shares, does a stock split, or undergoes a merger or demerger, update your lot records. These events change the number of shares, cost basis, or both. Failing to account for them leads to incorrect LTCG calculations.

Tip 4: Verify your broker's capital gains statement. Brokers like Zerodha provide a capital gains statement, but it is your responsibility to verify the accuracy. The statement may not correctly handle pre-2018 grandfathering, corporate actions from before you joined the broker, or transfers from other demat accounts.

Tip 5: Use TaxHarvestLab for automated calculations. Manual FIFO calculations become impractical when you have 20 or more stocks with multiple lots each. TaxHarvestLab imports your trade data, applies FIFO, handles grandfathering, adjusts for corporate actions, and calculates your LTCG accurately. It is the fastest way to get a precise picture of your tax liability and plan your harvesting strategy.

See how this applies to your portfolio

Upload your Zerodha or Groww reports and get personalized recommendations in under 2 minutes.

Analyze My Portfolio Free

Frequently Asked Questions

Can I choose which lot to sell instead of using FIFO?

No. Indian tax law mandates the FIFO method for equity shares. You cannot select specific lots for sale. The shares purchased earliest are always deemed sold first. This applies to all listed equity shares and equity mutual fund units.

How does FIFO work when shares are in different demat accounts?

FIFO applies per demat account. If you hold 100 shares of a stock in your Zerodha account and 100 shares in your Groww account, selling from Zerodha only applies FIFO to the lots in that Zerodha account. The Groww lots are not affected. This can be useful for tax planning, though you should not split holdings specifically to circumvent FIFO.

Is the grandfathering clause still applicable in FY 2025-26?

Yes. The grandfathering clause for pre-February 1, 2018 shares continues to apply. If you still hold shares purchased before that date, your cost of acquisition is the higher of the actual purchase price or the FMV on January 31, 2018, subject to the cap that it cannot exceed the sale price. There is no expiry date for this provision.

How do I calculate LTCG on shares received as a gift?

For gifted shares, the cost of acquisition is the cost at which the previous owner (the person who gifted) purchased the shares. The holding period includes the time the giftor held the shares. Apply FIFO based on the giftor's original purchase dates. If the giftor held pre-2018 shares, the grandfathering clause applies using the giftor's cost.

๐Ÿค

Support Our Mission

TaxHarvestLab is free and always will be. Help us keep it that way for 10,000+ Indian investors.

10K+
Active Users
โ‚น0
Ads โ€ข Ever
Contribute Nowโ†’

One-time or monthly, your choice

Ready to optimize your capital gains tax?

TaxHarvestLab analyzes your actual broker data and shows you exactly what to sell โ€” and what to hold โ€” before March 31.

Analyze My Portfolio Free

Free forever. Works with Zerodha and Groww. Takes under 2 minutes.