What is Cost Basis?
Reviewed by Karthikeyan Anbarasan (Founder, TradeLyser) · Updated 19 Oct 2026 · Editorial policy
FIFO: which shares count as sold
When you buy the same stock more than once and then sell part of the holding, you need to know which shares were sold. For shares held in a demat account, the Income Tax Department’s long-standing position (CBDT Circular 768 of 1998) is first in, first out: the earliest shares bought are treated as the first sold. Broker apps usually show one average price for the whole holding, which is useful for tracking but can give a different gain from the FIFO figure. Confirm the treatment for your own case with a tax professional.
| Lot | Date | Quantity | Price | Cost |
|---|---|---|---|---|
| Buy 1 | 10 Jan 2025 | 100 | ₹1,400 | ₹1,40,000 |
| Buy 2 | 15 Jun 2026 | 100 | ₹1,600 | ₹1,60,000 |
| Sell | 12 Oct 2026 | 120 | ₹1,700 | ₹2,04,000 received |
Illustrative, before charges. Under FIFO, the 120 shares sold are all 100 from Buy 1 and 20 from Buy 2. Buy 1 was held for more than 12 months, so its gain is long-term: (₹1,700 − ₹1,400) × 100 = ₹30,000. The 20 shares from Buy 2 were held for under four months, so their gain is short-term: (₹1,700 − ₹1,600) × 20 = ₹2,000. The 80 shares left carry a cost of ₹1,600 each, ₹1,28,000 in total.
FIFO (lot by lot)
Average price (broker view)
Over the full life of the holding the two methods give the same total gain; they differ in when the gain is recognised and how it is split. The gap grows when the buys are at very different prices or when part of a holding is sold often. In this example, if there were no other long-term gains that year, the ₹30,000 falls inside the ₹1.25 lakh annual exemption, and the ₹2,000 short-term gain is taxed at 20%, ₹400 before surcharge and cess.
What goes into cost basis
| Item | Treatment for capital gains on listed shares |
|---|---|
| Purchase price × quantity | Included |
| Brokerage, exchange charges, GST on them, stamp duty, SEBI fee | Generally added to cost on purchase and deducted from sale value on sale |
| STT | Not deductible when computing capital gains |
| Stock split | Total cost unchanged, spread over more shares; holding period runs from the original purchase |
| Bonus shares | Generally taken at nil cost, with the holding period starting from allotment |
| Shares bought before 1 February 2018 | A grandfathering rule can use the 31 January 2018 market value; check with a tax professional |
Cost basis in a trading journal vs for tax
A trading journal measures each trade against its own entry, which is what you need for R-multiples, win rate and expectancy. If you scale into a position, log each fill so the journal can show both the blended entry and the lot-by-lot picture. If you average down, the new average hides the fact that the first lot is still losing; the lot record keeps that visible.
Tax treatment depends on what the activity is. Delivery investing usually produces capital gains measured from cost basis. Intraday equity trading is speculative business income and F&O is non-speculative business income, both taxed at slab rates, where charges are generally claimed as business expenses rather than added to a cost basis. Keep investing and trading in separately tagged accounts or portfolios so each can be reported correctly.
Reference guide
| Context | Value | Reading |
|---|---|---|
| Lot-level records: date, quantity and price for every buy | Clean records | You can work out FIFO cost, holding period and the tax split for any sale |
| Only the broker app’s average price written down | Incomplete | Fine for tracking a position, but it can differ from the cost used for tax |
| Bonus or split shares entered at the market price | Wrong basis | Adjust the cost per share for the corporate action, or gains are misstated |
Questions
What is cost basis in shares?
The amount you paid for the shares plus acquisition costs such as brokerage and stamp duty. Your gain or loss on sale is measured from it.
How is cost basis calculated for shares in India?
For shares held in demat, gains are generally worked out on a first in, first out basis: the earliest shares bought are treated as sold first. Confirm the method for your case with a tax professional.
Does cost basis include brokerage and STT?
Brokerage, stamp duty and similar transaction costs are generally included. STT is not deductible when computing capital gains on shares.
Why is my broker’s average price different from my tax gain?
The app blends all your buys into one average price. Tax on demat shares generally follows FIFO lot by lot, so the gain on a partial sale, and its long-term or short-term split, can differ.
What happens to cost basis after a bonus issue or split?
After a split, the same total cost is spread over more shares. Bonus shares are generally taken at nil cost with a holding period from allotment, while the original shares keep their cost.