Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceStochastic ModelsGuide
Guide
Derivatives pricing
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Implied volatility and the volatility smile14Stochastic volatility and the Heston model15Static replication: Breeden–Litzenberger and Carr–Madan16Exotic options: barriers, Asians and digitals
Portfolio & risk
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08Value at Risk and expected shortfall
Fixed income
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Bond futures and the cheapest-to-deliver06Interest rate swaps07Callable bonds and negative convexity08Credit risk: default probabilities and credit spreads
Corporate finance
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04The weighted average cost of capital05Capital structure and the Modigliani–Miller theorems06Discounted cash flow valuation07Relative valuation with multiples08Real options: the value of flexibility
Stochastic models
01Random walks and Brownian motion02Probability spaces, σ-algebras and random variables03Filtrations, adapted processes and stopping times04Conditional expectation and martingales05Properties of Brownian motion06The reflection principle and first passage times07The Brownian bridge08The Itô integral09Itô's lemma10Kolmogorov equations and the Feynman–Kac formula11Change of measure and Girsanov's theorem12Monte Carlo option pricing13Simulating SDEs: the Euler–Maruyama scheme14Mean reversion: Ornstein–Uhlenbeck and Vasicek15Jumps and the Merton jump-diffusion model
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guide/Corporate finance

Net present value and internal rate of return

Lesson 3 of 8 · 1 min read

A firm constantly decides which projects to take on: a new machine, a new product line, a new plant. Each project costs money now and is expected to return money later. This lesson turns that comparison into two numbers, the net present value and the internal rate of return, using the discounting from "Interest, compounding and discounting".

Cash flows of a project

Describe a project by its cash flows: the amounts of money it pays out or brings in, by date. Write CFtCF_tCFt​ for the net cash flow at the end of year ttt, with t=0t = 0t=0 meaning today. A typical project has a negative CF0CF_0CF0​ (the investment) followed by positive cash flows CF1,…,CFNCF_1, \dots, CF_NCF1​,…,CFN​.

Two modelling choices are made here. Cash flows arrive at the end of each year, and the rate used to discount them is quoted with annual compounding. Both match the lab.

The discount rate

In this lesson rrr is the discount rate of the project: the annual return investors could earn elsewhere on an investment of the same risk. It is also called the opportunity cost of capital or the required return. It is not a risk-free rate; it is higher, because project cash flows are uncertain.

Net present value

Discount every cash flow back to today with the annual discount factor 1/(1+r)t1/(1+r)^t1/(1+r)t and add them up. The result is the net present value:

NPV(r)=CF0+CF11+r+CF2(1+r)2+⋯+CFN(1+r)N=∑t=0NCFt(1+r)t.\text{NPV}(r) = CF_0 + \frac{CF_1}{1+r} + \frac{CF_2}{(1+r)^2} + \cdots + \frac{CF_N}{(1+r)^N} = \sum_{t=0}^{N} \frac{CF_t}{(1+r)^t}.NPV(r)=CF0​+1+rCF1​​+(1+r)2CF2​​+⋯+(1+r)NCFN​​=t=0∑N​(1+r)tCFt​​.

The NPV is the value the project adds today. Investors could reproduce the project's future cash flows in the market for their present value; the project delivers them for the cost −CF0-CF_0−CF0​ instead. The difference is a gain (or loss) to the owners.

NPV rule: accept a project when NPV>0\text{NPV} > 0NPV>0. Among mutually exclusive projects, choose the one with the highest NPV.

A project with equal annual cash flows

Consider a project that costs 100 today and pays the same amount CCC at the end of each of the next NNN years. The cash flows after t=0t = 0t=0 form an annuity, and their present value has a closed form. Summing the geometric series gives

∑t=1NC(1+r)t=C⋅1−(1+r)−Nr,NPV(r)=−100+C⋅1−(1+r)−Nr.\sum_{t=1}^{N} \frac{C}{(1+r)^t} = C \cdot \frac{1 - (1+r)^{-N}}{r}, \qquad \text{NPV}(r) = -100 + C \cdot \frac{1 - (1+r)^{-N}}{r}.t=1∑N​(1+r)tC​=C⋅r1−(1+r)−N​,NPV(r)=−100+C⋅r1−(1+r)−N​.

Example: C=30C = 30C=30, N=5N = 5N=5 and r=10%r = 10\%r=10%.

Worked example

NPV of a project with equal annual cash flows

  1. The annuity factor: the present value of 1 a year for NNN years.

    1−(1+r)−Nr\displaystyle \frac{1 - (1+r)^{-N}}{r}r1−(1+r)−N​=3.7908
  2. Present value of the inflows: CCC times the annuity factor.

    PV=C⋅1−(1+r)−Nr\displaystyle \text{PV} = C \cdot \frac{1 - (1+r)^{-N}}{r}PV=C⋅r1−(1+r)−N​=113.72
  3. Subtract the investment to get the NPV; it is positive, so the project creates value.

    NPV=−100+PV\displaystyle \text{NPV} = -100 + \text{PV}NPV=−100+PV=13.72

With N=4N = 4N=4 instead, the inflows are worth only about 95.1095.1095.10 and the NPV is −4.90-4.90−4.90.

The NPV profile

Plot the NPV against the discount rate. This curve is the NPV profile. At r=0r = 0r=0 it equals the plain sum of the cash flows (−100+5×30=50-100 + 5 \times 30 = 50−100+5×30=50 in the example). As rrr rises, later cash flows are discounted more heavily and the NPV falls. For the example project it is 29.8829.8829.88 at 5%5\%5%, 13.7213.7213.72 at 10%10\%10%, 0.560.560.56 at 15%15\%15% and −10.28-10.28−10.28 at 20%20\%20%.

Internal rate of return

The internal rate of return (IRR) is the discount rate at which the NPV is exactly zero:

∑t=0NCFt(1+IRR)t=0.\sum_{t=0}^{N} \frac{CF_t}{(1+\text{IRR})^t} = 0.t=0∑N​(1+IRR)tCFt​​=0.

It is where the NPV profile crosses the horizontal axis. There is no general formula for it; it is found numerically, by trying rates until the NPV changes sign and then narrowing the interval. For the example project the IRR is about 15.24%15.24\%15.24%. Read it as the annual return the project itself earns on the money tied up in it.

For a project with one outflow followed by inflows, the profile falls steadily, so the IRR rule agrees with the NPV rule: the NPV is positive exactly when r<IRRr < \text{IRR}r<IRR.

The figure plots the NPV profile, for rates from 0 to 40%, of a project that costs 100 and pays CCC per year for NNN years. Sliders set CCC, NNN and rrr; the readouts show the NPV at rrr, the IRR and the undiscounted sum of the cash flows. At the default settings (C=25C = 25C=25, N=5N = 5N=5, r=10%r = 10\%r=10%) the NPV is about −5.23-5.23−5.23 and the IRR about 7.93%7.93\%7.93%: the project loses value. Raise CCC, lengthen NNN or lower rrr until the NPV crosses zero. Moving rrr slides along the curve without changing it, so the IRR stays fixed.

NPV profileOpen in NPV / IRR →
25
540
5
115
10.0%
00.3
NPV at r
-5.23
IRR
7.93%
Undiscounted sum
25

Profitability index

The profitability index divides the present value of the inflows by the initial investment:

PI=∑t=1NCFt/(1+r)t−CF0.\text{PI} = \frac{\sum_{t=1}^{N} CF_t/(1+r)^t}{-CF_0}.PI=−CF0​∑t=1N​CFt​/(1+r)t​.

In the example PI=113.72/100≈1.14\text{PI} = 113.72/100 \approx 1.14PI=113.72/100≈1.14: each unit invested returns 1.14 units of present value. PI>1\text{PI} > 1PI>1 is the same condition as NPV>0\text{NPV} > 0NPV>0. The index is useful when capital is limited and projects must be ranked by value per unit invested.

Where the IRR misleads

The IRR is popular because a percentage is easy to communicate, but it can give wrong answers in two situations.

Mutually exclusive projects. Project A costs 100 and returns 120 after one year; project B costs 100 and returns 150 after three years. A has an IRR of 20%20\%20%, B only about 14.47%14.47\%14.47%. At r=10%r = 10\%r=10%, however, the NPV of A is 120/1.1−100≈9.09120/1.1 - 100 \approx 9.09120/1.1−100≈9.09, and that of B is 150/1.13−100≈12.70150/1.1^3 - 100 \approx 12.70150/1.13−100≈12.70. B adds more value. The profiles cross at about 11.80%11.80\%11.80%; below that rate the NPV ranking and the IRR ranking disagree, and the NPV ranking is the right one, because it measures value in money, not in percent.

Cash flows that change sign more than once. A project with cash flows −100-100−100, +230+230+230, −132-132−132 has NPV zero at both 10%10\%10% and 20%20\%20%. Its profile rises and then falls, so there are two IRRs and neither is a meaningful rate of return. The NPV at the actual discount rate still answers the question.

In the next figure you build the cash flows yourself. Each darker bar is the cash flow of one year, from year 0 to year 6; drag it up or down to change it. The lighter bar behind it is its present value CFt/(1+r)tCF_t/(1+r)^tCFt​/(1+r)t at the rate rrr, so you can see how much less a later flow is worth today. The readouts give the NPV at rrr, the IRR and the undiscounted sum. The default flows are the project from before, −100-100−100 now and 25 a year for five years, with NPV −5.23-5.23−5.23 at 10%10\%10% and an IRR of 7.93%7.93\%7.93%. Now drag year 0 to −40-40−40 and year 6 to −100-100−100, a project that ends with a clean-up cost. The flows change sign twice, the NPV is zero at about 13.3%13.3\%13.3% and again at about 30.8%30.8\%30.8%, and the IRR readout reports several possible IRRs. The NPV is −1.68-1.68−1.68 at r=10%r = 10\%r=10% and +1.28+1.28+1.28 at r=20%r = 20\%r=20%: whether the project is worth taking depends on the actual discount rate, which only the NPV uses.

Drag the cash flowsOpen in NPV / IRR →
10.0%
00.3

Drag a bar up or down (or focus it and use the arrow keys).

Cash flowPresent value at r
NPV at r
-5.23
IRR
7.93%
Undiscounted sum
25

Summary

  • A project is a list of dated cash flows; discount each at the project's discount rate rrr and add them to get the NPV.
  • Accept projects with positive NPV; among exclusive alternatives, take the highest NPV.
  • The IRR is the rate at which the NPV is zero, where the NPV profile crosses the axis.
  • The profitability index is the present value of the inflows per unit invested; PI>1\text{PI} > 1PI>1 exactly when NPV>0\text{NPV} > 0NPV>0.
  • For ranking exclusive projects and for cash flows that change sign several times, trust the NPV over the IRR.

The next lesson, "The weighted average cost of capital", estimates the discount rate rrr that every NPV calculation needs.

Try itBuild project cash flows and explore NPV, IRR and the NPV profile in the NPV & IRR lab →
2 questions on this lesson at the end of the series →
← PreviousAnnuities, perpetuities and loan amortizationNext →The weighted average cost of capital
Connections
Net present value and internal rate of r…
Open the full graph →
Labs for this lesson
NPV / IRR