Net present value (NPV) calculator
Net present value of a series of periodic cash flows at a discount rate.
- Version 1
- Checked against 2 published values
- Free, no sign-up
Example: Excel NPV example 1 (spreadsheet convention)
| NPV Net present value. |
1,188.44 rounded |
|---|---|
| Present values Present value of each cash flow. |
-9090.91, 2479.34, 3155.52, 4644.49 |
Rounding: Half even, 2 decimal places. Calculator finance/npv@1.
How it is calculated
NPV = Σ CFₜ / (1 + r)^(t + s), s = 0 (t0) or 1 (t1)Discounts each cash flow to today and adds them up: NPV = Σ CFₜ / (1 + r)ᵗ. By default the first cash flow happens now (t = 0) and is not discounted, the usual finance-textbook convention. Choose first_cash_flow_at = t1 to match spreadsheet NPV() functions, which discount the first value by one period.
- Amounts are plain numbers in any single currency; no currency conversion is done.
References
Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.
Use it from your code
curl https://api.curatedapi.com/v1/calc/finance/npv \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"discount_rate_percent": "10",
"cash_flows": ["-10000", "3000", "4200", "6800"],
"first_cash_flow_at": "t1"
}'
The same call in Python
import os
import requests
payload = {
"discount_rate_percent": "10",
"cash_flows": ["-10000", "3000", "4200", "6800"],
"first_cash_flow_at": "t1",
}
response = requests.post(
"https://api.curatedapi.com/v1/calc/finance/npv",
headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
json=payload,
timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
"discount_rate_percent": "10",
"cash_flows": ["-10000", "3000", "4200", "6800"],
"first_cash_flow_at": "t1",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/finance/npv", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log((await response.json()).result);
MCP tool calc_finance_npv at https://mcp.curatedapi.com.
Inputs, outputs and errors in the API reference.
Put it on your website
<div data-curatedapi-widget="finance/npv" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>
Use a public key registered for your site. Calculations are billed like API calls. How widgets work.
Related calculators
- Black-76 calculator for options on futures
- Black-Scholes option price and Greeks calculator
- Bond duration and convexity calculator
- Compound interest calculator
- EU and UK APRC calculator
- Extra mortgage payment calculator
- FHA mortgage insurance (MIP) calculator
- Implied volatility calculator
- Internal rate of return (IRR) calculator
- Loan EMI calculator
- Mortgage affordability calculator
- Mortgage calculator
- Refinance break-even calculator
- Rent or buy calculator
- Return on investment (ROI) calculator
- Savings goal calculator
- Simple interest calculator
- US APR calculator (Truth in Lending, Regulation Z)
- USDA loan guarantee fee calculator
- VA funding fee calculator
- Yield to call calculator
Add this calculator to your website
Paste two lines into your page and your visitors get this calculator. Each use counts as one call on your plan, the same as the API.
Free for up to 1,000 uses a month. 50,000 uses a month cost $9.00 on the Starter plan.