TL;DR
What FIFO means
Most investors build a holding over time: some shares in April, some more in January, a few more later. Each purchase is a lot, with its own price and its own date.
When you sell only part of the holding, the tax law needs to know which shares left. For shares held in a demat account, the answer is fixed: first-in, first-out (FIFO). The shares that entered your account first are treated as the first to leave.
Why it matters: cost and holding period
FIFO settles two things at once for the shares you sold:
Their cost. Your gain is the sale price minus the price of the oldest lot, not your average price.
Their holding period. The oldest lot's purchase date decides whether the gain is short-term or long-term.
This is why the gain in your broker's tax statement often differs from the profit shown on the app's holdings screen. The app usually shows your average cost. The tax calculation uses FIFO.
A worked example
Example
Example
Ananya sells 150 of her 200 shares.
Ananya bought 100 shares at ₹200 on 5th Apr 2025 and another 100 at ₹300 on 10th Jan 2026. She sells 150 shares at ₹400 on 20th May 2026.
First 100 shares come from the April 2025 lot: (₹400 − ₹200) × 100 = ₹20,000, long-term, held over 12 months
Next 50 shares come from the January 2026 lot: (₹400 − ₹300) × 50 = ₹5,000, short-term
She still holds 50 shares, with a cost of ₹300 each and a purchase date of 10th Jan 2026.
On an average cost of ₹250, the profit would look like ₹22,500. Under FIFO it is ₹25,000, split across two kinds of gain that are taxed at different rates.
FIFO runs account by account
FIFO is applied separately to each demat account. If you hold the same share in two demat accounts, a sale from one account uses only the lots in that account. The lots in the other account are untouched.
The order of the queue follows the date the shares entered the account. Shares you bought, received as a gift or moved in from another account join the queue on the day they are credited.
Their cost and holding period do not reset. A transferred lot keeps its original purchase date and price, and a gifted lot takes the previous owner's.
Some investors keep long-term holdings in one demat account and shorter-term buys in another. Because FIFO works account by account, a sale in one does not disturb the older lots in the other.
Did you know?
How it works for mutual funds and SIPs
Fund houses apply the same idea to mutual fund units, folio by folio. Every instalment of a systematic investment plan (SIP) is a separate lot with its own date and price.
So when you redeem part of a SIP holding, the units from your earliest instalments go first. Older units may already be long-term while units from the last few months are still short-term, and one redemption can produce both kinds of gain.
What to check in your statements
Your broker's tax profit and loss statement and your fund's capital gains statement already apply FIFO. Before you file, check three things:
Each sale is matched to a purchase date and price.
Shares transferred in from another account or received as a gift show the right date and cost.
The split between short-term and long-term gains matches the dates.
If you plan to sell part of a holding, look at the oldest lot first. Its date and price decide your tax on that sale.
Key takeaways
You cannot pick which lot to sell. The oldest lot in the account always goes first.
One sale can be part long-term and part short-term.
FIFO runs separately in each demat account and each mutual fund folio.
General information, not tax advice. Rules change, so check with a CA before you act.