Enter the total cost as a positive number (the formula will treat it as an outflow).
Separate each period's cash flow with a comma (e.g., Year 1, Year 2, Year 3).
This rate makes the Net Present Value (NPV) of these cash flows equal to zero.
What is the Internal Rate of Return (IRR)?
The Internal Rate of Return (IRR) is a critical financial metric used in capital budgeting to estimate the profitability of potential investments. It is the discount rate that makes the Net Present Value (NPV) of all cash flows from a particular project equal to zero. In simpler terms, it is the expected compound annual rate of return that will be earned on a project or investment.
How the IRR Calculation Works
Unlike simple interest or ROI calculations, IRR accounts for the time value of money. The formula solves for "r" in the following equation:
Realistic Example:
Suppose you invest $50,000 in a small business. Over the next four years, you receive cash returns of $12,000, $15,000, $18,000, and $22,000. Using this calculator, you would find the IRR is approximately 11.23%. If your cost of capital is 8%, this project is considered a good investment because the IRR exceeds the cost of capital.
Interpreting the Results
Generally, when comparing multiple investment options, the project with the highest IRR is considered the most desirable, provided it meets the minimum required rate of return (hurdle rate). It is widely used for:
Comparing the efficiency of different capital projects.
Determining if a stock buyback is a good use of corporate funds.
Evaluating private equity performance.
Note: IRR assumes that all interim cash flows are reinvested at the same rate as the IRR itself. If this is unrealistic, some analysts prefer using the Modified Internal Rate of Return (MIRR).
function performIrrCalculation() {
var initialCost = parseFloat(document.getElementById('initialCost').value);
var flowsInput = document.getElementById('periodicFlows').value;
var resultBox = document.getElementById('irrResultBox');
var output = document.getElementById('irrOutput');
if (isNaN(initialCost) || flowsInput.trim() === "") {
alert("Please enter a valid initial investment and at least one cash flow.");
return;
}
// Convert string input to array of numbers
var flowArray = flowsInput.split(',').map(function(item) {
return parseFloat(item.trim());
});
// Check for valid numbers in array
for (var i = 0; i < flowArray.length; i++) {
if (isNaN(flowArray[i])) {
alert("One or more cash flow values are invalid. Please use numbers separated by commas.");
return;
}
}
// Prepend the initial investment as a negative value (outflow)
var cashFlows = [-Math.abs(initialCost)].concat(flowArray);
// Newton-Raphson method to solve for IRR
var guest = 0.1; // Initial guess of 10%
var maxIterations = 1000;
var precision = 0.0000001;
var resultFound = false;
for (var j = 0; j < maxIterations; j++) {
var npv = 0;
var derivativeNpv = 0;
for (var t = 0; t 0) {
derivativeNpv -= t * cashFlows[t] / Math.pow(1 + guest, t + 1);
}
}
var nextGuest = guest – (npv / derivativeNpv);
if (Math.abs(nextGuest – guest) < precision) {
guest = nextGuest;
resultFound = true;
break;
}
guest = nextGuest;
}
if (resultFound && isFinite(guest)) {
var finalIrr = (guest * 100).toFixed(2);
resultBox.style.display = "block";
output.innerHTML = finalIrr + "%";
} else {
resultBox.style.display = "block";
output.innerHTML = "Calculation Error";
output.style.fontSize = "20px";
alert("Could not converge on a solution. Please check your numbers. Ensure you have both negative (initial) and positive cash flows.");
}
}