{
  "id": "npv",
  "version": "eb3f5363e299",
  "status": "published",
  "name": "NPV Calculator",
  "question": "What is my project's NPV?",
  "summary": "Computes the net present value (NPV) of an investment from a discount rate, the amount invested today and the cash flows at the end of each period, with the IRR.",
  "category": "finance",
  "subcategory": "investing",
  "url": "https://www.acalculator.org/finance/npv-calculator",
  "markdown": "https://www.acalculator.org/finance/npv-calculator.md",
  "kind": "function",
  "method": "NPV = −C₀ + Σ CFₜ ÷ (1 + r)ᵗ for t = 1 to n, where C₀ is the amount invested today, CFₜ the cash flow at the end of period t and r the discount rate per period.",
  "assumptions": [
    "Each cash flow happens at the end of its period; the amount invested today is not discounted (OMB Circular A-94’s year-end convention).",
    "The discount rate is per period and stays the same for every period.",
    "The IRR is shown only when exactly one rate makes the NPV zero within the search range of −99.9999% to 99,999,900% per period; a rate outside that range is not shown."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "rate": {
        "title": "Discount rate",
        "description": "The rate per period used to discount future cash flows, for example the return you could get elsewhere.",
        "type": "number",
        "x-unit": "percent",
        "minimum": -99,
        "maximum": 1000
      },
      "initial": {
        "title": "Invested today",
        "description": "The amount paid out at the start (time 0). It is not discounted.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "flows": {
        "title": "Cash flows at the end of each period",
        "description": "The net cash flow at the end of period 1, 2, 3 and so on, separated by spaces, commas or new lines. Negative for money paid out.",
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    }
  },
  "outputs": {
    "npv": {
      "label": "Net present value",
      "description": "The present value of the cash flows minus the amount invested today.",
      "format": "money"
    },
    "pv": {
      "label": "Present value of the cash flows",
      "description": "Each cash flow divided by (1 + rate)^period, added up.",
      "format": "money"
    },
    "net": {
      "label": "Cash flows minus investment (not discounted)",
      "description": "All the cash flows added up, minus the amount invested today, with no discounting.",
      "format": "money"
    },
    "pi": {
      "label": "Profitability index",
      "description": "The present value of the cash flows divided by the amount invested today.",
      "format": "number"
    },
    "irr": {
      "label": "IRR",
      "description": "The internal rate of return: the discount rate that makes the NPV zero, when there is exactly one.",
      "format": "percent"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "rate": 8,
      "initial": 20000,
      "flows": "5000 6000 7000 8000"
    },
    "outputs": {
      "npv": 1210.7270609531406,
      "pv": 21210.72706095314,
      "net": 6000,
      "pi": 1.060536353047657,
      "irr": 10.484529479160475
    },
    "text": "At 8%, investing $20,000.00 for cash flows of 5,000, 6,000, 7,000, 8,000 has a net present value of $1,210.73."
  },
  "examples": [
    {
      "given": {
        "rate": 10,
        "initial": 50000,
        "flows": [
          12000,
          15000,
          18000,
          20000
        ]
      },
      "expect": {
        "npv": 489.7206474967461,
        "pv": 50489.720647496746,
        "net": 15000,
        "pi": 1.009794412949935
      },
      "source": "hand calculation in content.mdx: 12,000 ÷ 1.1 + 15,000 ÷ 1.1² + 18,000 ÷ 1.1³ + 20,000 ÷ 1.1⁴ − 50,000"
    },
    {
      "given": {
        "rate": 7,
        "initial": 0,
        "flows": [
          -10,
          -20,
          -25,
          -20,
          10,
          30,
          35,
          35,
          35,
          20
        ]
      },
      "expect": {
        "npv": 36.01
      },
      "source": "OMB Circular A-94 (1992), appendix B: benefits minus costs for years 1 to 10 at 7% give a net present value of $36.01 (discount factors rounded to 4 decimals, hence the tolerance)",
      "tolerance": 0.0002
    },
    {
      "given": {
        "rate": 8,
        "initial": 10000,
        "flows": [
          3000,
          3000,
          3000,
          3000,
          3000
        ]
      },
      "expect": {
        "npv": 1978.1301112342553,
        "irr": 15.238237116630648
      },
      "source": "hand calculation in content.mdx: 3,000 × (1 − 1.08⁻⁵) ÷ 0.08 − 10,000 = 1,978.13; IRR by Python bisection",
      "tolerance": 1e-8
    }
  ],
  "sources": [
    "Office of Management and Budget, Circular A-94 (1992), Guidelines and Discount Rates for Benefit-Cost Analysis of Federal Programs: net present value is discounted benefits minus discounted costs; discount factor 1/(1 + i)^t; year-end flows; appendix B example NPV $36.01 at 7%. https://georgewbush-whitehouse.archives.gov/omb/circulars/a094/text/a094.html",
    "Brealey, R. A., Myers, S. C., and Allen, F. Principles of Corporate Finance (McGraw Hill): present value, net present value, internal rate of return and profitability index.",
    "Microsoft Support, NPV function: the investment begins one period before value1; a cash flow at the start of the first period is added to the result, not included in the values. https://support.microsoft.com/en-us/office/npv-function-8672cb67-2576-4d07-b67b-ac28acf2a568"
  ],
  "related": [
    "roi",
    "compound-interest"
  ],
  "changelog": []
}
