Home › Finance › NPV Calculator
NPV Calculator
Discounts a series of end-of-period cash flows at a required rate of return, subtracts the initial investment and reports the net present value, the present value of each cash flow and the profitability index.
When to use
You are appraising a project or investment with an upfront cost followed by periodic cash flows and want to know whether it creates value at a given discount rate.
Do not use when: You want the rate that makes NPV zero (use irr), the time to recover the outlay (use payback-period), or a single future amount (use present-value).
Formula
NPV = −initial_investment + Σ_{t=1..n} cash_flows[t] / (1 + discount_rate_percent/100)^t; profitability_index = (NPV + initial_investment) / initial_investment
Cash flows occur at the end of each period and the rate is constant; the period of the rate must match the period of the cash flows (annual rate with annual flows).
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
discount_rate_percent | number | % per period | yes | Required rate of return or cost of capital per period in percent (annual for yearly cash flows). Range: ≥ -99, ≤ 1000 |
initial_investment | number | yes | Outlay at time 0, entered as a positive number. Range: ≥ 0, ≤ 1000000000000000 | |
cash_flows | number_list | yes | Net cash flow at the end of periods 1, 2, 3 … (negative values allowed). |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
npv | number | Σ CF_t / (1 + r)^t − initial_investment. | |
present_value_of_cash_flows | number | Σ CF_t / (1 + r)^t (before subtracting the investment). | |
profitability_index | number | present_value_of_cash_flows / initial_investment (only when the investment is > 0); above 1 means NPV > 0. | |
discounted_cash_flows | number_list | Each CF_t / (1 + r)^t in order. | |
total_undiscounted_cash_flows | number | Σ CF_t without discounting. | |
net_undiscounted_gain | number | Σ CF_t − initial_investment (NPV at 0 %). | |
decision | string | 'Accept' when NPV > 0, 'Reject' when NPV < 0, 'Indifferent' at 0. |
Example
−1,000 then 500, 400, 300 at 10 %: {"discount_rate_percent":10,"initial_investment":1000,"cash_flows":[500,400,300]} → {"npv":10.52,"present_value_of_cash_flows":1010.52,"profitability_index":1.0105,"discounted_cash_flows":[454.55,330.58,225.39],"total_undiscounted_cash_flows":1200,"net_undiscounted_gain":200,"decision":"Accept (NPV > 0)"}
−10,000 then 3,000, 4,000, 5,000, 2,000 at 8 %: {"discount_rate_percent":8,"initial_investment":10000,"cash_flows":[3000,4000,5000,2000]} → {"npv":1646.35,"present_value_of_cash_flows":11646.35,"profitability_index":1.1646,"decision":"Accept (NPV > 0)"}
GET https://tttkmbb.com/api/v1/calculate/npv?discount_rate_percent=10&initial_investment=1000&cash_flows=500%2C400%2C300
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/npv(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/npv · Markdown: https://tttkmbb.com/finance/npv.md · JSON definition: https://tttkmbb.com/finance/npv.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="npv" - OpenAPI operationId:
calculate_npv - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
FAQ
Which discount rate should I use?
The return available on an alternative of similar risk: a company's weighted average cost of capital for projects, or a hurdle rate. A higher rate lowers NPV.
How do I handle monthly cash flows?
Use a monthly rate: annual_rate/12 for a nominal rate, or (1 + annual)^(1/12) − 1 for an effective one, and list one cash flow per month.
Related calculators
- IRR Calculator — Rate of return that sets NPV to zero.
- Payback Period Calculator — Time to recover the initial investment.
- Present Value Calculator — Discount a single amount.