Calculate the Net Present Value of future cash flows.
Enter as a positive number (calculator handles the subtraction).
Future Cash Flows
Net Present Value (NPV)
$0.00
Understanding the Net Present Value (NPV) and Discount Rate
When evaluating investment opportunities, understanding the time value of money is crucial. Money available today is worth more than the same amount in the future due to its potential earning capacity. The Net Present Value (NPV) Calculator is an essential financial tool used to evaluate the profitability of an investment or project by discounting future cash flows back to their present value.
What is the Discount Rate?
The Discount Rate is the core engine of NPV analysis. It represents the interest rate used to determine the present value of future cash flows. Depending on the context, the discount rate may refer to:
Cost of Capital: The cost of funds used for financing a business (Weighted Average Cost of Capital or WACC).
Hurdle Rate: The minimum rate of return required by a company or investor for a project to be accepted.
Risk-Free Rate + Risk Premium: A baseline rate adjusted for the specific risks of the investment.
A higher discount rate implies higher risk or a higher alternative opportunity cost, which significantly lowers the present value of future cash flows.
The NPV Formula
The Net Present Value is calculated using the following mathematical formula:
NPV = Σ [ Rt / (1 + i)^t ] – C0
Where:
Rt = Net cash inflow-outflows during a single period t
i = Discount rate or return that could be earned in alternative investments
t = Number of time periods
C0 = Initial Investment (negative cash flow at t=0)
How to Interpret the Results
Once you input your initial investment, the discount rate, and projected annual cash flows, the calculator provides the NPV. Here is how to interpret the output:
Positive NPV (> 0): The projected earnings (in present dollars) exceed the anticipated costs. The investment is generally considered profitable and should be accepted.
Negative NPV (< 0): The project is expected to result in a net loss. The return is lower than the discount rate, and the project should likely be rejected.
Zero NPV (= 0): The project is expected to exactly break even. The return equals the discount rate.
Why the Discount Rate Changes NPV
Sensitivity analysis often involves changing the discount rate to see how it affects NPV. If you increase the discount rate input in the calculator, the NPV will decrease. This reflects the reality that if your required return is higher (due to inflation or risk), future money is "worth less" to you today.
function calculateNPV() {
// Get inputs
var initialInv = parseFloat(document.getElementById('initialInvestment').value);
var discountRate = parseFloat(document.getElementById('discountRate').value);
// Cash flows array
var cf1 = parseFloat(document.getElementById('cf1').value) || 0;
var cf2 = parseFloat(document.getElementById('cf2').value) || 0;
var cf3 = parseFloat(document.getElementById('cf3').value) || 0;
var cf4 = parseFloat(document.getElementById('cf4').value) || 0;
var cf5 = parseFloat(document.getElementById('cf5').value) || 0;
var terminalVal = parseFloat(document.getElementById('terminalValue').value) || 0;
// Validation
if (isNaN(initialInv)) {
alert("Please enter a valid Initial Investment.");
return;
}
if (isNaN(discountRate)) {
alert("Please enter a valid Discount Rate.");
return;
}
// Calculation Logic
// NPV = Sum (Cash Flow / (1+r)^t) – Initial Investment
var r = discountRate / 100;
var presentValueTotal = 0;
// Calculate PV for each year
presentValueTotal += cf1 / Math.pow((1 + r), 1);
presentValueTotal += cf2 / Math.pow((1 + r), 2);
presentValueTotal += cf3 / Math.pow((1 + r), 3);
presentValueTotal += cf4 / Math.pow((1 + r), 4);
// Year 5 usually includes the operating cash flow + any terminal value
presentValueTotal += (cf5 + terminalVal) / Math.pow((1 + r), 5);
var npv = presentValueTotal – initialInv;
// Display Results
var resultArea = document.getElementById('result-area');
var npvDisplay = document.getElementById('npvResult');
var npvComment = document.getElementById('npvComment');
resultArea.style.display = 'block';
// Format currency
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
npvDisplay.innerHTML = formatter.format(npv);
// Styling and Commentary based on result
if (npv > 0) {
npvDisplay.style.color = "#27ae60"; // Green
resultArea.style.backgroundColor = "#e8f6f3";
resultArea.style.borderColor = "#a3e4d7";
npvComment.innerHTML = "Result: Profitable InvestmentThe project return exceeds the " + discountRate + "% discount rate.";
} else if (npv < 0) {
npvDisplay.style.color = "#c0392b"; // Red
resultArea.style.backgroundColor = "#f9e79f"; // Light Warning Yellow/Red tint
resultArea.style.borderColor = "#f5b7b1";
npvComment.innerHTML = "Result: Unprofitable InvestmentThe project return is lower than the " + discountRate + "% discount rate.";
} else {
npvDisplay.style.color = "#7f8c8d"; // Grey
resultArea.style.backgroundColor = "#f4f6f7";
resultArea.style.borderColor = "#bdc3c7";
npvComment.innerHTML = "Result: Break Even";
}
}
function resetCalculator() {
document.getElementById('initialInvestment').value = ";
document.getElementById('discountRate').value = ";
document.getElementById('cf1').value = ";
document.getElementById('cf2').value = ";
document.getElementById('cf3').value = ";
document.getElementById('cf4').value = ";
document.getElementById('cf5').value = ";
document.getElementById('terminalValue').value = ";
document.getElementById('result-area').style.display = 'none';
}