{
  "id": "irr",
  "version": "e1e21beb7f2f",
  "status": "published",
  "name": "IRR Calculator",
  "question": "What is my IRR (rate of return)?",
  "summary": "Computes the internal rate of return (IRR) of an investment as a yearly rate, from regular cash flows or from dated cash flows (XIRR), and the NPV at a discount rate.",
  "category": "finance",
  "subcategory": "investing",
  "url": "https://www.acalculator.org/finance/irr-calculator",
  "markdown": "https://www.acalculator.org/finance/irr-calculator.md",
  "kind": "function",
  "method": "Find the yearly rate r with Σ CFₜ ÷ (1 + r)^t = 0, where t is each cash flow’s time in years (days ÷ 365 for dated flows).",
  "assumptions": [
    "The IRR is a yearly rate compounded once a year (an effective annual rate), for regular and dated flows alike.",
    "Regular flows: the investment is paid at the start, the ending balance comes back at the end, and a recurring amount is paid every period at its start or end. A period that does not fit in the holding period is left out.",
    "Dated flows count time from the earliest date in days ÷ 365, as spreadsheet XIRR does.",
    "When the flows change sign more than once, several rates can fit; the one closest to 0 is shown and the note lists the others.",
    "Rates are searched with 1 + r from 0.000001 to 1,000,000 (−99.9999% to 99,999,900% a year); a rate outside that range is not found.",
    "Payments at the same time are added together before money put in and money back are counted.",
    "The NPV discounts every flow to the start at the discount rate, per year."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "cashFlowType": {
        "title": "Cash flows",
        "description": "Regular: an investment, an optional recurring amount, and an ending balance. Dated: any amounts on any dates (XIRR).",
        "type": "string",
        "enum": [
          "fixed",
          "irregular"
        ]
      },
      "investment": {
        "title": "Initial investment",
        "description": "The amount paid in at the start.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000
      },
      "endingBalance": {
        "title": "Ending balance",
        "description": "What the investment is worth, or pays back, at the end of the holding period.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "holdingYears": {
        "title": "Holding period: years",
        "description": "The whole years from the start to the ending balance.",
        "type": "integer",
        "minimum": 0,
        "maximum": 60
      },
      "holdingMonths": {
        "title": "and months",
        "description": "Extra months on top of the years.",
        "type": "integer",
        "minimum": 0,
        "maximum": 11
      },
      "recurringAmount": {
        "title": "Recurring amount",
        "description": "An amount withdrawn from, or added to, the investment every period.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "recurringType": {
        "title": "The recurring amount is",
        "description": "Withdraw: you take the amount out (money back to you). Deposit: you add it (more money in).",
        "type": "string",
        "enum": [
          "withdraw",
          "deposit"
        ]
      },
      "recurringFrequency": {
        "title": "How often?",
        "description": "How often the recurring amount is paid.",
        "type": "string",
        "enum": [
          "annually",
          "semiannually",
          "quarterly",
          "monthly",
          "semimonthly",
          "biweekly",
          "weekly"
        ]
      },
      "recurringTiming": {
        "title": "Paid at the",
        "description": "Whether each recurring amount is paid at the start or at the end of its period.",
        "type": "string",
        "enum": [
          "beginning",
          "end"
        ]
      },
      "flows": {
        "title": "Dated cash flows",
        "description": "Each payment with its date: a negative amount for money you put in, a positive amount for money you get back.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "title": "Date",
              "description": "The day of the payment.",
              "type": "string",
              "format": "date"
            },
            "amount": {
              "title": "Amount",
              "description": "Negative for money in, positive for money back.",
              "type": "number",
              "x-unit": "USD",
              "minimum": -1000000000000,
              "maximum": 1000000000000
            }
          }
        }
      },
      "discountRate": {
        "title": "Discount rate",
        "description": "A yearly rate to discount the flows at, for the net present value.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 1000
      }
    }
  },
  "outputs": {
    "irr": {
      "label": "Internal rate of return (per year)",
      "description": "The yearly rate, compounded once a year, at which the net present value of the cash flows is 0.",
      "format": "percent"
    },
    "periodRate": {
      "label": "Rate per period",
      "description": "The same return per recurring period: (1 + IRR)^(1 ÷ periods per year) − 1.",
      "format": "percent"
    },
    "npv": {
      "label": "Net present value",
      "description": "Every cash flow discounted to the start at the discount rate, added up.",
      "format": "money"
    },
    "moneyIn": {
      "label": "Money put in",
      "description": "All payments into the investment, added up.",
      "format": "money"
    },
    "moneyBack": {
      "label": "Money back",
      "description": "All payments back to you, added up.",
      "format": "money"
    },
    "profit": {
      "label": "Profit",
      "description": "Money back minus money put in, before discounting.",
      "format": "money"
    },
    "warning": {
      "label": "Note",
      "description": "A note when the cash flows change sign more than once, so more than one IRR can fit.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "cashFlowType": "fixed",
      "investment": 10000,
      "endingBalance": 15000,
      "holdingYears": 2,
      "holdingMonths": 6,
      "recurringAmount": 100,
      "recurringType": "withdraw",
      "recurringFrequency": "monthly",
      "recurringTiming": "end",
      "discountRate": 10
    },
    "outputs": {
      "irr": 29.76829616999195,
      "periodRate": 2.19525152088118,
      "npv": 4478.558372450313,
      "moneyIn": 10000,
      "moneyBack": 18000,
      "profit": 8000
    },
    "text": "The internal rate of return is 29.77% a year: $10,000.00 put in and $18,000.00 back."
  },
  "examples": [
    {
      "given": {
        "cashFlowType": "fixed",
        "investment": 10000,
        "endingBalance": 15000,
        "holdingYears": 2,
        "holdingMonths": 6,
        "recurringAmount": 100,
        "recurringType": "withdraw",
        "recurringFrequency": "monthly",
        "recurringTiming": "end",
        "discountRate": 10
      },
      "expect": {
        "irr": 29.768296169991938,
        "periodRate": 2.1952515208811807,
        "npv": 4478.558372450312,
        "moneyIn": 10000,
        "moneyBack": 18000
      },
      "source": "IRR definition NPV(r) = 0 (Brealey, Myers, Allen, Principles of Corporate Finance, ch. 5), solved by bisection in Python (docs/progress/WP-22/python/examples.py); hand calculation in content.mdx; Microsoft Support, XIRR function (dated cash flows, 365-day year, example result 0.373362535). https://support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d",
      "tolerance": 1e-8
    },
    {
      "given": {
        "cashFlowType": "fixed",
        "investment": 4000,
        "endingBalance": 2000,
        "holdingYears": 2,
        "holdingMonths": 0,
        "recurringAmount": 2000,
        "recurringType": "withdraw",
        "recurringFrequency": "annually",
        "recurringTiming": "end"
      },
      "expect": {
        "irr": 28.077640640441516,
        "periodRate": 28.077640640441516
      },
      "source": "Brealey, Myers, Allen, Principles of Corporate Finance, ch. 5: C0 = −4,000, C1 = +2,000, C2 = +4,000 gives IRR = 28.08%; exact root of a quadratic in content.mdx; Microsoft Support, XIRR function (dated cash flows, 365-day year, example result 0.373362535). https://support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d",
      "tolerance": 1e-9
    },
    {
      "given": {
        "cashFlowType": "irregular",
        "flows": [
          {
            "date": "2008-01-01",
            "amount": -10000
          },
          {
            "date": "2008-03-01",
            "amount": 2750
          },
          {
            "date": "2008-10-30",
            "amount": 4250
          },
          {
            "date": "2009-02-15",
            "amount": 3250
          },
          {
            "date": "2009-04-01",
            "amount": 2750
          }
        ]
      },
      "expect": {
        "irr": 37.33625335188314,
        "moneyIn": 10000,
        "profit": 3000
      },
      "source": "Microsoft Support, XIRR function example: 0.373362535 (37.34%); Python bisection gives 0.3733625335; Microsoft Support, XIRR function (dated cash flows, 365-day year, example result 0.373362535). https://support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d",
      "tolerance": 1e-8
    },
    {
      "given": {
        "cashFlowType": "fixed",
        "investment": 10000,
        "endingBalance": 11000,
        "holdingYears": 1,
        "holdingMonths": 0,
        "recurringAmount": 0,
        "recurringType": "withdraw",
        "recurringFrequency": "monthly",
        "recurringTiming": "end"
      },
      "expect": {
        "irr": 10
      },
      "source": "hand calculation in content.mdx: 11,000 ÷ 10,000 − 1; Microsoft Support, XIRR function (dated cash flows, 365-day year, example result 0.373362535). https://support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d",
      "tolerance": 1e-12
    },
    {
      "given": {
        "cashFlowType": "fixed",
        "investment": 10000,
        "endingBalance": 12000,
        "holdingYears": 3,
        "holdingMonths": 0,
        "recurringAmount": 500,
        "recurringType": "withdraw",
        "recurringFrequency": "annually",
        "recurringTiming": "beginning"
      },
      "expect": {
        "irr": 11.530306771488751
      },
      "source": "flows −9,500 at 0, +500 at years 1 and 2, +12,000 at year 3, solved in Python; content.mdx; Microsoft Support, XIRR function (dated cash flows, 365-day year, example result 0.373362535). https://support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d",
      "tolerance": 1e-8
    },
    {
      "given": {
        "cashFlowType": "fixed",
        "investment": 1000,
        "endingBalance": 800,
        "holdingYears": 0,
        "holdingMonths": 7,
        "recurringAmount": 10,
        "recurringType": "withdraw",
        "recurringFrequency": "weekly",
        "recurringTiming": "end"
      },
      "expect": {
        "irr": 20.851077329224744,
        "moneyBack": 1100
      },
      "source": "flows −1,000 at 0, +10 at k/52 years for k = 1 to 30, +800 at 7/12 years, solved in Python; content.mdx; Microsoft Support, XIRR function (dated cash flows, 365-day year, example result 0.373362535). https://support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d",
      "tolerance": 1e-8
    },
    {
      "given": {
        "cashFlowType": "fixed",
        "investment": 5000,
        "endingBalance": 5000,
        "holdingYears": 2,
        "holdingMonths": 6,
        "recurringAmount": 200,
        "recurringType": "withdraw",
        "recurringFrequency": "semiannually",
        "recurringTiming": "end"
      },
      "expect": {
        "irr": 8.16,
        "periodRate": 4
      },
      "source": "hand calculation in content.mdx: 200 every half year on 5,000 is 4% a half year; 1.04^2 − 1 = 8.16%; Microsoft Support, XIRR function (dated cash flows, 365-day year, example result 0.373362535). https://support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d",
      "tolerance": 1e-9
    },
    {
      "given": {
        "cashFlowType": "fixed",
        "investment": 5000,
        "endingBalance": 7000,
        "holdingYears": 1,
        "holdingMonths": 0,
        "recurringAmount": 50,
        "recurringType": "deposit",
        "recurringFrequency": "semimonthly",
        "recurringTiming": "beginning"
      },
      "expect": {
        "irr": 14.25592955937779,
        "moneyIn": 6200
      },
      "source": "flows −5,050 at 0, −50 at k/24 years for k = 1 to 23, +7,000 at 1 year, solved in Python; content.mdx; Microsoft Support, XIRR function (dated cash flows, 365-day year, example result 0.373362535). https://support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d",
      "tolerance": 1e-8
    }
  ],
  "sources": [
    "Internal rate of return and net present value: R. A. Brealey, S. C. Myers, F. Allen, Principles of Corporate Finance, chapter 5 (the −4,000, +2,000, +4,000 example, IRR = 28.08%).",
    "Microsoft Support, XIRR function (dated cash flows, 365-day year, example result 0.373362535). https://support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d",
    "Multiple internal rates of return and Descartes’ rule of signs: S. A. Broverman, Mathematics of Investment and Credit, chapter 5."
  ],
  "related": [
    "cagr",
    "cap-rate"
  ],
  "changelog": [
    {
      "date": "2026-09-29",
      "note": "Worked examples name a published reference for their rule."
    }
  ]
}
