FIFO & Cost Basis

When Tax-Loss Harvesting Backfires: FIFO Sell-Through Unprofitable Scenarios

10 min read ยท Updated 22 February 2026

The Dangerous Assumption: All Losses Are Worth Harvesting

Tax-loss harvesting sounds like a straightforward win. You sell stocks at a loss, use those losses to offset gains, and pay less tax. What could go wrong?

In India, quite a lot. The mandatory FIFO (First In, First Out) rule means that harvesting a short-term loss often forces the sale of long-term shares first. If those long-term shares have large unrealized gains, the forced LTCG can far exceed the STCL benefit, making the entire exercise a net tax loss.

This article examines the scenario where tax-loss harvesting becomes unprofitable, a situation we call the "FIFO sell-through unprofitable" case. It is based on a real portfolio pattern that is surprisingly common: a large, profitable long-term position with a small, losing short-term addition.

The investor sees the short-term loss and thinks, "I should harvest this." They do not realize that reaching those short-term shares requires selling through a massive long-term position, triggering capital gains tax that dwarfs the loss they were trying to capture.

Recognizing this pattern before acting is the difference between smart tax optimization and an expensive mistake.

The Classic Backfire Scenario: Detailed Example

Here is a detailed example modeled on real portfolio conditions.

You hold shares of Asian Paints: - Lot 1: 200 shares bought at Rs 2,500 on 1 January 2024 (long-term as of January 2025) - Lot 2: 10 shares bought at Rs 3,600 on 15 October 2024 (short-term)

Current market price: Rs 3,400 (as of 15 March 2025)

Lot 1 (LT): Unrealized gain = (3,400 - 2,500) x 200 = Rs 1,80,000 Lot 2 (ST): Unrealized loss = (3,400 - 3,600) x 10 = -Rs 2,000

You see the Rs 2,000 short-term loss and decide to harvest it. To sell 10 ST shares under FIFO, you must sell all 200 LT shares first, then the 10 ST shares. Total sale: 210 shares.

Forced LTCG = Rs 1,80,000. After Rs 1.25 lakh exemption, taxable LTCG = Rs 55,000. Tax at 12.5% = Rs 6,875.

STCL harvested = Rs 2,000. Tax saving at 20% = Rs 400.

Net result: You paid Rs 6,875 in LTCG tax to save Rs 400 in STCG tax. Net loss = Rs 6,475.

You are Rs 6,475 worse off than if you had done nothing. The tax-loss harvesting backfired spectacularly.

Why This Pattern Is So Common

This backfire pattern is common because of how retail investors typically build positions. The usual behaviour is:

  1. Buy a stock based on long-term conviction. Hold it for months or years as the position becomes long-term.
  1. See a dip and buy more. This additional purchase is short-term and at a higher price than the original long-term lots (since the stock has appreciated overall).
  1. The stock recovers partially but not to the recent high. The original long-term lots have large gains. The recent short-term addition has a small loss.
  1. The investor sees the short-term loss and thinks about harvesting. They do not consider the sell-through impact.

This pattern, large long-term gains and small short-term losses in the same stock, is exactly where FIFO sell-through causes maximum damage. The forced LTCG is large because the long-term lots have appreciated significantly. The STCL is small because the recent purchase was a small addition.

The ratio is terrible. You might have Rs 2,00,000 in forced LTCG for Rs 5,000 in STCL. No amount of mathematical gymnastics makes this trade worthwhile.

The lesson is clear: always check the full FIFO lot structure before harvesting. The short-term loss might look attractive in isolation, but the sell-through cost makes it prohibitive.

The Numbers That Signal Danger

How do you quickly assess whether a harvesting opportunity is a trap? Use these danger signals:

Danger Signal 1: The long-term lots outnumber the short-term lots by 10:1 or more. If you have 200 LT shares and 10 ST shares, the sell-through is massive relative to the harvesting target.

Danger Signal 2: The per-share LT gain exceeds the per-share ST loss. In our example, the LT gain is Rs 900 per share while the ST loss is Rs 200 per share. Even the per-share math is unfavourable, and the lot size imbalance makes it worse.

Danger Signal 3: Forced LTCG exceeds the Rs 1.25 lakh exemption. If the forced LTCG is within the exemption, the sell-through costs nothing. But once it crosses Rs 1.25 lakh, you pay 12.5% on the excess.

Danger Signal 4: The STCL is less than Rs 10,000. Small losses rarely justify the complexity and risk of sell-through. The tax saving at 20% is at most Rs 2,000, which can easily be wiped out by even moderate forced LTCG.

Quick rule of thumb: If the forced LTCG above the exemption is more than 1.6 times the STCL, the harvest is unprofitable (since STCL x 20% < excess LTCG x 12.5% requires STCL > 0.625 x excess LTCG).

TaxHarvestLab computes these ratios automatically and flags unprofitable scenarios with clear warnings.

What If You've Already Made the Mistake?

If you have already sold shares and triggered the FIFO sell-through, the LTCG is realized and you cannot undo it. However, you can take steps to mitigate the damage:

Repurchase the shares. Since India does not have a wash sale rule for equity, you can immediately buy back the shares you sold. This resets your cost basis to the current market price. While you cannot undo the realized LTCG, the repurchase means your future gains start from the current, higher price. This is essentially gain harvesting, albeit forced and unplanned.

Offset the LTCG with LTCL. If you have other stocks with long-term losses, you can harvest those losses to offset the forced LTCG. This is a recovery strategy, using one harvest to fix another.

Use the STCL strategically. The short-term loss you harvested can be used to offset short-term capital gains from other stocks during the same financial year. If you do not have STCG to offset, the STCL can be carried forward for up to 8 years and set off against either STCG or LTCG in future years.

Adjust your remaining harvesting plan. If this forced LTCG consumed your Rs 1.25 lakh exemption, recalculate your gain harvesting targets for the rest of the year. There is no point in additional gain harvesting if the exemption is already fully utilized.

The best strategy, of course, is to avoid the mistake in the first place. Run the FIFO analysis before you place the sell order.

Comparison: Profitable vs Unprofitable Sell-Through

ParameterProfitable Sell-ThroughUnprofitable Sell-Through
LT shares100 shares200 shares
LT gain per shareRs 200Rs 900
Total forced LTCGRs 20,000Rs 1,80,000
LTCG above exemptionRs 0 (within Rs 1.25L)Rs 55,000
Tax on forced LTCGRs 0Rs 6,875
ST shares50 shares10 shares
ST loss per shareRs 100Rs 200
Total STCLRs 5,000Rs 2,000
Tax saved from STCLRs 1,000Rs 400
Net benefit+Rs 1,000-Rs 6,475
VerdictProceedDo NOT harvest
This side-by-side comparison illustrates the stark difference between the two scenarios. The profitable case has a small LTCG within the exemption and a meaningful STCL. The unprofitable case has a massive LTCG exceeding the exemption and a tiny STCL. The key differentiator is the forced LTCG relative to the exemption. When it stays within the exemption, the sell-through cost is zero. When it exceeds the exemption, the 12.5% tax on the excess can quickly overwhelm the 20% saving on the STCL.

How TaxHarvestLab Prevents This Mistake

TaxHarvestLab is specifically designed to prevent the FIFO sell-through backfire. When you upload your portfolio, the tool performs the following analysis for every potential harvesting opportunity:

  1. Identify the target lot. For each stock with an unrealized short-term loss, TaxHarvestLab identifies the target lots and computes the harvestable STCL.
  1. Compute sell-through cost. The tool calculates the total forced LTCG from all long-term lots that must be sold before reaching the target short-term lot.
  1. Check against exemption. It evaluates the forced LTCG against your remaining Rs 1.25 lakh LTCG exemption (accounting for any gains already realized during the year).
  1. Calculate net benefit. Tax saved from STCL minus tax incurred from forced LTCG equals the net benefit. If negative, TaxHarvestLab flags the opportunity as unprofitable and does not recommend it.
  1. Explore partial harvesting. In some cases, partial harvesting (selling fewer shares) can turn an unprofitable full harvest into a profitable partial one. TaxHarvestLab uses binary search to find the optimal quantity.

This five-step analysis runs automatically for every stock in your portfolio. The result is a clear recommendation: harvest, partially harvest, or do not harvest, with exact rupee figures for the net tax impact.

No guesswork. No backfires. Just mathematically verified tax optimization.

Key Takeaways: Protect Yourself From the Backfire

Tax-loss harvesting is a powerful strategy, but it must be applied with FIFO awareness. Here are the essential lessons from this article:

  • Not every short-term loss is worth harvesting. The FIFO sell-through cost can exceed the STCL benefit by an order of magnitude.
  • The most dangerous pattern is a large long-term position with a small short-term addition at a higher price. The forced LTCG is massive relative to the small STCL.
  • If the forced LTCG stays within your Rs 1.25 lakh exemption, the sell-through is free and harvesting is beneficial.
  • If the forced LTCG exceeds the exemption, the 12.5% tax on excess LTCG can quickly overwhelm the 20% saving from the STCL. The breakeven requires STCL to be at least 62.5% of the excess LTCG.
  • Always run the full FIFO sell-through analysis before placing a sell order for tax harvesting. A 30-second calculation can save you thousands of rupees.
  • If you have already made the mistake, repurchase immediately to reset cost basis, and look for LTCL elsewhere to offset the forced LTCG.
  • Use TaxHarvestLab to automatically evaluate every harvesting opportunity with full FIFO sell-through analysis. The tool only recommends trades that produce a positive net tax benefit.

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

How can harvesting a loss result in paying more tax?

Under FIFO, harvesting a short-term loss may force the sale of long-term shares with large gains first. If the forced LTCG exceeds the Rs 1.25 lakh exemption, you pay 12.5% tax on the excess. If this tax exceeds the 20% tax saving from the harvested STCL, you end up paying more tax overall.

Is there a quick way to check if a harvest will backfire?

Yes. Calculate the forced LTCG above the Rs 1.25 lakh exemption and the harvestable STCL. If the STCL is less than 62.5% of the excess LTCG, the harvest will result in a net tax loss. Alternatively, use TaxHarvestLab which performs this calculation automatically.

Can I avoid the sell-through by using a different broker?

No. FIFO is mandated by the Income Tax Act and applies across all brokers and demat accounts. Even if you sell through a different broker than where you bought the long-term shares, the FIFO order remains the same. The lot matching is based on purchase chronology, not broker identity.

What if I only harvest part of the short-term loss?

Partial harvesting does not help with the sell-through problem because you still must sell all long-term lots before reaching any short-term lots. However, TaxHarvestLab can find the optimal total sale quantity using binary search, which may reduce the excess LTCG while still capturing some STCL.

๐Ÿค

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.