NPV & IRR Calculator
Calculate Net Present Value (NPV) and Internal Rate of Return (IRR).
About this tool
Net Present Value (NPV) and Internal Rate of Return (IRR) are two of the most important metrics in capital budgeting and investment analysis. NPV calculates the difference between the present value of future cash flows and the initial investment, telling you whether a project or investment will add value. IRR is the discount rate that makes NPV equal to zero, effectively showing the annualized return you can expect from an investment. Together, these tools help investors, business leaders, and financial professionals evaluate whether an opportunity is worth pursuing and compare competing projects.
To use the calculator, enter your initial investment (as a negative number), followed by the cash flows you expect in each period (typically annual). The tool instantly computes the NPV at your chosen discount rate and displays the IRRβthe rate at which all future cash flows balance out the initial cost. A positive NPV means the investment creates value; an IRR higher than your cost of capital suggests the project is financially viable. You can also run sensitivity analysis to see how NPV changes with different discount rates.
NPV and IRR analysis is essential for making capital allocation decisions, evaluating long-term projects like manufacturing plants or infrastructure investments, and comparing mutually exclusive opportunities. Keep in mind that IRR can be misleading if your cash flows are highly irregular or change sign multiple times, so always evaluate both metrics together. Financial analysts, private equity firms, and corporate finance teams rely on these calculations daily to maximize shareholder value and allocate resources efficiently.
Frequently Asked Questions
Code Implementation
def calculate_npv(discount_rate, initial_investment, cash_flows):
"""
discount_rate: annual rate as decimal (e.g., 0.10 for 10%)
initial_investment: upfront cost (positive number)
cash_flows: list of annual cash flows starting at year 1
"""
pv_sum = sum(cf / (1 + discount_rate) ** (t + 1)
for t, cf in enumerate(cash_flows))
npv = pv_sum - initial_investment
return npv
# Example: $50,000 investment, 10% discount rate, 5-year project
initial_investment = 50000
discount_rate = 0.10
cash_flows = [15000, 18000, 20000, 22000, 25000]
npv = calculate_npv(discount_rate, initial_investment, cash_flows)
print(f"NPV: ${npv:,.2f}")
print("Decision:", "Accept (NPV > 0)" if npv > 0 else "Reject (NPV < 0)")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.