Enter the initial cost as a positive number. Logic will treat this as an outflow.
Enter the net cash income for each year, separated by commas.
Internal Rate of Return (IRR)
0.00%
What is Internal Rate of Return (IRR)?
The Internal Rate of Return (IRR) is a fundamental metric used in financial analysis to estimate the profitability of potential investments. Specifically, IRR is the annual compound growth rate that an investment is expected to generate. Mathematically, it is the discount rate that makes the Net Present Value (NPV) of all cash flows (both positive and negative) from a specific project equal to zero.
Investors and businesses use IRR to compare different investment opportunities. Generally, the higher the IRR, the more desirable the investment.
How to Calculate IRR
Unlike simple interest or standard growth calculations, the IRR cannot be found using a simple closed-form algebraic formula. It requires an iterative numerical method (such as the Newton-Raphson method used by this calculator) to solve for the rate ($r$) in the following equation:
C₁, C₂, etc.: Net Cash Flows for each period (Cash Inflows)
r: The Internal Rate of Return
n: The time period
Real-World Example
Suppose you are considering investing in a new piece of machinery. The details are as follows:
Period
Cash Flow
Description
Year 0
-$50,000
Initial purchase cost
Year 1
$15,000
Net profit generated
Year 2
$15,000
Net profit generated
Year 3
$15,000
Net profit generated
Year 4
$15,000
Net profit generated
By entering an Initial Investment of 50000 and Cash Flows of 15000, 15000, 15000, 15000 into the calculator, you would find an IRR of approximately 7.71%. If your cost of capital (the interest rate you pay to borrow money) is 5%, this is a profitable investment.
Interpreting the Results
When using this Free Internal Rate of Return Calculator, keep the following guidelines in mind:
Positive IRR: Indicates the project is expected to generate a return.
Compare to WACC: Always compare the IRR to your Weighted Average Cost of Capital (WACC) or Hurdle Rate. If IRR > Cost of Capital, the project adds value.
Time Horizon: Ensure all cash flows entered correspond to consistent time periods (usually annual).
function calculateIRR() {
// 1. Get Elements
var initialInvInput = document.getElementById("initialInvestment");
var cashFlowsInput = document.getElementById("cashFlows");
var resultContainer = document.getElementById("resultContainer");
var irrValueDisplay = document.getElementById("irrValue");
var irrSummaryDisplay = document.getElementById("irrSummary");
var errorDisplay = document.getElementById("irrErrorMessage");
// 2. Reset Display
resultContainer.style.display = "none";
errorDisplay.style.display = "none";
errorDisplay.innerHTML = "";
// 3. Parse Initial Investment
var initialInvestment = parseFloat(initialInvInput.value);
if (isNaN(initialInvestment) || initialInvestment <= 0) {
showError("Please enter a valid positive number for the Initial Investment.");
return;
}
// 4. Parse Cash Flows
var flowString = cashFlowsInput.value;
if (!flowString.trim()) {
showError("Please enter at least one future cash flow.");
return;
}
// Split by comma, filter out empty strings, convert to numbers
var flowArrayStr = flowString.split(',');
var cashFlows = [];
for (var i = 0; i investment).");
} else {
var percentage = (irr * 100).toFixed(2);
irrValueDisplay.innerHTML = percentage + "%";
var totalInflow = cashFlows.reduce(function(a, b) { return a + b; }, 0);
var profit = totalInflow – initialInvestment;
irrSummaryDisplay.innerHTML = "Based on an investment of $" + initialInvestment.toLocaleString() +
" and total inflows of $" + totalInflow.toLocaleString() + " over " +
cashFlows.length + " periods.";
resultContainer.style.display = "block";
}
}
function showError(msg) {
var errorDisplay = document.getElementById("irrErrorMessage");
errorDisplay.innerHTML = msg;
errorDisplay.style.display = "block";
}
// Numerical Method Logic (Newton-Raphson)
function computeIRR(values, guess) {
// Default guess
if (typeof guess === 'undefined') guess = 0.1;
// Limits
var maxIterations = 1000;
var precision = 0.0000001;
for (var i = 0; i < maxIterations; i++) {
var npv = 0;
var derivative = 0;
for (var j = 0; j < values.length; j++) {
var val = values[j];
var time = j;
// NPV formula term: val / (1+r)^t
var denominator = Math.pow(1 + guess, time);
npv += val / denominator;
// Derivative of NPV with respect to r
// d/dr [ C * (1+r)^-t ] = C * -t * (1+r)^(-t-1)
// = -t * val / (1+r)^(t+1)
var derivDenominator = Math.pow(1 + guess, time + 1);
derivative -= (time * val) / derivDenominator;
}
// If derivative is 0, we can't continue (divide by zero)
if (Math.abs(derivative) < precision) {
return "Error";
}
var newGuess = guess – (npv / derivative);
// Check convergence
if (Math.abs(newGuess – guess) < precision) {
return newGuess;
}
guess = newGuess;
}
return "Error"; // Did not converge
}