Free XIRR calculator for Zerodha — handles stock splits, bonus shares, corporate actions automatically

Console shows absolute P&L but doesn’t give you a proper annualized XIRR that correctly accounts for corporate actions. I built a free tool to fix that.

What it does:

  • Upload your Zerodha tradebook CSVs (download from Console → Reports → Tradebook)
  • Optionally upload Tax P&L XLSX to include dividends as cash inflows
  • Get your portfolio XIRR instantly — overall and per-symbol breakdown
  • Automatically handles stock splits, bonus shares, rights issues, mergers/demergers (HDFC Bank merger, Tata Motors DVR, Vodafone Idea splits etc.)
  • Validates your current holdings quantity against what the tradebook implies — flags mismatches
  • Works for multiple Zerodha accounts simultaneously

No signup. No data stored. Files are processed locally and discarded.

Link: https://xirr.veloxlab.dev/

Would love feedback from the community — especially if you hit a corporate action that isn’t handled correctly. Happy to add it.

Feedback: I am getting unrealistic number also even after uploading docs p&l are not matching. Maybe need to fix it

1 Like

Thank you for your valuable feedback. Will review it.

Hi, thanks for the feedback — both issues are confirmed and addressed.

The unrealistic XIRR (e.g. 59,641,404%)

This is a bug in how per-symbol XIRR is displayed. XIRR is an annualised rate, so a stock bought and sold within just 1–2 days — even with a completely ordinary daily move — produces a mathematically valid but meaningless annual figure. For example, a 4% gain held for a single day annualises to roughly 165,000,000%. The engine was passing that number straight to the table.

After the fix, any symbol whose annualised XIRR exceeds 50,000% (which is still ~55× higher than the best realistic equity return of ~900% for a true 10-bagger in one year) is moved out of the table and into the Flagged Symbols panel with the message: “XIRR unreliable — extremely short holding period or dividend recorded before earliest buy.”

The P&L mismatch

Two possible causes:

  1. Cost basis method — This tool uses weighted-average cost (WAVG). Zerodha’s platform uses FIFO. For stocks with multiple partial buys the numbers will legitimately differ. This is by design.
  2. Incomplete tradebook upload — If you uploaded only recent tradebook files but originally bought the stock earlier, the earlier buy records are missing and the cost basis will be wrong. Fix: upload all tradebook years that cover your full holding period for each symbol.

Both fixes are live. If the P&L is still off after uploading all years, share the symbol and trade details and I’ll take a closer look.

1 Like