Free calculator · no sign-up

XIRR vs TWRR calculatorIs it your stock picks, or your timing?

Upload your broker’s tradebook and get the report Stockport members see on their Performance tab: what your money made (XIRR), what your stock picks made (TWRR), the Nifty 50 with dividends over the same dates, and the behaviour gap between them, year by year.

  • Every trade priced at that day’s close
  • Splits, bonuses, mergers and dividends included
  • Nothing is saved

Your tradebooks

Zerodha · Groww · Upstox · Angel One · ICICI Direct · any broker

Your files are read here, in your browser. Only the trades are sent, to match each one to its company and price it at that day’s close; nothing is saved. Add every financial year you have: a trade in two files is counted once.

Keep it

This report, kept up to date and yours to fix

Continue with Google, then import the same files. Stockport keeps your trades in one Ledger, rebuilds this report with every day’s closing prices, and lets you log what a tradebook misses: IPO allotments, transfers, older purchases. Then write down why you own each stock, so your next exit is a decision, not a reaction. The Performance report is on every plan, including Free.

The method

Understand your report

Your report shows two returns for one portfolio. XIRR is what your money made. TWRR is what your stock picks made, regardless of when and how much you put in. The distance between them is the behaviour gap. This is how each number is worked out, and what the report cannot see.

What goes into the report

The report reads one thing: the trades in the tradebooks you upload. It needs no holdings statement. Trades that appear in two files are counted once, and each symbol is matched to its listed company, including companies that have changed their name or symbol since. Three corrections are applied as the trades are read:

  • Splits, bonuses and consolidations change the share count on the ex-date, from NSE’s corporate-action record (back to 2005). Shares move; money does not.
  • Mergers and demergers move shares and cost from the old company to the new one. Today this is a hand-kept list of two: HDFC’s merger into HDFC Bank, and Jio Financial’s demerger from Reliance.
  • Dividends are worked out for you: the per-share amount NSE recorded, times the shares you held going into the ex-date, counted as cash received on the ex-date.

Prices are the official closing price of the day, as the stock actually traded on NSE (BSE’s close for a company that traded only on BSE). The report does not use “adjusted” prices, except for companies listed only on BSE, whose closes come from a third-party source: since splits and bonuses are already applied as share counts, a 1,000-share holding that became 2,000 shares after a split is simply valued at the post-split close. A holding’s value today is shares held × the latest close.

Three things are kept out of every number, and the report names each one:

  • A company you sold more shares of than you bought. Usually an older tradebook is missing, or an IPO allotment never passed through one. Counting the sale without the purchase would be money from nowhere.
  • A holding with no price, or whose last price is more than 14 days old.
  • Instruments that are not shares: government bonds, T-bills, F&O, currency, commodity and rights entitlements. They are listed by name, not counted. ETFs and Sovereign Gold Bonds count.

The report’s window runs from your first counted trade to the latest closing price.

XIRR: what your money made

XIRR is the single yearly rate that, applied to every rupee for exactly the days it was invested, turns all your purchases into all your sales, dividends and today’s value. It answers the question an investor actually asks: what did my money earn? A fixed deposit that turns ₹1,00,000 into ₹1,07,000 in a year has an XIRR of 7%. XIRR does the same sum for money that went in and came out on many different dates, in different amounts.

WhatCounted asDated
Every purchase (shares × price)money in (negative)trade date
Every salemoney out (positive)trade date
Every dividendmoney out (positive)ex-date
What you still hold, at the latest closemoney out (positive), as if sold todaylatest close

Then it finds the rate r that makes these flows net to zero, where CF is each cash flow, d its date and d0 the date of the first:

Σi CFi ÷ (1 + r)(di − d0) / 365 = 0

Days are actual calendar days over a 365-day year, the same convention as Excel’s XIRR, so you can check the figure in a spreadsheet with the same flows. It is solved by bisection between −99.99% and +5,000% a year, to ten decimal places, and shown to one.

Two consequences. First, cash sitting idle in your broker account between a sale and the next purchase is not counted: a sale is money taken out, the next purchase is new money in. XIRR is the return on money while it was in shares. Second, the stock-level XIRR in the report is the same calculation run on one company’s flows alone.

A worked example

One stock. On 1 April 2024 you buy 1,000 shares at ₹100. The stock runs to ₹150 by 1 October 2024 and you buy 2,000 more at ₹150. By 31 March 2025 it is at ₹120.

DateCash flow
1 Apr 2024−₹1,00,000bought 1,000 at ₹100
1 Oct 2024−₹3,00,000bought 2,000 at ₹150
31 Mar 2025+₹3,60,0003,000 shares × ₹120

XIRR: −15.7%. You put in ₹4,00,000 and hold ₹3,60,000, so you lost money, even though the stock ended 20% above your first purchase price. XIRR is the honest number for your wealth, but on its own it cannot say whether the loss came from a bad stock or from putting most of the money in near the top. That is TWRR’s job.

Under a year, nothing is annualised. Over a short stretch a yearly rate exaggerates: a 3% rise over two months compounds to about 19% a year. So any stretch shorter than a year is shown as the plain return for that stretch, labelled “since” its start date, and yearly rates start from the first anniversary. This is the rule of the global performance-reporting standard (GIPS). The example runs 364 days, one short of a year, so the report shows its −15.7% as the return since 1 April 2024.

Why a stock’s XIRR can sit far from its P&L percentage. P&L % divides the gain by all the money put in, as if every rupee had been invested since the first purchase. XIRR weighs each rupee by the days it was actually in. A stock bought in many lots over a few months, most of the money late, can show an XIRR well above its P&L %: the late rupees earned their share in a few weeks. Neither number is wrong; they answer different questions.

TWRR: what your picks made

TWRR (time-weighted rate of return) measures how the stocks you held performed, ignoring when and how much money you put in or took out. It cuts your history into periods at every date the money changed, measures each period’s return on what you held, and multiplies the periods together. A period where you held ₹10 lakh counts exactly as much as one where you held ₹10,000. That is why fund managers are judged on it: they do not control when investors add money. For an individual investor, TWRR is the cleanest test of stock selection, and the right number to put beside the Nifty.

A new period starts on every date you traded and on every dividend ex-date. For each period, take the shares held after that day’s trades, valued at that day’s close; take the same shares at the next date’s close (plus any split or bonus shares that arrived inside the period), and add any dividend whose ex-date falls inside it. The period’s return is end value ÷ start value. Multiply every period’s return together; for a window of a year or more, annualise over the N days from the first trade to the latest close:

TWRR = ( ∏k (Vendk + Dk) ÷ Vstartk )365 / N − 1

Under a year, the product minus one is the answer: the plain return for the period. A holding counts in a period only if it has a closing price at both ends of it. TWRR also needs at least 3 companies with prices, making up at least 30% of the companies counted; below that the report shows no TWRR and no gap, and says why. One subtlety: TWRR treats every trade as happening at that day’s closing price. If you bought at ₹98 and the stock closed at ₹100, those ₹2 do not show in TWRR. They do show in XIRR, so they land in the behaviour gap.

The worked example: period 1, 1 April to 1 October 2024, ₹100 to ₹150, +50%. Period 2, 1 October 2024 to 31 March 2025, ₹150 to ₹120, −20%. Chained: 1.50 × 0.80 = 1.20, so +20.0%. The ₹3,00,000 added at ₹150 changes nothing here: the pick itself made 20%.

The behaviour gap and the Nifty comparison

The behaviour gap is TWRR minus XIRR, in percentage points a year. When TWRR is higher, the stocks did better than your money did: when and how much you invested cost you, and the report calls it a behaviour drag. When XIRR is higher, your timing and sizing added return on top of the picks: a behaviour boost. Same stock, same total money, three outcomes:

ScenarioXIRRTWRRGap
The example: ₹1 lakh at ₹100, ₹3 lakh more at ₹150 after the run-up, ends at ₹120−15.7%+20.0%about 35.7 points drag
The same ₹4 lakh, all at ₹100 on day one+20.0%+20.0%none
The next year (FY26): held 3,000 shares from ₹120, sold 1,000 at ₹140 near the top, the rest ends at ₹132+15.3%+10.0%5.3 points boost

That table is the case for showing both numbers. XIRR alone cannot separate picking from timing; TWRR alone hides what happened to your money. The gap is the part of your return that comes after the pick: when you added, how much, and when you took it out. That is the part a discipline system can work on.

The Nifty. The Nifty 50 is compounded from the close on your first trade’s date to the latest close, as a yearly rate (for a report under a year, the plain change over the same days). Because your XIRR and TWRR include dividends, the like-for-like benchmark is the Nifty 50 Total Return Index (TRI), which assumes the index’s dividends are reinvested. The report shows the TRI beside the price index and compares against it when it covers your window. The TRI is built from NSE’s own daily index files from 1 January 2016, and it matches NSE’s published yearly TRI returns for 2017 to 2025. Before 2016 only the price index is available (from September 2007), and the report says so.

Which number to hold against the Nifty: TWRR. Both are time-weighted, so TWRR against the Nifty is a fair test of stock selection. XIRR against the Nifty’s yearly rate mixes your timing with the index’s path; read it as a rough guide, not a verdict.

The Conviction Gap: do your biggest bets beat the market by the most?

The behaviour gap says how much timing and sizing together cost or added. The Conviction Gap card looks at one part of it: did the stocks you gave the most money to turn out to be your best ideas? Your holdings are put in order twice, once by how big a bet each was and once by how far it beat the market, and the two orders are compared with Spearman’s rank correlation, a number from −1 to +1. At +0.30 or more the report says your sizing tracks your conviction; at −0.30 or less it calls it inverse sizing, your big bets doing worse than your small ones; in between, there is no consistent pattern.

  • How big a bet: the holding’s average share of your portfolio’s value at each month-end while you held it, not the rupees you put in. Rupees grow with the portfolio: for an investor whose typical purchase was ₹25,000 three years ago and ₹1.5 lakh today, a ranking by rupees mostly ranks when each stock was bought.
  • How well it did: the holding’s XIRR as a yearly rate (always yearly here, even for a holding under a year, so every holding is in the same unit), minus the Nifty 50 with dividends over the same dates. Subtracting the index over each holding’s own dates judges the idea, not the market it happened to meet.
  • Left out, and counted on the card: holdings held less than six months, shares received without buying them (such as Jio Financial from Reliance’s demerger), and anything without a price. The card needs at least 8 holdings to give a verdict.

The card then names your biggest and smallest bet, for example: “Your biggest bet ABC (on average 18.4% of your portfolio) beat the Nifty by 9.3 points a year. Sizing is tracking conviction.” One caveat: before 2016 only the Nifty’s price index exists, so a holding bought earlier is measured against it, which flatters that holding by the index’s dividend yield, about a point a year.

Year by year

The years are Indian financial years, April to March: the year your capital gains are taxed in and the year companies report in. A year is named for the March it ends in, so FY26 is 1 April 2025 to 31 March 2026. Every financial year from the one with your first counted trade to the current one gets a row, including years with no trades, because the shares you held still earned or lost. Each year is treated as its own small portfolio:

  • Going in: whatever you held at the start, valued at the last close on or before 31 March.
  • During: that year’s purchases, sales and dividends.
  • At the end: what you hold on 31 March, at that day’s close; for the current year, at the latest close.

The year’s XIRR is the return over the row’s own stretch: the value going in counts as money put in on 31 March, the year’s flows as they happened, and the end value as money taken out at the year’s end. The year’s TWRR is chain-linked over the same stretch, and the year’s Nifty runs over the same stretch too. For the current year every column is the return to date, never compounded up to a year: right under the chart the report writes, for example, “FY27 is the year so far (1 Apr 2026 to today): each column is the return over that stretch, not a yearly rate.”

A year your money joined or left part-way measures only the part it was in: if you held nothing going into the year, its row starts on your first trade; if you sold everything before 31 March, it ends on your last sale, and the report names that stretch under the chart. A company with shares at a year’s start or end but no closing price that day is left out of that year’s XIRR, and named.

Why start at the 31 March close and not 1 April’s: the money you carry into a year is worth what it closed at on 31 March. Starting at the 1 April close drops the year’s first trading session; in FY21 that alone would turn the Nifty’s +70.9% into +78.0%, because 1 April 2020 fell 4.0%.

The worked example over three years

The same stock, with one sale added: 1,000 shares at ₹140 on 15 September 2025. The stock closes at ₹132 on 31 March 2026 and at ₹145.20 on 30 September 2026.

YearGoing inDuring the yearAt the endXIRRTWRR
FY25nothingbought ₹1,00,000 + ₹3,00,0003,000 × ₹120 = ₹3,60,000−15.7%+20.0%
FY263,000 × ₹120 = ₹3,60,000sold 1,000 at ₹140 = ₹1,40,0002,000 × ₹132 = ₹2,64,000+15.3%+10.0%
FY27 so far (to 30 Sep 2026)2,000 × ₹132 = ₹2,64,000nothing2,000 × ₹145.20 = ₹2,90,400+10.0%+10.0%

Over the whole window to 30 September 2026 the example reads XIRR +4.2% a year and TWRR +16.1% a year: picks that made 16% a year, money that made 4%, because most of it went in near the top.

When a new year starts. Nothing is stored year by year: every year is rebuilt from your trades and the price history each time the report is built. After 31 March 2027’s closes, FY27 becomes a full year ending at that close, and FY28 appears as the year so far, starting from your holdings at the 31 March close. Past years are not frozen: adding an older tradebook, a corrected price or a missing corporate action changes them, which is the point. A past year is always as right as your trades are today.

What the report can’t see

Each of these, except the last, is named in your report whenever it applies to you.

LimitationWhat it does to the numbers
Returns are before brokerage, STT, stamp duty, exchange charges and GST. A tradebook carries the trade price only.XIRR, TWRR and P&L read slightly better than the money made; most for frequent traders.
Dividends are counted gross, before tax deducted at source, on the ex-date rather than the day they are paid.Dividend income reads a little high above the TDS threshold, and a few weeks early.
Sovereign Gold Bond interest (2.5% a year) is not counted, only the bond’s price.SGB returns read low by the interest.
Shares that never passed through a tradebook: IPO allotments, transfers between demat accounts, gifts, buybacks tendered.A holding goes missing, or a company reads “sold more than bought” and is left out.
Shares bought before your earliest tradebook and still held.Counted short, and nothing in the files can flag it. Upload every year you have.
Mergers and demergers come from a hand-kept list of two.An unknown one leaves the old company out as “sold more than bought”.
Before 2016 the Nifty is the price index only; before September 2007 there is none.The benchmark misses dividends for early windows.
Prices before October 2019 come from a third-party source that drops a delisted company’s history.A company delisted before then has no price, and is left out.
Idle cash in your broker account is not counted (by design).XIRR is the return on money while it was invested in shares, not on the whole account.
Questions

XIRR, TWRR and this calculator

What is the difference between XIRR and TWRR?

XIRR is the return on your money: one yearly rate that weighs every rupee by the days it was actually invested, so it includes when and how much you put in. TWRR is the return of the stocks you held: it ignores the size and timing of your money and measures only how the holdings themselves moved. Put side by side, XIRR answers “what did my money earn?” and TWRR answers “how good were my picks?”.

What is the behaviour gap?

The behaviour gap is TWRR minus XIRR, in percentage points a year. When TWRR is higher, your stocks did better than your money did: when and how much you invested cost you (a behaviour drag). When XIRR is higher, your timing and sizing added to what the stocks earned (a behaviour boost).

Which return should I compare with the Nifty 50?

TWRR, against the Nifty 50 Total Return Index (the index with its dividends reinvested). Both are time-weighted and both include dividends, so the comparison tests stock selection fairly. XIRR against the Nifty mixes your timing with the index’s path: read it as a rough guide, not a verdict.

Why does the calculator not show a yearly rate for less than a year?

A yearly rate exaggerates a short stretch: a 3% rise over two months compounds to about 19% a year. So any stretch shorter than a year is shown as the plain return over that stretch, labelled “since” its start date, and yearly rates start from the first anniversary. This is the rule of the global performance-reporting standard, GIPS.

Why is my XIRR different from the return my broker shows?

Broker screens usually show profit and loss on what you hold today. This XIRR also counts everything you have sold and every dividend, weighs each rupee by the days it was invested, and is worked out before brokerage, taxes and charges. The two answer different questions, so they rarely match.

Which tradebooks does the calculator read?

Tradebooks or order histories from Zerodha, Groww, Upstox, Angel One, ICICI Direct, 5paisa, Kotak and other brokers, as CSV or Excel files. If the columns are not found automatically, you pick them. Add one file per financial year, as many years as you have: trades that appear in two files are counted once.

Are my files or trades saved?

No. Your files are read in your browser. Only the trades are sent, to match each one to its company and price it at that day’s close, and neither step saves anything. Close the page and the report is gone.

What does “sold more than bought” mean?

The files show more shares of a company sold than bought, usually because an older tradebook is missing, or the shares came from an IPO allotment or another demat account. Counting the sale without the purchase would be money from nowhere, so that company is left out of every number and named. Add the older tradebook, or log the missing purchase in Stockport.

Sources: Microsoft, the XIRR function (the 365-day convention) · GIPS Standards (returns for periods under a year are not annualised) · NSE Indices (Nifty 50 and Nifty 50 TRI closes). Stockport is not a SEBI-registered investment adviser; nothing here is investment advice.