Personal Finance for India Module 9 – Tax on investments, side income and foreign assets
Tax on interest, dividends and capital gains
How interest, dividends and capital gains are taxed in Tax Year 2026-27: slab and special rates, holding periods, indexation, losses and records.
What you will learn
- Classify a sale as a short-term or a long-term capital gain from what was held and for how long
- Calculate the tax on interest, dividends and gains on shares, equity funds and debt funds in the new regime
- Apply the set-off and carry-forward rules to a year's capital losses
- Record each sale lot by lot with the dates, cost, sale value and expenses a capital-gains schedule needs
Before you start
What you’ll learn · Before you start
What you will learn
- Classify a sale as a short-term or a long-term capital gain from what was held and for how long
- Calculate the tax on interest, dividends and gains on shares, equity funds and debt funds in the new regime
- Apply the set-off and carry-forward rules to a year's capital losses
- Record each sale lot by lot with the dates, cost, sale value and expenses a capital-gains schedule needs
Before you start
On this page
Rahul’s salary of ₹8,75,000 pays no income tax in the new regime, yet the ₹3,00,000 he gained on equity fund units held for eight months costs him ₹62,400. Sold five months later, after more than a year of holding, the same gain would have cost ₹22,750, and his colleague Dev pays ₹52,000 in a year whose only extra is a ₹1,00,000 gain that is itself untaxed.
Below you will see where interest, dividends and gains go in a return, how the holding period sets the term of a gain, what the 20 % and 12.5 % rates and the indexation left for old land and buildings do, how losses are set off and carried forward, and the records a capital-gains schedule needs. It is education only: the people and amounts are invented, every rule is cited from the Income-tax Act, 2025 and the Finance Act, 2026 for Tax Year 2026-27, and nothing here is advice on your own return.
Interest and dividends join the rest of your income at the slab rates
Interest on a fixed deposit, a savings account or a bond, and dividends from shares and mutual funds, are taxed under the head “Income from other sources” (section 92). They have no rate of their own: they are added to salary and the rest of total income, and the slab rates of section 202(1) decide what they cost. Gains on selling an investment take a different road. Step through four receipts of one year:
The drawing shows the whole scene; its 7 steps are listed below.
Every step as text
- Interest. Interest on a fixed deposit, a savings account or a bond is income from other sources (section 92). It has no rate of its own, and the new regime allows no deduction for it.
- Dividends. Dividends are named in section 92(2)(a) and join the same head. From Tax Year 2026-27 nothing may be deducted from them, not even interest on money borrowed to buy the shares (section 93(2)).
- The slab rates. Income from other sources is added to salary and the rest of total income and taxed at the slab rates of section 202(1), so the same ₹48,000 can cost nothing in one year and more than half of itself in another.
- A gain on equity. A gain on listed shares or equity-fund units sold with securities transaction tax goes to the head Capital gains (section 67), not to other sources.
- Its own rates. Those gains pay 20 % when short-term (section 196) and 12.5 % above ₹1,25,000 a year when long-term (section 198), whatever the slab of the rest of the income.
- Gold or a flat. A gain on gold, a flat or shares listed only abroad goes to Capital gains too. Held long enough to be long-term, it pays 12.5 % (section 197).
- Short-term, back to the slabs. A short-term gain on any asset outside section 196 has no rate of its own. It is added to the slab income, exactly like the interest at the top.
Because interest sits on top of everything else, the same rupee of it costs different people different amounts. The program adds ₹48,000 of deposit interest to four levels of other income in the new regime:
"""What ₹48,000 of deposit interest adds to the year's tax at four levels of other income, Tax Year 2026-27.
Interest is income from other sources (section 92 of the Income-tax Act, 2025), so it is added to the rest of total
income and taxed at the slab rates of the new regime (section 202(1)). The rebate of section 156(2) cancels the slab
tax up to ₹60,000 while total income is ₹12 lakh or less, and above that line it keeps the tax from exceeding the
income above ₹12 lakh. Cess of 4 % (Finance Act, 2026) and the rounding of section 516 follow. The incomes are
invented and stand for salary after the standard deduction; nobody here pays surcharge.
"""
from decimal import ROUND_HALF_UP, Decimal
D = Decimal
NEW = [(400000, "0"), (800000, "0.05"), (1200000, "0.10"), (1600000, "0.15"), (2000000, "0.20"), (2400000, "0.25"), (None, "0.30")]
INTEREST = D(48000)
def inr(amount):
"""Whole rupees with Indian digit grouping: 1101090 -> "₹11,01,090"."""
whole = str(D(amount).quantize(D(1), rounding=ROUND_HALF_UP))
head, tail = whole[:-3], whole[-3:]
groups = []
while len(head) > 2:
groups.insert(0, head[-2:])
head = head[:-2]
if head:
groups.insert(0, head)
return "₹" + ",".join(groups + [tail]) if groups else "₹" + tail
def round_516(amount):
"""Section 516: drop the paise, then round to the nearest ₹10 (a last digit of 5 or more rounds up)."""
rupees = int(amount)
return D(rupees - rupees % 10 + (10 if rupees % 10 >= 5 else 0))
def slab_tax(income):
tax, lower = D(0), D(0)
for upper, rate in NEW:
top = income if upper is None else min(income, D(upper))
if top > lower:
tax += (top - lower) * D(rate)
if upper is None or income <= upper:
break
lower = D(upper)
return tax
def year_tax(income):
"""New-regime tax on a total income taxed wholly at the slab rates, with the rebate and its marginal relief."""
income = round_516(income)
tax = slab_tax(income)
if income <= 1200000:
tax -= min(tax, D(60000))
elif tax > income - 1200000:
tax = income - 1200000
return round_516(tax * D("1.04"))
print(f"Tax on the year with and without {inr(INTEREST)} of interest (new regime)")
print(f"{'Other income':>13}{'Tax without':>13}{'Tax with':>11}{'Added':>9}{'Share':>8}")
for other in (600000, 1180000, 1400000, 2200000):
without = year_tax(D(other))
with_interest = year_tax(D(other) + INTEREST)
added = with_interest - without
share = (added / INTEREST * 100).quantize(D("0.1"), rounding=ROUND_HALF_UP)
print(f"{inr(other):>13}{inr(without):>13}{inr(with_interest):>11}{inr(added):>9}{share:>7}%") Output
Tax on the year with and without ₹48,000 of interest (new regime)
Other income Tax without Tax with Added Share
₹6,00,000 ₹0 ₹0 ₹0 0.0%
₹11,80,000 ₹0 ₹29,120 ₹29,120 60.7%
₹14,00,000 ₹93,600 ₹1,01,090 ₹7,490 15.6%
₹22,00,000 ₹2,60,000 ₹2,72,480 ₹12,480 26.0%
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 interest_slab.py
At ₹6,00,000 the interest costs nothing: total income stays under ₹12 lakh, and the rebate of section 156(2) cancels the slab tax. At ₹14,00,000 it costs ₹7,490, the 15 % slab plus cess, and at ₹22,00,000 it costs ₹12,480 at 25 %. The odd row is ₹11,80,000. The interest carries total income to ₹12,28,000, just past the rebate’s line, and marginal relief lets the tax rise only to the ₹28,000 above the line, plus cess: ₹48,000 of interest costs ₹29,120, 60.7 % of itself.
Taking the TDS as the tax
Wrong: “the bank deducted 10 %, so my interest is settled”. Right: TDS is tax paid early, not the tax. A bank deducts 10 % once its interest to you passes ₹50,000 in the year (₹1,00,000 for a senior citizen), and a company or a fund deducts 10 % once its dividends or income distributions to you pass ₹10,000 (section 393). The income is still taxed at your own slab rate, and whatever that leaves above the TDS is yours to pay.
Two more rules apply to this income. The old regime deducts up to ₹10,000 of savings-account interest, or ₹50,000 of any deposit interest for a senior citizen (section 153); the new regime allows neither (section 202(2)). And from Tax Year 2026-27 nothing may be deducted from dividends or from income on mutual fund units, not even interest on money borrowed to buy them (section 93(2), as substituted by the Finance Act, 2026).
Checkpoint
Check: Interest and dividends at the slab rates
The holding period decides whether a gain is short or long term
Section 2(101) sorts every capital asset by how long it was held before the sale. Held for not more than 24 months, an asset is a short-term capital asset: An asset held for not more than 24 months before its transfer, or 12 months for listed securities, equity-oriented fund units, UTI units and zero-coupon bonds. Its gain is a short-term capital gain; held longer, the gain is long-term. and its gain is short-term; held longer, it is long-term. For a security listed on a recognised stock exchange in India, a unit of an equity-oriented fund: A mutual fund scheme that keeps at least 65 % of its money in shares of domestic listed companies, or 90 % in units of a traded fund that does so. Its units sold with securities transaction tax are taxed like listed shares. or of the Unit Trust of India, and a zero-coupon bond, the period is 12 months instead. Step through the questions in the order the law asks them:
The drawing shows the whole scene; its 6 steps are listed below.
Every step as text
- Start from the sale. Every gain starts from what was sold, when each lot was bought and when it was sold. For shares and units in a demat account, the lots sold are the earliest ones still held (section 67(7)(c)).
- Debt funds and bonds first. Section 76 makes the gain short-term, whatever the holding, on unlisted bonds, and on units of a fund that keeps more than 65 % of its money in debt if the units were bought in 2023-24 or a later financial year.
- Twelve months or twenty-four. A security listed on a recognised stock exchange in India, a unit of an equity-oriented fund or of the Unit Trust of India, and a zero-coupon bond are long-term after 12 months. Every other asset needs 24 (section 2(101)).
- Count the months. Not more than the period is short-term. Listed shares held exactly 12 months are still short-term; one day more and they are long-term.
- Shares listed abroad. Shares listed only on a foreign exchange are not listed in India, so they need more than 24 months. Held 20 months, they give a short-term gain taxed at the slab rates.
- The term decides the rate. A long-term gain on equity sold with STT pays 12.5 % above ₹1,25,000, any other long-term gain 12.5 %; a short-term gain on equity sold with STT pays 20 %, and any other short-term gain the slab rates.
Two rules override the clock. Section 76 makes every gain short-term, however long the holding, on unlisted bonds and on units of a fund that keeps more than 65 % of its money in debt and money-market instruments, if the units were bought in 2023-24 or a later financial year. And for shares and units in a demat account, the units sold are matched with the earliest purchases still held, first in, first out (FIFO): The order in which securities held in a demat account count as sold: the earliest purchases still held go first, which fixes the cost and the holding period of every lot in a sale. (section 67(7)(c)), so one sale can hold lots of both terms. The program classifies eight sales:
"""Eight invented sales in Tax Year 2026-27: short-term or long-term, and the rate that follows.
Income-tax Act, 2025: a capital asset held for not more than 24 months before its transfer is short-term, and for
not more than 12 months if it is a security listed on a recognised stock exchange in India, a unit of an
equity-oriented fund, a unit of the Unit Trust of India or a zero-coupon bond (section 2(101)). Section 76 makes the
gain short-term whatever the holding on unlisted bonds, and on units of a fund keeping more than 65 % of its money in
debt and money-market instruments when they were bought in 2023-24 or a later financial year. Short-term gains on
listed shares and equity-fund units sold with STT pay 20 % (section 196), long-term ones 12.5 % above ₹1,25,000 a
year (section 198); other long-term gains pay 12.5 % (section 197), with the indexation option for land and buildings
bought before the cut-off of section 197(3); other short-term gains are added to income at the slab rates.
"""
# (holding, what it is, months held, days beyond those months)
HOLDINGS = [
("Listed shares, STT paid", "equity", 12, 0),
("Listed shares, STT paid", "equity", 12, 1),
("Equity fund units", "equity", 8, 10),
("Debt fund units, 2024-25", "debt-new", 30, 0),
("Gold ETF units", "listed", 15, 0),
("Gold jewellery", "other", 30, 0),
("Shares listed only abroad", "other", 20, 0),
("Flat bought in 2018-19", "land", 90, 0),
]
LIMIT = {"equity": 12, "listed": 12, "other": 24, "land": 24}
def classify(kind, months, days):
"""The term of the gain, and the rate that applies to it."""
if kind == "debt-new":
return "short", "slab rates (section 76)"
limit = LIMIT[kind]
long_term = months > limit or (months == limit and days > 0)
if kind == "equity":
return ("long", "12.5 % above ₹1.25 lakh (198)") if long_term else ("short", "20 % (196)")
if not long_term:
return "short", "slab rates"
if kind == "land":
return "long", "12.5 %, or 20 % indexed (197)"
return "long", "12.5 % (197)"
print(f"{'Holding':<26}{'Held':>9} {'Long after':<14}{'Term':<6} Taxed at")
for name, kind, months, days in HOLDINGS:
term, rate = classify(kind, months, days)
held = f"{months} m {days} d"
after = "always short" if kind == "debt-new" else f"{LIMIT[kind]} months"
print(f"{name:<26}{held:>9} {after:<14}{term:<6} {rate}") Output
Holding Held Long after Term Taxed at Listed shares, STT paid 12 m 0 d 12 months short 20 % (196) Listed shares, STT paid 12 m 1 d 12 months long 12.5 % above ₹1.25 lakh (198) Equity fund units 8 m 10 d 12 months short 20 % (196) Debt fund units, 2024-25 30 m 0 d always short short slab rates (section 76) Gold ETF units 15 m 0 d 12 months long 12.5 % (197) Gold jewellery 30 m 0 d 24 months long 12.5 % (197) Shares listed only abroad 20 m 0 d 24 months short slab rates Flat bought in 2018-19 90 m 0 d 24 months long 12.5 %, or 20 % indexed (197)
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 short_or_long.py
Read the first two rows together: listed shares held 12 months and no days are short-term, because “not more than twelve months” includes the twelfth month, and one day later they are long-term. Shares listed only on a foreign exchange are not listed in India, so 20 months leaves them short-term. The debt fund units are short-term after 30 months, because section 76 ignores the clock.
Checkpoint
Check: Short term or long term
Gains on shares and equity funds have rates of their own, outside the rebate
A capital gain: The profit on transferring a capital asset such as shares, fund units, gold or a flat: the sale value less the expenses of the sale and the cost. It is taxed under the head Capital gains in the year of the transfer. is the sale value less the expenses of the sale and the cost (section 72(1)), and securities transaction tax is not one of those expenses (section 72(3)(b)). For an equity share, a unit of an equity-oriented fund or a unit of a business trust sold with securities transaction tax (STT): A tax on trades in shares, equity-oriented fund units and derivatives on an Indian stock exchange, charged as a share of the trade's value. From 2026-27 it is 0.15 % of the premium on the sale of an option. More in “Trading, F&O and crypto: what the data shows”, two sections set the rates. A short-term gain pays 20 % (section 196). A long-term gain pays 12.5 % on the year’s such gains above ₹1,25,000 (section 198), so ₹2,00,000 of them pays 12.5 % of ₹75,000, ₹9,375, and ₹9,750 with the 4 % cess. For a share, section 198 also needs STT paid when it was bought, except on the kinds of purchase the government notifies (section 198(5)).
Three more rules decide what those rates cost a real person, and the program shows each one:
"""The tax on gains from listed shares and equity-fund units sold with STT, Tax Year 2026-27, new regime.
Income-tax Act, 2025: short-term gains pay 20 % (section 196); long-term gains pay 12.5 % on the year's such gains
above ₹1,25,000 (section 198); the rest of total income pays the slab rates of section 202(1). A resident whose other
income is below the ₹4,00,000 that is not chargeable may use the shortfall against the gains first (sections 196(2)
and 198(3)). The rebate of section 156(2) applies while total income, gains included, is ₹12 lakh or less, and above
that line only as marginal relief; it never covers more than the slab-rate tax (sections 156(3) and 198(7)). Cess of
4 % (Finance Act, 2026), rounding of section 516, no surcharge. The people and amounts are invented.
"""
from decimal import ROUND_HALF_UP, Decimal
D = Decimal
NEW = [(400000, "0"), (800000, "0.05"), (1200000, "0.10"), (1600000, "0.15"), (2000000, "0.20"), (2400000, "0.25"), (None, "0.30")]
def inr(amount):
"""Whole rupees with Indian digit grouping: 62400 -> "₹62,400"."""
whole = str(D(amount).quantize(D(1), rounding=ROUND_HALF_UP))
head, tail = whole[:-3], whole[-3:]
groups = []
while len(head) > 2:
groups.insert(0, head[-2:])
head = head[:-2]
if head:
groups.insert(0, head)
return "₹" + ",".join(groups + [tail]) if groups else "₹" + tail
def round_516(amount):
"""Section 516: drop the paise, then round to the nearest ₹10 (a last digit of 5 or more rounds up)."""
rupees = int(amount)
return D(rupees - rupees % 10 + (10 if rupees % 10 >= 5 else 0))
def slab_tax(income):
tax, lower = D(0), D(0)
for upper, rate in NEW:
top = income if upper is None else min(income, D(upper))
if top > lower:
tax += (top - lower) * D(rate)
if upper is None or income <= upper:
break
lower = D(upper)
return tax
def year_tax(other, stcg=0, ltcg=0):
"""Tax for the year on `other` income at the slab rates plus equity gains, after the rebate, with cess."""
other, stcg, ltcg = D(other), D(stcg), D(ltcg)
total = round_516(other + stcg + ltcg)
shortfall = max(D(0), D(400000) - other)
used = min(shortfall, stcg)
stcg_taxed, ltcg_taxed = stcg - used, max(D(0), ltcg - (shortfall - used))
slab = slab_tax(other)
special = stcg_taxed * D("0.20") + max(D(0), ltcg_taxed - 125000) * D("0.125")
tax = slab + special
if total <= 1200000:
rebate = min(D(60000), slab)
else:
rebate = min(max(D(0), tax - (total - 1200000)), slab)
return round_516((tax - rebate) * D("1.04"))
CASES = [
("Rahul: salary ₹8,75,000, short-term gain", 800000, 300000, 0),
("Rahul: the same gain, held 13 months", 800000, 0, 300000),
("Rahul: the same salary, a smaller long-term gain", 800000, 0, 200000),
("Sana: no other income, short-term gain", 0, 500000, 0),
("Dev: ₹11,50,000 of other income, long-term gain", 1150000, 0, 100000),
]
for name, other, stcg, ltcg in CASES:
gain = stcg or ltcg
kind = "short-term" if stcg else "long-term"
before, after = year_tax(other), year_tax(other, stcg, ltcg)
print(name)
print(f" {inr(gain)} {kind}: tax for the year {inr(before)} without the sale, {inr(after)} with it") Output
Rahul: salary ₹8,75,000, short-term gain ₹3,00,000 short-term: tax for the year ₹0 without the sale, ₹62,400 with it Rahul: the same gain, held 13 months ₹3,00,000 long-term: tax for the year ₹0 without the sale, ₹22,750 with it Rahul: the same salary, a smaller long-term gain ₹2,00,000 long-term: tax for the year ₹0 without the sale, ₹9,750 with it Sana: no other income, short-term gain ₹5,00,000 short-term: tax for the year ₹0 without the sale, ₹20,800 with it Dev: ₹11,50,000 of other income, long-term gain ₹1,00,000 long-term: tax for the year ₹0 without the sale, ₹52,000 with it
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 equity_gains.py
- The rebate never covers these rates. Section 156(3) limits the rebate to the tax at the slab rates, and section 198(7) repeats it for long-term gains. Rahul’s ₹20,000 of slab tax on his salary is cancelled, but not his ₹60,000 at 20 %: ₹62,400 with cess. Held 13 months, the same gain pays 12.5 % on ₹1,75,000, ₹22,750 with cess.
- An unused slab-free amount goes to the gains. A resident whose other income is below the ₹4,00,000 not chargeable in the new regime sets the shortfall against the gains (sections 196(2) and 198(3)). Sana, a student with no other income, pays 20 % on only ₹1,00,000 of her ₹5,00,000 gain: ₹20,800.
- The gain counts towards the ₹12 lakh line. Total income includes every gain, even the part section 198 taxes at nothing. Dev’s ₹11,50,000 of other income pays no tax alone; a ₹1,00,000 long-term gain, untaxed itself, lifts total income to ₹12,50,000, ends the rebate and leaves ₹52,000 to pay after marginal relief.
Chapter VIII deductions cannot reduce these gains either (sections 196(4) and 198(6)), which matters to someone in the old regime with large deductions and a small salary.
Key idea
Gains on equity sold with STT pay 20 % or 12.5 % whatever your slab, the rebate never reaches that tax, and the gain still counts towards the ₹12 lakh line that decides the rebate on everything else.
Checkpoint
Check: The equity rates and the rebate
Gains on other assets, and the indexation left for old land and buildings
Gains on everything else are taxed by their term alone: gold and jewellery, a flat or a plot, shares of an unlisted company or of a company listed only abroad, and units of funds that are neither equity-oriented nor caught by section 76, such as gold ETFs. Long-term, the gain pays 12.5 % under section 197, with no yearly ₹1,25,000; short-term, it is added to the slab income. Sovereign Gold Bonds have their own rule: from Tax Year 2026-27, redemption is not a transfer, and so gives no gain, only for an individual who subscribed to the bond when it was issued and kept it to the end of its term (section 70(1)(x), as substituted by section 43 of the Finance Act, 2026).
Land and buildings keep one more choice. For a resident individual or Hindu undivided family selling land or a building acquired before the cut-off day of section 197(3), 23 July of the financial year 2024-25, the excess of the tax over 20 % of the gain worked out with indexation: Raising the cost of an asset by the ratio of the Cost Inflation Index of the year of sale to that of the year of purchase, so that only the gain beyond inflation counts. It survives as an option on land and buildings bought before the cut-off of section 197(3). is ignored, so the lower of the two is paid. The indexed cost is the cost multiplied by the Cost Inflation Index (CII): An index the Central Government notifies for each financial year, having regard to 75 % of the rise in urban consumer prices, to index the cost of an asset; it is 384 for 2026-27. of the year of sale and divided by the index of the year of purchase (section 72(8)). The index for 2026-27 is 384 (notification S.O. 3889(E)), and the ITR-2 utility’s table gives 280 for 2018-19 and 317 for 2021-22. The program prices two invented flats both ways:
"""Two invented flats sold in Tax Year 2026-27: 12.5 % without indexation, or 20 % with it, whichever is lower.
Income-tax Act, 2025: a long-term gain pays 12.5 % (section 197(1)). For a resident individual selling land or a
building bought before the cut-off of section 197(3), the tax above what 20 % of the indexed gain would be is
ignored, so the tax is the lower of the two. Indexed cost = cost x CII of the year of sale / CII of the year of
purchase (section 72(8)). CII 2026-27 = 384 (S.O. 3889(E)); 2018-19 = 280 and 2021-22 = 317 (the CII table of the
CBDT's ITR-2 utility for AY 2026-27). Each owner's other income already uses the slab-free ₹4,00,000. Cess 4 %, no
surcharge.
"""
from decimal import ROUND_HALF_UP, Decimal
D = Decimal
CII = {"2018-19": 280, "2021-22": 317, "2026-27": 384}
def inr(amount):
"""Whole rupees with Indian digit grouping: 2150000 -> "₹21,50,000"."""
whole = str(D(amount).quantize(D(1), rounding=ROUND_HALF_UP))
sign = "-" if whole.startswith("-") else ""
whole = whole.lstrip("-")
head, tail = whole[:-3], whole[-3:]
groups = []
while len(head) > 2:
groups.insert(0, head[-2:])
head = head[:-2]
if head:
groups.insert(0, head)
return sign + "₹" + ",".join(groups + [tail]) if groups else sign + "₹" + tail
FLATS = [
("Flat bought in 2018-19", "2018-19", 4000000, 6200000, 50000),
("Flat bought in 2021-22", "2021-22", 5000000, 8000000, 80000),
]
for name, bought, cost, sale, expenses in FLATS:
cost, sale, expenses = D(cost), D(sale), D(expenses)
plain_gain = sale - expenses - cost
indexed_cost = cost * CII["2026-27"] / CII[bought]
indexed_gain = max(D(0), sale - expenses - indexed_cost)
plain_tax = plain_gain * D("0.125")
indexed_tax = indexed_gain * D("0.20")
better = "indexed" if indexed_tax < plain_tax else "12.5 %"
tax = min(plain_tax, indexed_tax)
print(name)
print(f" sale {inr(sale)}, expenses {inr(expenses)}, cost {inr(cost)}")
print(f" without indexation: gain {inr(plain_gain)}, at 12.5 % {inr(plain_tax)}")
print(f" indexed cost {inr(indexed_cost)} (x 384 / {CII[bought]}): gain {inr(indexed_gain)}, at 20 % {inr(indexed_tax)}")
print(f" lower: {better}, {inr(tax)}; with 4 % cess {inr(tax * D('1.04'))}") Output
Flat bought in 2018-19 sale ₹62,00,000, expenses ₹50,000, cost ₹40,00,000 without indexation: gain ₹21,50,000, at 12.5 % ₹2,68,750 indexed cost ₹54,85,714 (x 384 / 280): gain ₹6,64,286, at 20 % ₹1,32,857 lower: indexed, ₹1,32,857; with 4 % cess ₹1,38,171 Flat bought in 2021-22 sale ₹80,00,000, expenses ₹80,000, cost ₹50,00,000 without indexation: gain ₹29,20,000, at 12.5 % ₹3,65,000 indexed cost ₹60,56,782 (x 384 / 317): gain ₹18,63,218, at 20 % ₹3,72,644 lower: 12.5 %, ₹3,65,000; with 4 % cess ₹3,79,600
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 flat_indexation.py
The flat bought in 2018-19 for ₹40,00,000 has an indexed cost of ₹54,85,714, so 20 % of the indexed gain, ₹1,32,857, is less than half of 12.5 % of the plain gain, ₹2,68,750. The flat bought in 2021-22 has had less inflation behind it and a bigger rise in price: 12.5 % of its plain gain, ₹3,65,000, is the lower tax, and the indexed route would cost ₹3,72,644. Neither route is always better, so the work is to compute both and pay the lower.
Checkpoint
Check: Other gains and indexation
Losses reduce gains by fixed rules, and carry forward only with a return on time
A loss on a sale is worked out exactly like a gain. Section 108(2) then lets it reduce the year’s gains by two rules: a short-term capital loss may be set-off (of losses): Using a loss to reduce other income of the same year. A short-term capital loss may be set off against any capital gain, a long-term capital loss only against long-term gains, and neither against another head of income. against the gain on any other capital asset, and a long-term capital loss only against long-term gains. A capital loss can never reduce salary, interest or any other head of income (section 109(2)). Step through Imran’s two years:
The drawing shows the whole scene; its 6 steps are listed below.
Every step as text
- A short-term loss. In year A Imran sells shares within 12 months for ₹80,000 less than they cost. A short-term capital loss may reduce the gain on any other capital asset of the year (section 108(2)(a)).
- Against a long-term gain. His only gain that year is ₹2,50,000, long-term, on equity fund units. The loss brings it down to ₹1,70,000, and the tax from ₹16,250 to ₹5,850 with cess.
- Never against salary. A capital loss cannot reduce income under any other head, salary or interest included (section 109(2)). Nothing of year A's loss is left over.
- A long-term loss. In year B he sells gold ETF units held for years at a loss of ₹1,00,000, and shares bought this year at a short-term gain of ₹60,000. A long-term loss may reduce only long-term gains, so the ₹60,000 is taxed in full.
- The return keeps it alive. The ₹1,00,000 can be carried forward only if it is determined in a return filed by the due date of section 263(1) (section 121). A belated return still reports the year, but the loss in it cannot be carried forward.
- Eight years, the same rule. Filed on time, the loss is carried forward for up to eight tax years, and each year it may reduce only long-term capital gains (section 111).
What a year cannot absorb is carry forward (of losses): Taking a loss that a year's income could not absorb into later tax years. Capital losses may be carried forward for up to eight years, and only from a return filed by its due date. for up to eight tax years, and in each of them it may reduce only what it could have reduced in the first: a short-term loss any capital gain, a long-term loss only long-term gains (section 111). The program works out both years:
"""Setting off Imran's capital losses in Tax Year 2026-27, and what is left to carry forward.
Income-tax Act, 2025, section 108(2): a short-term capital loss is set off against the gain on any other capital
asset of the year, a long-term capital loss only against long-term gains. Section 109(2): a capital loss is never set
off against income under another head. Section 111: what is left is carried forward for up to eight tax years, under
the same two rules, and section 121 allows that only for a loss determined in a return filed by the due date of
section 263(1). Rates: 20 % on short-term equity gains (section 196), 12.5 % on long-term equity gains above ₹1,25,000
(section 198), 4 % cess. Imran's salary already uses the slab-free ₹4,00,000 and the rebate's ₹12 lakh line is far
behind him, so every rupee of gain is taxed at those rates. The amounts are invented.
"""
from decimal import ROUND_HALF_UP, Decimal
D = Decimal
def inr(amount):
"""Whole rupees with Indian digit grouping: 170000 -> "₹1,70,000"."""
whole = str(D(amount).quantize(D(1), rounding=ROUND_HALF_UP))
head, tail = whole[:-3], whole[-3:]
groups = []
while len(head) > 2:
groups.insert(0, head[-2:])
head = head[:-2]
if head:
groups.insert(0, head)
return "₹" + ",".join(groups + [tail]) if groups else "₹" + tail
def tax(stcg, ltcg):
"""Tax with cess on short-term and long-term equity gains."""
return (stcg * D("0.20") + max(D(0), ltcg - 125000) * D("0.125")) * D("1.04")
def set_off(stcl, ltcl, stcg, ltcg):
"""Section 108(2): the long-term loss only against long-term gains; the short-term loss against either."""
used = min(ltcl, ltcg)
ltcg, ltcl = ltcg - used, ltcl - used
used = min(stcl, stcg)
stcg, stcl = stcg - used, stcl - used
used = min(stcl, ltcg)
ltcg, stcl = ltcg - used, stcl - used
return stcg, ltcg, stcl, ltcl
YEARS = [
("Year A: a short-term loss of ₹80,000 on shares, a long-term gain of ₹2,50,000 on fund units", 80000, 0, 0, 250000),
("Year B: a long-term loss of ₹1,00,000 on gold ETF units, a short-term gain of ₹60,000 on shares", 0, 100000, 60000, 0),
]
for title, stcl, ltcl, stcg, ltcg in YEARS:
stcl, ltcl, stcg, ltcg = D(stcl), D(ltcl), D(stcg), D(ltcg)
left_stcg, left_ltcg, left_stcl, left_ltcl = set_off(stcl, ltcl, stcg, ltcg)
print(title)
print(f" gains taxed after set-off: short-term {inr(left_stcg)}, long-term {inr(left_ltcg)}")
print(f" tax {inr(tax(left_stcg, left_ltcg))}, against {inr(tax(stcg, ltcg))} if the loss could not be used")
print(f" carried forward: short-term loss {inr(left_stcl)}, long-term loss {inr(left_ltcl)}") Output
Year A: a short-term loss of ₹80,000 on shares, a long-term gain of ₹2,50,000 on fund units gains taxed after set-off: short-term ₹0, long-term ₹1,70,000 tax ₹5,850, against ₹16,250 if the loss could not be used carried forward: short-term loss ₹0, long-term loss ₹0 Year B: a long-term loss of ₹1,00,000 on gold ETF units, a short-term gain of ₹60,000 on shares gains taxed after set-off: short-term ₹60,000, long-term ₹0 tax ₹12,480, against ₹12,480 if the loss could not be used carried forward: short-term loss ₹0, long-term loss ₹1,00,000
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 capital_losses.py
In year A the ₹80,000 short-term loss cuts the long-term gain from ₹2,50,000 to ₹1,70,000 and the tax from ₹16,250 to ₹5,850. In year B the ₹1,00,000 long-term loss cannot touch the ₹60,000 short-term gain, which pays ₹12,480, and the whole loss waits for a later long-term gain.
Filing late with a loss
Wrong: “the loss is mine, so I can claim it whenever I file”. Right: section 121 carries forward only a loss determined in a return filed by the due date of section 263(1), and section 263(1)(a)(viii) requires that return from anyone who wants to carry a capital or business loss forward. A belated return reports the year, but its loss is gone.
Checkpoint
Check: Setting off and carrying forward losses
A capital-gains schedule is built from records, lot by lot
A return asks for each sale: what was sold, when it was bought and sold, the sale value, the cost and the expenses. The program builds those rows for a sale of 150 shares from Rahul’s demat account, matched first in, first out:
"""Rahul's sale of 150 shares from his demat account, matched to his purchases first in, first out.
Income-tax Act, 2025, section 67(7)(c): for securities held in a depository, the cost and the holding period of
what is sold are those of the earliest purchases still held. Section 72(1): gain = sale value less the expenses of
the sale and the cost; section 72(3)(b): securities transaction tax is not one of those expenses. Shares listed in
India are long-term when held for more than 12 months (section 2(101)). Each row is one line of a capital-gains
schedule. The shares, prices and the brokerage are invented.
"""
from decimal import ROUND_HALF_UP, Decimal
D = Decimal
# (lot, units, months before the sale, price per share)
BOUGHT = [("Lot 1", 100, 19, D("1000.00")), ("Lot 2", 80, 7, D("1250.00"))]
SOLD, PRICE, BROKERAGE = 150, D("1500.00"), D(300)
def inr(amount):
"""Whole rupees with Indian digit grouping: 149700 -> "₹1,49,700"."""
whole = str(D(amount).quantize(D(1), rounding=ROUND_HALF_UP))
head, tail = whole[:-3], whole[-3:]
groups = []
while len(head) > 2:
groups.insert(0, head[-2:])
head = head[:-2]
if head:
groups.insert(0, head)
return "₹" + ",".join(groups + [tail]) if groups else "₹" + tail
print(f"Sold {SOLD} shares at {inr(PRICE)} each, brokerage {inr(BROKERAGE)} shared by units")
print(f"{'Lot':<6}{'Units':>6}{'Held':>8}{'Cost':>11}{'Sale value':>12}{'Expenses':>10}{'Gain':>10} Term")
left = SOLD
for lot, units, months, price in BOUGHT:
take = min(units, left)
if take == 0:
print(f"{lot:<6} {units} shares not sold, still held at cost {inr(units * price)}")
continue
cost = take * price
value = take * PRICE
expenses = BROKERAGE * take / SOLD
gain = value - expenses - cost
term = "long" if months > 12 else "short"
print(f"{lot:<6}{take:>6}{months:>6} m{inr(cost):>11}{inr(value):>12}{inr(expenses):>10}{inr(gain):>10} {term}")
if take < units:
print(f"{lot:<6} {units - take} shares still held, cost {inr((units - take) * price)}, bought {months} months before")
left -= take Output
Sold 150 shares at ₹1,500 each, brokerage ₹300 shared by units Lot Units Held Cost Sale value Expenses Gain Term Lot 1 100 19 m ₹1,00,000 ₹1,50,000 ₹200 ₹49,800 long Lot 2 50 7 m ₹62,500 ₹75,000 ₹100 ₹12,400 short Lot 2 30 shares still held, cost ₹37,500, bought 7 months before
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 fifo_lots.py
The one sale makes two rows: 100 shares from lot 1, held 19 months, a long-term gain of ₹49,800, and 50 from lot 2, held 7 months, a short-term gain of ₹12,400. The brokerage is shared by units, and the STT is left out because section 72(3)(b) does not allow it. The 30 shares still held keep lot 2’s cost and date for the next sale.
For each lot, keep what makes such a row: the contract note or allotment statement with the date and price of purchase, the same for the sale, the brokerage and other charges, and for a flat the purchase deed, the sale deed and the bills of any improvement with their dates. Stock exchanges, depositories and registrars report the capital gains on listed securities and fund units for your Annual Information Statement (AIS): Form 168, the tax department's record of what payers, banks and companies reported about your PAN for a tax year: TDS and TCS, interest, dividends, sales of securities, tax paid, demands and refunds. Each line can be given feedback. More in “TDS, AIS and advance tax” (rule 237(6) of the Income-tax Rules, 2026); compare their figures with your own rows before filing, as you would for interest. Gains also decide the form: for FY 2025-26 the e-filing portal allows ITR-1 with long-term equity gains of up to ₹1,25,000 and no short-term gain, and anything more, or a loss to carry forward, moves the return to ITR-2.
FIFO Capital Gains Calculator (Shares & Mutual Funds) List your purchases and sales to match each sale to its lots first in, first out, with the term and gain of every lot.Checkpoint
Check: Records lot by lot, and the form
Practise: interest, dividends and capital gains
Seventeen questions on investment income, holding periods, the equity rates, other gains, losses and records. The session opens with the idea you have shown least so far, and any question you miss comes back before it ends:
Practice that adapts to you
Practise this lesson
17 questions about 6 ideas of this lesson. Each answer is explained at once, and what you get right is kept in this browser.
Write your own schedule
Take your last sale from a demat account or a fund folio and write one row per lot: the date bought, the units, the cost, the date sold, the sale value and the charges. Mark each row short-term or long-term, then compare the rows with the capital-gains statement your broker or fund house gives you.
Interview questions
Warm-up (fresher): How is interest on a fixed deposit taxed, and does the bank’s TDS settle it?
Interest is income from other sources under section 92 of the Income-tax Act, 2025, so it is added to the rest of total income and taxed at the slab rates; it has no rate of its own. The bank’s TDS, 10 % once its interest to you passes ₹50,000 in the year (₹1,00,000 for a senior citizen), is only tax paid early. What the interest really costs depends on where it lands: ₹48,000 costs nothing at ₹6 lakh of other income, ₹7,490 at ₹14 lakh, and ₹29,120 at ₹11.8 lakh, where it carries total income past the rebate’s ₹12 lakh line. The old regime deducts up to ₹10,000 of savings-account interest (section 153); the new regime does not.
Warm-up (fresher): Why can a short-term gain on shares be taxed when total income is under ₹12 lakh?
Because the rebate of section 156 covers only tax at the slab rates (section 156(3)), and a short-term gain on equity sold with STT is taxed at 20 % under section 196 instead. Rahul’s salary of ₹8,75,000 leaves ₹8,00,000 of total income and ₹20,000 of slab tax, which the rebate cancels; his ₹3,00,000 short-term gain adds ₹60,000 at 20 %, which it does not, so he pays ₹62,400 with cess although total income is ₹11 lakh. Only a resident with other income below ₹4,00,000 may set that shortfall against the gain first.
Key takeaways
- Interest and dividends are income from other sources, taxed at your slab rates on top of everything else, and the bank’s or company’s TDS is only tax paid early.
- A gain is short-term after not more than 12 months for listed securities and equity-fund units and 24 months for other assets, while debt fund units bought from 2023-24 are always short-term.
- Equity sold with STT pays 20 % short-term and 12.5 % long-term above ₹1,25,000, outside the rebate, and the gain still counts towards the ₹12 lakh line.
- Other long-term gains pay 12.5 %, and land or buildings bought before the 2024-25 cut-off pay the lower of that and 20 % on the indexed gain.
- Short-term losses reduce any capital gain and long-term losses only long-term gains, carried forward up to eight years only from a return filed on time.
- Each lot of each sale needs its own record of dates, cost, sale value and charges, matched first in, first out for demat holdings.
Terms in this lesson
- capital gain
- The profit on transferring a capital asset such as shares, fund units, gold or a flat: the sale value less the expenses of the sale and the cost. It is taxed under the head Capital gains in the year of the transfer.
- carry forward (of losses)
- Taking a loss that a year's income could not absorb into later tax years. Capital losses may be carried forward for up to eight years, and only from a return filed by its due date.
- Cost Inflation Index (CII)
- An index the Central Government notifies for each financial year, having regard to 75 % of the rise in urban consumer prices, to index the cost of an asset; it is 384 for 2026-27.
- equity-oriented fund
- A mutual fund scheme that keeps at least 65 % of its money in shares of domestic listed companies, or 90 % in units of a traded fund that does so. Its units sold with securities transaction tax are taxed like listed shares.
- first in, first out (FIFO)
- The order in which securities held in a demat account count as sold: the earliest purchases still held go first, which fixes the cost and the holding period of every lot in a sale.
- indexation
- Raising the cost of an asset by the ratio of the Cost Inflation Index of the year of sale to that of the year of purchase, so that only the gain beyond inflation counts. It survives as an option on land and buildings bought before the cut-off of section 197(3).
- set-off (of losses)
- Using a loss to reduce other income of the same year. A short-term capital loss may be set off against any capital gain, a long-term capital loss only against long-term gains, and neither against another head of income.
- short-term capital asset
- An asset held for not more than 24 months before its transfer, or 12 months for listed securities, equity-oriented fund units, UTI units and zero-coupon bonds. Its gain is a short-term capital gain; held longer, the gain is long-term.
References
- The Income-tax Act, 2025 (sections 2(101), 67, 70, 72, 76, 92, 93, 108 to 111, 121, 153, 156, 196 to 198, 202, 263, 393 and 516) (Legislative Department, Ministry of Law and Justice)
- The Finance Act, 2026 (sections 2, 43 and 44, and the First Schedule) (Legislative Department, Ministry of Law and Justice)
- Notification S.O. 3889(E): Cost Inflation Index for the financial year 2026-27 (Central Board of Direct Taxes, Ministry of Finance)
- Income tax return utilities for AY 2026-27 (the ITR-2 utility and its Cost Inflation Index table) (Income Tax Department, Government of India)
- Income-tax Rules, 2026 (rules 237 and 245; Form No. 168) (Central Board of Direct Taxes, Ministry of Finance)
- Annual Information Statement (AIS) frequently asked questions (Income Tax Department, Government of India)
- Which ITR form applies to an individual (ITR-1 conditions for AY 2026-27) (Income Tax Department, Government of India)
Related tools
Report a problem with this lesson
Kept only in this browser. Your Learn progress