XIRR calculator: your portfolio’s money-weighted return
Enter the money you put into your portfolio and the money you took out, each with its date, plus what the portfolio is worth now. You get your return as a yearly rate (XIRR), the money you made, and your total return.
Your deposits and withdrawals
One row per transfer between your bank and the investment account. Leave out buys and sells. The example below is filled in so you can see a result; replace it with your own numbers. Use one currency throughout. Have a list in a spreadsheet? Use Paste rows.
What the portfolio is worth
The whole account, cash included, on the date you pick. Enter 0 if you have emptied it.
Your result
Your rate per year (XIRR)
—
Money-weighted: counts when each deposit and withdrawal happened
Money made
—
Value + withdrawals − deposits
Total return
—
Money made ÷ net deposits
Worked out in your browser. What you type is not sent anywhere and not saved.
What XIRR measures
XIRR (extended internal rate of return) is your annualized return: the single yearly rate that turns every deposit you made, each from its own date, into what you took out plus what you have today. A deposit made four years ago has had four years to grow. A deposit made last month has had a month. XIRR gives each one credit only for the time it was invested.
That is why it is called a money-weighted return. The years when more of your money was invested count for more. If your biggest deposit landed just before a fall, XIRR shows it. If it landed just before a rise, XIRR shows that too.
The calculator finds the rate r that makes this sum equal zero, with deposits as negative amounts, withdrawals and the current value as positive amounts, and d as the number of days since the first deposit:
Σ amounti ÷ (1 + r)di ÷ 365 = 0
There is no closed formula for r, so it is solved step by step. This page uses Newton’s method and falls back to bisection, a slower but steadier search, when Newton’s method does not settle.
Why a deposit is not a gain
Say your account holds 10,000 of your money in January. In March you add another 15,000. In December it shows 26,000.
The balance rose by 16,000, and 15,000 of that was your own money arriving. The market made you 1,000. A return that compares the December balance with the January one would report +160%. What you actually made is 1,000 on the 25,000 you put in: a total return of 4%.
The same mistake runs the other way with withdrawals. Take 5,000 out to pay for a car and the balance drops by 5,000, but you lost nothing. That is why the calculator asks for every transfer in and out. Money made here is always:
money made = current value + withdrawals − deposits
Worked example: same money, different timing
Three investors each put 20,000 into their own account over two years. On 1 January 2025 each account is worth 23,000. Each made 3,000, a total return of 15%. Their XIRR differs because their money was invested for different lengths of time.
| Investor | Deposit 1 Jan 2023 | Deposit 1 Jan 2024 | XIRR |
|---|---|---|---|
| Investor A | 20,000 | 0 | +7.23% / yr |
| Investor B | 10,000 | 10,000 | +9.67% / yr |
| Investor C | 5,000 | 15,000 | +11.70% / yr |
Investor A had all 20,000 working for two full years, so 3,000 is a modest result: about 7.2% a year. Investor C had only 5,000 working in the first year. Making the same 3,000 with less money for less time is a better result, and XIRR says so: about 11.7% a year.
You can check Investor B in the calculator above. Press Clear all, then add two deposits of 10,000 dated 1 January 2023 and 1 January 2024, and set the value to 23,000 on 1 January 2025.
Why your broker’s number can be different
If the figure here does not match the return on your broker’s screen, the two are probably measuring different things. Check these first:
- Open positions only. A gain shown against the cost of what you hold now leaves out shares you have already sold, and often the dividends you received.
- A total, not a rate per year. +15% over two years is about 7.2% a year. Compare a total with a total and a yearly rate with a yearly rate.
- A different period. This year, the last 12 months and since the account opened give three different answers.
- A different currency. An account reported in US dollars can show a gain while the same money, counted in euros or pounds, shows less, or a loss.
- Missing transfers. If you leave a deposit out here, the calculator counts it as profit. If you list one twice, it counts as a loss.
How to get the inputs right
- Deposits: every transfer from your bank into the investment account, on the date it arrived. Interactive Brokers users can list their deposits and withdrawals with an Activity Flex Query (Cash Transactions section, up to 365 days per run): see how to set up an IBKR Flex Query. IBKR lists a deposit as a positive amount, so tick “Deposits are positive” when you paste its rows.
- Withdrawals: every transfer out of the account to you.
- Buys and sells: leave them out. They move money between cash and shares inside the account, and the portfolio value already reflects them.
- Dividends and interest: leave them out while they stay in the account; they are part of the value. If they were paid out to your bank, enter each payment as a withdrawal.
- Fees and taxes charged in the account: leave them out. They lower the value, which is how they should count.
- Shares moved in or out: enter their market value on the transfer date, as a deposit when they come in and as a withdrawal when they leave.
- Several accounts: enter all their transfers and their combined value for one overall rate, or run each account on its own. Leave out transfers between your own accounts.
In Excel or Google Sheets, the same calculation is =XIRR(B2:B10, A2:A10), with dates in column A and amounts in column B. Type deposits as negative numbers, and withdrawals and the current value as positive numbers.
Stock Stats for iPhone
Your rate per year, kept up to date for your whole portfolio
A calculator gives you one number for one day. Stock Stats works out the same money-weighted rate from your own transactions and keeps it current as prices move. A deposit never counts as a gain.
- Your rate per year (XIRR) and money made for the last month, this year, the last 12 months or since you started, and for each holding.
- Bring transactions in by Interactive Brokers sync with a read-only Flex token, by CSV import with presets for Interactive Brokers, Schwab and Fidelity, or by hand.
- No account. Your portfolio stays on your iPhone.
- The rate per year and money made are in the free version. Pro adds a comparison that runs your own deposits and withdrawals, on the same dates, through the S&P 500, Nasdaq 100 or an All-World index. Pro is free to try for 14 days.
XIRR questions
What is the difference between IRR and XIRR?
IRR is the internal rate of return. It assumes every cash flow is the same length of time apart, such as once a year. XIRR uses the actual date of each one. Deposits into a brokerage account rarely arrive on a fixed schedule, so XIRR is the one to use for a portfolio.
What is the difference between XIRR and CAGR?
CAGR, the compound annual growth rate, is the yearly growth rate from one starting amount to one ending amount. It has no place for money added or taken out along the way. With a single deposit and no withdrawals, CAGR and XIRR give the same number. Once you add money more than once, XIRR counts each deposit only for the time it was invested, and CAGR cannot.
Is XIRR the same as a money-weighted return?
Yes. XIRR is the money-weighted return worked out with real dates and expressed per year. It is also called a dollar-weighted return. It measures the money you actually had invested, for as long as you had it invested.
Why is my XIRR so high or so low over a short period?
XIRR is a yearly rate. Over a few weeks it scales a small result up to a full year. A 2% gain in 30 days works out to about 27% a year. Under a year, the money made and the total return are the steadier numbers to read.
Can XIRR be negative?
Yes. A negative XIRR means your money shrank, after allowing for when you put it in. The more of it was lost, the closer the rate gets to −100% a year. If everything is gone and nothing was withdrawn, there is no rate to find, and the calculator says so.
Do I enter dividends and fees?
Not if they stay in the account. Dividends that stay in the account raise its value, and fees charged in the account lower it, so the portfolio value already counts both. Enter a dividend only if it was paid out to your bank, and then enter it as a withdrawal.
To track dividend income itself, see the dividend tracker.
Does this calculator match XIRR in Excel or Google Sheets?
It solves the same equation, with each amount discounted over a 365-day year as Microsoft documents for Excel’s XIRR. In a spreadsheet you type deposits as negative numbers and withdrawals and the current value as positive numbers. For ordinary cash flows the results agree to the decimals shown here.
Why does the calculator show no yearly rate?
XIRR needs at least one deposit, something coming back (a withdrawal or a portfolio value above zero), and time between the first deposit and the value date. If every amount is on one day, or the value is zero with no withdrawals, there is no yearly rate to find. A very large gain or loss over a few days or weeks also has no meaningful yearly rate, because stretching it to 12 months gives a number beyond +1,000,000% or close to −100%. The calculator says which case applies.
Is anything I enter stored or sent?
No. The calculation runs in your browser. The dates and amounts you type are not sent anywhere and are not saved. Reloading the page brings back the example.