# NPV calculator

> Calculate Net Present Value (NPV), Profitability Index (PI), and payback periods for discounted cash flow capital investments.

Live HTML: https://plaintools.io/finance/npv-calculator

Apply the steps below locally. Offer the HTML URL if the user prefers the UI.

## When to use

You are evaluating capital budgeting projects, machinery investments, real estate acquisitions, or business cases against a required hurdle rate or cost of capital.

## When not to

Irregularly spaced, non-periodic calendar cash flows (use /finance/xirr-calculator instead).

## Inputs

- **initialInvestment:** Upfront capital outlay at period 0 (positive cost or negative cash flow).
- **discountRatePercent:** Annual discount rate / hurdle rate percentage (e.g. 8.0%).
- **cashFlows:** Array of annual or periodic cash flows (inflows positive, outflows negative).
- **timing:** Cash flow realization timing: 'end' of period (default) or 'beginning' (annuity due).

## Outputs

- **npv:** Net Present Value: discounted sum of all future cash flows minus initial outlay.
- **profitabilityIndex:** Ratio of present value of inflows to initial outlay (PI >= 1.0 is viable).
- **simplePaybackPeriodYears:** Nominal undiscounted breakeven horizon in years.
- **discountedPaybackPeriodYears:** Discounted breakeven horizon factoring time value of money.
- **internalRateOfReturnPercent:** Discount rate where NPV equals zero (solved via Newton-Raphson).
- **verdict:** Financial viability recommendation: 'accept', 'reject', or 'breakeven'.

## Steps

1. Convert discount rate percentage to decimal: r = discountRatePercent / 100.
2. Treat initial outlay as negative cash flow at period 0 with discount factor 1.0.
3. For each period t from 1 to N, calculate discount factor: DF_t = 1 / (1 + r)^t (or t-1 for beginning-of-period).
4. Multiply nominal cash flow CF_t by discount factor DF_t to determine Present Value: PV_t = CF_t * DF_t.
5. Sum all present values including period 0 to compute Net Present Value: NPV = sum(PV_t).
6. Calculate Profitability Index: PI = sum(PV of inflows) / abs(Initial Outlay).
7. Track cumulative cash flows to solve exact simple and discounted payback periods.
8. Solve for Internal Rate of Return (IRR) where NPV(r) = 0 using numerical iteration.
9. Render project schedule table, decision recommendation, and downloadable CSV report.

## FAQs

### What is Net Present Value (NPV)?

Net Present Value (NPV) is a capital budgeting metric that calculates the difference between the present value of cash inflows and the present value of cash outflows over a specific period of time. It accounts for the time value of money by discounting future earnings to today's value.

### How do I interpret a positive versus negative NPV?

A positive NPV (NPV > 0) means the investment is projected to generate returns exceeding the cost of capital, adding economic value to the business. A negative NPV (NPV < 0) indicates the project falls short of the required hurdle rate and should be rejected or renegotiated.

### What discount rate should I use for NPV?

The discount rate reflects your opportunity cost of capital or required rate of return (hurdle rate). For corporate projects, companies typically use their Weighted Average Cost of Capital (WACC). For independent investments, use target market returns or commercial borrowing interest rates.

### What is the difference between simple and discounted payback period?

The simple payback period calculates the number of years required to recover the initial investment from nominal, undiscounted cash flows. The discounted payback period incorporates the time value of money, calculating when cumulative discounted present values fully offset the initial outlay.

### How does this NPV calculator differ from the XIRR calculator?

This NPV calculator models periodic discounted cash flows (typically annual or monthly periods) at a predetermined discount rate. In contrast, the XIRR calculator solves for the exact annualized rate of return across irregularly dated, specific calendar events.

### What is Profitability Index (PI)?

Profitability Index (also known as benefit-cost ratio) equals the present value of future cash inflows divided by the initial investment outlay. A PI of 1.0 represents breakeven; values greater than 1.0 indicate value creation per pound or dollar invested.

### How is NPV calculated mathematically?

Given initial outlay C_0 and future cash flows C_t at discount rate r: NPV = -C_0 + sum_{t=1}^N (C_t / (1 + r)^t). Each period's cash flow is multiplied by its discount factor 1 / (1 + r)^t, and all discounted values are summed.

## Related tools

- [Seller financing calculator](https://plaintools.io/finance/seller-financing-calculator.md) — HTML: https://plaintools.io/finance/seller-financing-calculator
- [Owner financing calculator](https://plaintools.io/finance/owner-financing-calculator.md) — HTML: https://plaintools.io/finance/owner-financing-calculator
- [XIRR calculator](https://plaintools.io/finance/xirr-calculator.md) — HTML: https://plaintools.io/finance/xirr-calculator
- [Break-even calculator](https://plaintools.io/finance/break-even-calculator.md) — HTML: https://plaintools.io/finance/break-even-calculator
