Enter your project's cash flows and discount rate to calculate the NPV.
Initial Investment & Cash Flows
Understanding Net Present Value (NPV)
Net Present Value (NPV) is a fundamental financial metric used to evaluate the profitability of an investment or project. It represents the difference between the present value of future cash inflows and the present value of cash outflows over a period of time. In simpler terms, NPV tells you how much value an investment is expected to add (or subtract) in today's dollars.
A positive NPV indicates that the projected earnings generated by an investment will be higher than the anticipated costs. Consequently, an investment with a positive NPV is generally considered a good candidate for investment. Conversely, a negative NPV suggests that the investment is expected to result in a net loss, and it should likely be rejected. A NPV of zero means the project is expected to generate exactly enough to cover its costs.
The NPV Formula
The formula for calculating NPV is as follows:
NPV = Σ [ (CFt) / (1 + r)t ] - C0
Where:
CFt is the net cash flow during period t.
r is the discount rate (often the cost of capital or required rate of return).
t is the time period (usually in years).
C0 is the initial investment (or the cash outflow at period 0). If the initial investment is already included as a negative cash flow at t=0, then C0 is 0 in the formula above.
In this calculator, the initial investment at Period 0 is treated as a negative cash flow that is part of the summation.
How to Use This Calculator
Discount Rate: Enter the annual rate of return you require for your investment. This rate reflects the riskiness of the project and the time value of money.
Initial Investment: Enter the upfront cost of the project. This is typically a negative number (outflow).
Cash Flows: For each subsequent period (Year 1, Year 2, etc.), enter the expected net cash flow (inflows minus outflows) for that period.
Add Another Cash Flow: Click this button to add input fields for more periods.
Calculate NPV: Click this button to see the Net Present Value of your project.
Interpreting the Result
Positive NPV: The investment is expected to be profitable and add value.
Negative NPV: The investment is expected to lose money and destroy value.
Zero NPV: The investment is expected to break even.
NPV analysis is crucial for capital budgeting decisions, helping businesses and individuals choose the most financially sound projects and investments.
var cashFlowCount = 1; // Starts with the initial investment
function addCashFlow() {
var container = document.getElementById('cashFlowsContainer');
var newSection = document.createElement('div');
newSection.classList.add('cash-flow-section');
var period = cashFlowCount;
newSection.innerHTML = `
`;
container.appendChild(newSection);
cashFlowCount++;
}
function removeCashFlow(buttonElement) {
var sectionToRemove = buttonElement.closest('.cash-flow-section');
sectionToRemove.remove();
}
function calculateNPV() {
var discountRateInput = document.getElementById('discountRate');
var discountRate = parseFloat(discountRateInput.value);
var resultDiv = document.getElementById('result');
if (isNaN(discountRate) || discountRate < 0) {
resultDiv.innerHTML = 'Invalid Discount Rate. Please enter a positive number.';
return;
}
var rate = discountRate / 100; // Convert percentage to decimal
var totalNPV = 0;
var validCashFlowsFound = false;
// Iterate through all cash flow inputs
var cashFlowSections = document.querySelectorAll('.cash-flow-section');
for (var i = 0; i 0) {
resultDiv.innerHTML = '$' + totalNPV.toFixed(2) + 'This project is potentially profitable.';
resultDiv.style.backgroundColor = 'var(–success-green)';
} else if (totalNPV < 0) {
resultDiv.innerHTML = '$' + totalNPV.toFixed(2) + 'This project is potentially unprofitable.';
resultDiv.style.backgroundColor = '#dc3545'; // Red for negative NPV
} else {
resultDiv.innerHTML = '$' + totalNPV.toFixed(2) + 'This project is expected to break even.';
resultDiv.style.backgroundColor = '#ffc107'; // Yellow for zero NPV
}
}