The basic computation
The gain is sale consideration minus cost of acquisition (and minus brokerage/charges). For listed shares on which STT is paid, the holding-period line is 12 months: short-term (≤12 months) at 20% under Section 111A; long-term (>12 months) at 12.5% under Section 112A on the amount above a ₹1.25 lakh yearly exemption.
Grandfathering for pre-2018 shares
For shares acquired before 1 February 2018, the cost is taken as the higher of actual cost and the fair market value on 31 January 2018 (capped at the sale price). This shields the gains that accrued before LTCG on equity was introduced, and matters a lot for long-held shares. Confirm current rates and the exemption per the Finance Act.
A worked example
Example: you bought shares in 2016 for ₹2 lakh; their 31 January 2018 value was ₹5 lakh; you sell in 2026 for ₹9 lakh. Your cost for the long-term gain is taken as ₹5 lakh, so the gain is ₹4 lakh — tax on ₹2.75 lakh (after the ₹1.25 lakh shield) at 12.5%. You can also set off losses against this. Our team can compute it from your broker statement.