Enter the net cash inflow for each year. Leave blank if 0.
Net Present Value
$0.00
How to Calculate NPV with Required Rate of Return
Net Present Value (NPV) is one of the most reliable methods for evaluating the profitability of an investment. It tells you whether an investment will yield a positive return after accounting for the time value of money. The core of this calculation relies heavily on your Required Rate of Return, often called the discount rate or hurdle rate.
The Formula
To calculate NPV manually, you sum the present values of all future cash flows and subtract the initial investment cost. The formula is:
Opportunity Cost: What you could earn by investing elsewhere (e.g., the stock market or bonds).
Inflation: The loss of purchasing power over time.
If you set your rate too low, you might accept unprofitable projects. If you set it too high, you might reject profitable ones.
Example Calculation
Imagine you are considering a business upgrade costing $10,000. You expect it to generate $3,000 per year for 5 years. Your required rate of return is 10%.
Using the calculator above:
Year 1 PV: $3,000 / (1.10)¹ = $2,727.27
Year 2 PV: $3,000 / (1.10)² = $2,479.34
Year 3 PV: $3,000 / (1.10)³ = $2,253.94
Year 4 PV: $3,000 / (1.10)⁴ = $2,049.04
Year 5 PV: $3,000 / (1.10)⁵ = $1,862.76
Sum of PVs: $11,372.35 Less Initial Investment: -$10,000 NPV: $1,372.35
Since the NPV is positive, the investment exceeds your required rate of return and is financially sound.
function calculateNPV() {
// 1. Get Inputs
var investmentInput = document.getElementById('npv-investment');
var rateInput = document.getElementById('npv-rate');
var investment = parseFloat(investmentInput.value);
var rate = parseFloat(rateInput.value);
// Validation
if (isNaN(investment)) {
alert("Please enter a valid Initial Investment.");
return;
}
if (isNaN(rate)) {
alert("Please enter a valid Required Rate of Return.");
return;
}
// 2. Prepare Calculation Variables
var decimalRate = rate / 100;
var totalPV = 0;
var cashFlows = [];
// 3. Loop through 5 years of inputs
for (var i = 1; i <= 5; i++) {
var flowInput = document.getElementById('npv-year-' + i);
var flowVal = parseFloat(flowInput.value);
// Treat empty inputs as 0, but only if user didn't enter anything
if (isNaN(flowVal)) flowVal = 0;
cashFlows.push({
year: i,
amount: flowVal
});
}
// 4. Build Result HTML Table
var tableHTML = '
Year
Cash Flow
Discount Factor
Present Value
';
// Add Year 0 (Investment)
tableHTML += '
0 (Now)
' + formatCurrency(-investment) + '
1.0000
' + formatCurrency(-investment) + '
';
// 5. Calculate PV for each year
for (var j = 0; j < cashFlows.length; j++) {
var t = cashFlows[j].year;
var cf = cashFlows[j].amount;
// Formula: PV = CF / (1 + r)^t
var discountFactor = 1 / Math.pow((1 + decimalRate), t);
var pv = cf * discountFactor;
totalPV += pv;
// Add row to table
tableHTML += '
';
tableHTML += '
' + t + '
';
tableHTML += '
' + formatCurrency(cf) + '
';
tableHTML += '
' + discountFactor.toFixed(4) + '
';
tableHTML += '
' + formatCurrency(pv) + '
';
tableHTML += '
';
}
// 6. Final Calculation
var npv = totalPV – investment;
tableHTML += '
';
// 7. Display Results
var resultBox = document.getElementById('npv-result');
var displayValue = document.getElementById('npv-display-value');
var verdictText = document.getElementById('npv-verdict-text');
var tableContainer = document.getElementById('npv-table-container');
resultBox.style.display = 'block';
displayValue.innerHTML = formatCurrency(npv);
tableContainer.innerHTML = tableHTML;
// Styling based on positive/negative
if (npv > 0) {
displayValue.className = "npv-final-value"; // Green default
verdictText.innerHTML = "Good Investment: NPV is Positive";
verdictText.style.backgroundColor = "#d4edda";
verdictText.style.color = "#155724";
} else if (npv < 0) {
displayValue.className = "npv-final-value negative";
verdictText.innerHTML = "Bad Investment: NPV is Negative";
verdictText.style.backgroundColor = "#f8d7da";
verdictText.style.color = "#721c24";
} else {
displayValue.className = "npv-final-value";
displayValue.style.color = "#856404";
verdictText.innerHTML = "Neutral: NPV is Zero (Breakeven)";
verdictText.style.backgroundColor = "#fff3cd";
verdictText.style.color = "#856404";
}
}
function formatCurrency(num) {
return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(num);
}