Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

FIFO Capital Gains Calculator (Shares & Mutual Funds)

Every sale matched to the oldest units first, with its gain, term and tax year.

Finance For India No upload Works offline Free, no sign-up

Transactions

    The starting rows are a made-up example: a share with a split and a bonus, an equity fund and a debt fund.

    Paste or import tradebook, fund statement, spreadsheet, CSV
    Headings such as trade date, symbol or scheme, trade type, quantity or units, price or NAV, brokerage, ISIN are recognised. Without a header: Date, Security, Type, Units, Price, Charges.
    Or a file

    Securities

    Choose what each one is. For listed shares and equity-fund units bought before 1 February 2018, enter the value per unit on 31 January 2018 — the highest price that day, or the NAV for fund units.

      Net capital gain —

      Gains by category

      Sales matched to purchases

      How a lot was worked out

      Units you still hold

      Next steps

      Tax rules and rates change. This calculator follows the rules described on this page and may not cover every situation. Check the official source or a qualified tax professional before filing or invoicing.

      About the FIFO Capital Gains Calculator (Shares & Mutual Funds)

      When you sell part of a holding you bought in several goes, the tax law decides which units you sold: for shares and fund units in a demat account, the oldest ones first — first in, first out (FIFO). That sets the cost and the holding period of every unit sold, and so whether each part of the gain is short-term or long-term.

      Enter or paste your buys and sells — from a broker’s tradebook or a fund statement — with any bonus issues and splits. The calculator matches every sale lot by lot, gives the holding period and class of each lot, applies the 31 January 2018 grandfathering to older equity, and adds the gains up for FY 2025-26 and Tax Year 2026-27 by the categories the tax return asks for. It also lists the units you still hold and the date each lot turns long-term. Nothing you enter leaves your browser.

      How to use it

      1. Add one row per transaction: the date, the share or fund (use the same name on every row for it), Buy, Sell, Bonus or Split, the units and the price or NAV, plus any charges (brokerage, stamp duty — not STT).
      2. Or open Paste or import and paste rows from a tradebook, a fund statement or a spreadsheet, or open a CSV file. Columns are recognised by their headings.
      3. Under Securities, choose each one’s asset class — listed shares, equity fund, debt fund and so on. For equity bought before 1 February 2018, enter its value per unit on 31 January 2018.
      4. Read the gains for each tax year, the lot-by-lot matches and the units still held. Copy the summary or download the matches, the summary and the open lots as CSV for your tax return.

      Examples

      Shares with a split and a bonus, sold in Tax Year 2026-27
      Input
      100 bought 10 May 2017 at ₹400 (₹40 charges) · 1:2 split 1 Jul 2019 · 100 bonus 20 Nov 2020 · 50 bought 15 Oct 2025 at ₹650 · 320 sold 12 Jun 2026 at ₹720 (₹115 charges) · ₹480 on 31 Jan 2018
      Result
      200 split shares: cost raised to ₹240 each, gain ₹95,928 (long-term) · 100 bonus shares at nil cost: ₹71,964 (long-term) · 20 of the 2025 shares: ₹1,383 (short-term) · 30 shares still held, long-term from 16 Oct 2026

      Long-term equity gains of ₹1,67,892 for the year: ₹42,892 is above the ₹1.25 lakh exemption.

      A debt fund bought in June 2023
      Input
      1,000 units at ₹25.10 (₹1.26 stamp duty), sold 4 May 2026 at ₹28.35
      Result
      Gain ₹3,249 — short-term at slab rates, although held for almost three years

      First in, first out

      For securities held through a depository (a demat account), the Income-tax Act says the cost of acquisition and the period of holding are determined on the first-in-first-out method — section 67(7)(c) of the Income-tax Act, 2025, section 45(2A) of the 1961 Act, following CBDT Circular No. 768. A sale therefore uses up your oldest units first, whatever units you meant to sell. Each security is matched separately; this calculator matches every security you enter that way, transaction by transaction in date order.

      Short-term or long-term

      • Listed shares, equity-fund units, other listed securities (bonds, ETFs): long-term if held more than 12 months before the sale — section 2(101). The Finance (No. 2) Bill, 2024 memorandum put it as “for all listed securities, the holding period … 12 months”.
      • Other fund units that are not listed: more than 24 months.
      • Debt mutual fund units bought on or after 1 April 2023 (funds with more than 65% in debt and money-market instruments, by whatever name — debt and liquid ETFs too): always short-term, taxed at your slab rates however long you hold them — section 76 (section 50AA of the 1961 Act). Bought before then, debt-fund units are long-term after 24 months, and units of a listed debt ETF after 12 months; choose Debt ETF (listed) for those.

      The months are counted date to date: shares bought on 10 April 2025 are long-term when sold on or after 11 April 2026.

      Bonus issues and splits

      • Bonus units cost nil (section 90(6)(d)) and are held from the date they were allotted (section 2(101)(c)). Enter them as a Bonus row with the units received. With FIFO, a sale still uses the original shares first.
      • A split or consolidation changes the number of units, not what you paid: the cost of the new shares is worked out from the old ones (section 90(9)(d)). Enter a Split row with the new units for each old unit — 5 for a ₹10 share split into ₹2 shares, 0.5 for two shares consolidated into one. Every lot held then is multiplied by the ratio and its cost per unit divided by it; each lot keeps its purchase date.

      Equity bought before 1 February 2018

      For listed equity shares and units of equity-oriented funds or business trusts bought before 1 February 2018 and sold long-term, the cost is the higher of your actual cost and the lower of their fair market value on 31 January 2018 and the sale value — section 90(7) (section 55(2)(ac) of the 1961 Act). The fair market value is the highest price quoted on a recognised stock exchange on 31 January 2018 (or on the last day before it with trading), or the NAV on that date for units that were not listed. Enter it per unit as it stood on that day; later splits are applied to it for you. Gains up to 31 January 2018 are not taxed: the cost is raised at most to the sale value.

      What goes in the charges, and what the totals mean

      Put brokerage, exchange and SEBI charges, GST on them and stamp duty in the charges: on a purchase they are added to the cost, on a sale they are deducted as transfer expenses. Do not include securities transaction tax (STT) — it is not deductible (section 72(3)(b)).

      The summary groups each year’s gains the way they are taxed: short-term equity at 20% (section 196; 111A of the 1961 Act), long-term equity at 12.5% on the year’s total above ₹1,25,000 (section 198; 112A), other long-term gains at 12.5% (section 197; 112) and other short-term gains at your slab rates. The equity rates need STT paid on the sale (and, for shares, on the purchase). A short-term loss can be set off against any capital gain of the year, a long-term loss only against long-term gains (section 108(2)); what is left can be carried forward for eight tax years (section 111). Work out the tax itself with the capital gains tax calculator.

      Pasting a tradebook or statement

      A header row is matched by name: date (trade date), security (symbol, scrip, scheme, name), type (trade type, transaction, action), quantity (units), price (rate, NAV), and optionally ISIN, asset class and amount — when there is no price, the amount divided by the units is used. Every charge column is added up: brokerage, exchange and clearing charges, SEBI fees, GST, stamp duty, exit load (a “total charges” column is used on its own); STT columns are left out. Without a header the columns are Date, Security, Type, Units, Price, Charges. Type words such as buy, purchase, SIP, switch-in, sell, redemption, switch-out, bonus and split are understood; without a type, negative units are a sale. Columns can be separated by tabs, commas or semicolons, and lines that cannot be read are listed with the reason.

      A pasted security starts as listed shares unless the data has an asset-class column; a name that reads like a fund gets a reminder to choose its class under Securities.

      Limitations

      • Sales are classified under the rules of FY 2025-26 and Tax Year 2026-27, which are the same. Sales in other years are matched (so later sales use the right units) but not classified.
      • Not covered: intraday and F&O trades (business income), mergers, demergers, buybacks, ESOPs, foreign shares, crypto and other virtual digital assets, and unlisted bonds, unlisted debentures and market-linked debentures (always short-term under section 76). Rights shares can be entered as purchases on their allotment date.
      • For residents. The 31 January 2018 values, the asset classes and the charges are what you enter; the calculator does not look them up.
      • Bought before 1 April 2001: you may take the fair market value on 1 April 2001 as the cost instead of what you paid (section 90(9)(a); section 55(2)(b) of the 1961 Act). Enter that value as the purchase price.
      • It adds up gains and losses by category but does not set losses off for you or work out the tax.
      • Up to 3,000 transactions at a time. The page lists the first 500 lots of each table; the CSV files have all of them.

      Privacy

      Everything is calculated in your browser. Your transactions, statements and files are never uploaded or stored on a server.

      Frequently asked questions

      Why are my oldest shares treated as sold first?

      Because the law says so for securities in a demat account: section 67(7)(c) of the Income-tax Act, 2025 (section 45(2A) of the 1961 Act) fixes the cost and the holding period on the first-in-first-out method. You cannot choose to sell the newest units to make a gain short-term or long-term.

      How do I enter bonus shares?

      Add a row with the type Bonus, the date of allotment and the number of bonus shares received; leave the price empty. Bonus shares cost nil and their holding period starts on the allotment date — but if they were allotted before 1 February 2018, the 31 January 2018 value can still raise their cost.

      How do I enter a stock split?

      Add a row with the type Split, the date it took effect and, in the units column, the new shares for each old one — 2 for a 1:2 split, 5 for ₹10 shares split into ₹2 shares. Enter purchases before the split at the prices you actually paid, and later ones at the new prices.

      Where do I find the price on 31 January 2018?

      For listed shares it is the highest price quoted that day on a recognised stock exchange — in the historical data of NSE or BSE. For mutual fund units that were not listed, it is the NAV on 31 January 2018, in the NAV history published by AMFI or the fund house. Enter it per unit as it was then; later splits are applied for you.

      Is the ₹1.25 lakh exemption on long-term equity gains applied?

      The summary shows how much of the year’s long-term equity gains is above ₹1,25,000. The exemption is for all such gains of the year together, so add any sales you have not entered here.

      Can I use this for my ITR?

      The CSV of matches has the figures the capital-gains schedules ask for — sale value, cost, 31 January 2018 value, expenses and gain, lot by lot, with ISIN if you enter it. Check it against your broker’s or registrar’s capital-gains statement; it is not the e-filing upload format.

      Quick answers and tool search

      Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.