Supporting everyone's personal finance journey

How is tax calculated on selling shares/MFs and how do to do tax harvesting?

01 Sep 2021 - Contact Sayan Sircar
12 mins read

This post discusses the concept of tax calculations and tax-harvesting in a simple manner

Tax calculation

Originally published: 01-Sep-2021 Updated: 02-Feb-2022 (post Union budget 2022)

Capital gains is the profit from selling a capital asset like stocks or mutual funds. Capital gains are of two types depending on the holding period (see table A below):

  • Long term capital gain: LTCG
  • Short term capital gain: STCG

Tax harvesting is the concept of tax planning where you can offset capital gains in some mutual funds or shares against capital losses in others.

Disclaimer: Taxation is a dynamic concept and the content of this article is valid on the date of publication and any subsequent updates. Always consult a professional tax advisor before doing anything that leads to taxes being due.

Table of Contents

Taxation rules

Table A: Taxation of stocks and mutual funds

Type Portfolio Short-term capital gains | Taxation Long-term capital gains | Taxation
Shares, Equity MF or equity-oriented Hybrid MF >65% Indian equity <365 days | 15% + cess + surcharge >= 365 days | <1 lakh/year is tax free. Gains above 1 lakh are taxed at 10% + cess + surcharge
Debt or Hybrid funds (debt oriented) or International funds <65% Indian equity <3 years | Taxed at slab rate >=3 years | 20% + cess + surcharge on gains post indexation

where Capital gains = (Selling price - Buying price) * Units sold


buying price post indexation = (Buying price) * (Cost Inflation index today) / (Cost Inflation index at the time of purchase)

Surcharge on LTCG on all capital assets, including unlisted shares has been capped at 15% in Budget 2022. This will specifically help startup owners who will now pay lower taxes on selling unlisted shares. Earlier only listed shares has this cap.

Note that for equity shares and equity mutual funds, any capital gains incurred before 31-Jan-2018 is not taxable. This is the so-called ‘grandfathering clause’.

When should you pay capital gains tax?

Due date Advance tax payable
15th June 15%
15th September 45%
15th December 75%
15th March 100%

Every tax payer with more than ₹10,000/year tax liability should pay tax as per the schedule above. This rule means that before every date in the table above, it is a good practice to calculate your capital gains and pay the advance tax.

Offset and carry-forward of losses

  • Long term capital loss is allowed to be offset only against LTCG
  • Short term capital loss is allowed to be against either LTCG or STCG
  • You can carry forward both short and long term capital losses for eight years as long as you keep filing yearly returns (typically in ITR2 or above, not ITR1)

Securities Transaction Tax (STT)

STT at 0.001% (i.e. 1 rupee per lakh) applies to all equity/equity MF buy and sell transactions. STT for debt MF is zero. This 0.001% amount is small enough to be inconsequential and should be ignored when calculating the effect of taxes on sale transactions.

Some basic concepts

Wash sale rule

To perform tax harvesting, you need to sell something and then immediately buy it. The wash sale rule says that you cannot buy the same or very similar security within a short span of selling it. Tax authorities frown upon this practice in general.

India does not have a wash sale rule today. However, from an optics perspective, it will be better for investors to avoid performing a wash sale as much as possible.

Different folio rule

Mutual funds held in different folios have different tax treatments. The first-in-first-out rule applies to units at a folio level. Suppose there are two folios A and B, where the units in B are bought after those in A and later sold, then only those in B will be considered for tax calculation.

Date Folio Transaction Units
1 A Buy 100
2 B Buy 100
3 B Sell 50

In the example above, for tax computation, only those units from Folio B is considered.

Taxation when other income is not present

Imagine the situation of an investor with only capital gains from stocks/MF as taxable income. Salary, interest income and other income is taxed at slab and capital gains is taxed at special rates as discussed above. However, the basic ₹2.5 lakhs exemption limit (₹3 lakhs for senior citizens) applies here as well.

You do not pay any tax if total income plus taxable capital gains (after all offsets within capital gains and losses) does not exceed ₹2.5 lakhs. Tax payers should also check if they are eligible for a rebate under Section 87A where they can reduce their taxes by a further ₹12,500 if their total income is under ₹500,000.

Income tax returns must be filed to take advantage of the deductions and offsets. Some additional use cases and examples using real estate transactions are present here: How to calculate taxes from capital gains and combine them with your other income

References from

Our new Goal-based investing tool will help you to create and manage all of your goals in one place. Click the image below to get access:

Arthgyaan creates a system for reaching your financial goals by sharing simple, actionable advice backed by research and analysis.

Your email address will not be shared with anyone and you can unsubscribe anytime.

Techniques of tax harvesting

Tax harvesting is one of the tasks that you must perform in the month of March every year.

Loss harvesting using offsetting transactions

The profits obtained from the sale of some funds can be offset by deliberately selling other funds whose oldest units are at a loss.

Date Folio Fund Transaction Units Price Comment
1 A X Buy 100 10 First buy
2 B Y Buy 100 12 First buy
3 A X Sell 50 12 50*2=100 profit
4 B Y Sell 25 8 25*(12-8)=100 loss

For example, we sell 25 units of fund Y to offset the profit from selling 50 units of fund X.

If you are planning to keep investing in fund Y, selling units from Y now lowers the average purchase price of the remaining units. This leads to higher taxes in the future and needs to be weighed vs. saving taxes today.

Timing the sale as per financial year

Funds that have less than 65% exposure to Indian equities, either directly or via arbitrage, are taxed as debt funds. Indexation is available on the purchase price of these funds based on cost-inflation index (CII) which is determined by the financial year in which the fund is purchased. Since CII goes up with time, it makes sense to buy debt-taxed funds as early as possible and sell them as late as possible to take advantage of the tax calculation.

In general, assets with indexation benefit on purchase price, irrespective of appreciation, will lead to lower taxes the longer they are held. Of course, you should not keep capital blocked solely to have benefit of indexation but a bit of planning is important.

If you are rebalancing annually, it makes sense to do it in March. The following thumb rules can be used to time purchases and redemptions for rebalancing and harvesting:

  • sell equity-taxed funds and buy debt-taxed funds some time before 31-Mar
  • buy equity-taxed funds and sell debt-taxed funds just after 1-Apr

Given that AMCs allot new MF units only on realization of incoming funds from the investor, investors who do not have large amounts of cash handy for such trades, can use the daily SPP facility of MFUIndia to perform such switch trades. They can do this by slowly selling out of the old fund, wait for the money to come and then enter the new fund with that redeemed cash to eliminate the risk of the markets moving abruptly while they are waiting for the AMC to allocate new units.

Using different folios

Some investors prefer to segregate portfolios using different folio numbers and tag them to different goals as described here. This leads to a logical separation of goals and allows the booking of capital gains as per requirement.

One lakh equity LTCG booking

Currently, long term capital gain in equity is tax-free for the first one lakh per year. If units sold in different funds are sold at a price higher than the purchase price and the total profit is:

  • less than one lakh then the tax is zero
  • more than one lakh then tax of 10% (+ cess + surcharge) is payable on the amount more than a lakh.

So if the LTCG is ₹ 120,000, then the tax payable is ₹20,000 * 10% = ₹2,000 + cess + surcharge.

This feature of the tax code gives an opportunity to book ₹100,000 profit every year in equity funds or stocks to save ₹10,000 in taxes. Note that this feature is calculated on ₹ 1 lakh of profits and not sale consideration.

For example:

With 100,000 exemption rule

Item Price/Amount
Purchase price (A) 100
Units (B) 10,000
Book value (C=A*B) 10,00,000
Current price (D) 250
A year or more later
Units sold (F) 667
Market value (G=F*D) 1,66,750
Capital gains H=(D-A)*F 1,00,050
Taxable capital gains = H - 1lakh 50
Tax @ 10% = T1 5
Units repurchased at 250 = U = G/D 667
A year or more later
Current price (D2) 350
All units sold F2 = B-F+U 10,000
Market value M=F2 * D2 35,00,000
Purchase amount = X = (B-F)*A + G 11,00,050
Profit = P = X-M 23,99,950
Taxable capital gains = P - 1lakh 22,99,950
Tax @ 10% = T2 2,29,995
Total tax = T1+T2 2,30,000

Without 100,000 exemption rule

Item Price/Amount
Purchase price (A) 100
Units (B) 10,000
Book value (C=A*B) 10,00,000
A year or more later
Current price (D) 350
All units sold (B) 10,000
Market value (E=D*B) 35,00,000
Capital gains (F=E-C) 25,00,000
Taxable capital gains G=F-1 lakh 24,00,000
Tax @ 10% = G * 10% 2,40,000

This example shows that harvesting 667 units after year 1 saved ₹10,000 tax. While using this method, the investor has to be mindful of the concept of the wash sale rule. It is better to combine LTCG harvesting along with portfolio rebalancing so that the sale proceeds are invested in different funds. You can do this either in March or throughout the year. The exemption is for total sales over the year.

If you liked this article, consider subscribing to new posts by email by filling the form below.

Previous and Next articles:

Latest articles:

Topics you will like:

Asset Allocation (18) Basics (5) Behaviour (10) Budgeting (9) Calculator (10) Children (6) Choosing Investments (24) FAQ (2) FIRE (8) Gold (6) House Purchase (10) Insurance (6) Life Stages (2) Loans (10) NPS (3) NRI (3) News (5) Portfolio Construction (27) Portfolio Review (17) Retirement (20) Review (7) Risk (6) Set Goals (24) Step by step (3) Tax (10)

Next steps:

1. Email me with any questions.

2. Use our goal-based investing template to prepare a financial plan for yourself
use this quick and fast online calculator to find out the SIP amount and asset allocation for your goals.

Don't forget to share this article on WhatsApp or Twitter or post this to Facebook.

Discuss this post with us via Facebook or get regular bite-sized updates on Twitter.

More posts...

Disclaimer: Content on this site is for educational purpose only and is not financial advice. Nothing on this site should be construed as an offer or recommendation to buy/sell any financial product or service. Please consult a registered investment advisor before making any investments.

This post titled How is tax calculated on selling shares/MFs and how do to do tax harvesting? first appeared on 01 Sep 2021 at

We are currently at 161 posts and growing fast. Search this site:
Copyright © 2021-2022 All rights reserved.
Goal-based investing

Click here to create your own investing plan.