Cost-Benefit Analysis
Calculate NPV, ROI, and benefit-cost ratio for project evaluation.
Costs
Benefits
| Year | Costs | Benefits | Net Cash Flow |
|---|---|---|---|
| 1 | $120,000 | $75,000 | $-45,000 |
| 2 | $20,000 | $75,000 | $55,000 |
| 3 | $20,000 | $75,000 | $55,000 |
| 4 | $20,000 | $75,000 | $55,000 |
| 5 | $20,000 | $75,000 | $55,000 |
About this tool
Cost-benefit analysis is a fundamental economic tool for comparing the financial value of benefits against the costs of implementing a project or initiative. It helps individuals, organizations, and government agencies make informed decisions by quantifying whether an investment will deliver positive returns. The core metrics—net present value (NPV), return on investment (ROI), and benefit-cost ratio (BCR)—allow you to evaluate projects on a standardized basis and rank competing opportunities by their financial merit.
To use this tool, enter your upfront investment costs and list the annual benefits and costs over the project's lifetime. Specify a discount rate (typically 5-10% for most business decisions) to account for the time value of money, which reflects inflation and opportunity cost. The calculator then computes NPV (the total net gain in today's dollars), ROI (the percentage return relative to initial investment), and benefit-cost ratio (benefits divided by costs). A positive NPV, ROI above your target threshold, and a BCR greater than 1.0 all indicate a financially viable project.
This analysis is essential for capital budgeting, infrastructure planning, environmental policy, and business expansion decisions. Project managers and financial analysts use these metrics to justify investments to stakeholders and compare alternatives with different timelines. Keep in mind that cost-benefit analysis relies on accurate forecasting of future costs and benefits; sensitivity analysis (adjusting discount rates or benefit estimates) can help you understand how assumptions affect the outcome.
Frequently Asked Questions
Code Implementation
def cost_benefit_analysis(costs, benefits, years: int, discount_rate: float):
"""
costs/benefits: list of {'name': str, 'amount': float, 'type': 'one-time'|'annual'}
discount_rate: as decimal (0.08 for 8%)
"""
cash_flows = []
cumulative_pv = 0.0
cumulative_net = 0.0
payback_year = None
for year in range(1, years + 1):
year_costs = sum(
c['amount'] for c in costs
if c['type'] == 'annual' or (c['type'] == 'one-time' and year == 1)
)
year_benefits = sum(
b['amount'] for b in benefits
if b['type'] == 'annual' or (b['type'] == 'one-time' and year == 1)
)
net = year_benefits - year_costs
df = 1 / (1 + discount_rate) ** year if discount_rate > 0 else 1
pv = net * df
cumulative_pv += pv
cumulative_net += net
if payback_year is None and cumulative_net >= 0:
payback_year = year
cash_flows.append({'year': year, 'costs': year_costs, 'benefits': year_benefits, 'net': net, 'pv': pv, 'cumulative_pv': cumulative_pv})
total_costs = sum(cf['costs'] for cf in cash_flows)
total_benefits = sum(cf['benefits'] for cf in cash_flows)
npv = cumulative_pv
bcr = total_benefits / total_costs if total_costs > 0 else 0
roi = (total_benefits - total_costs) / total_costs * 100 if total_costs > 0 else 0
return {'npv': npv, 'bcr': bcr, 'roi': roi, 'payback_year': payback_year, 'cash_flows': cash_flows}
# Example
costs = [
{'name': 'Initial Investment', 'amount': 100000, 'type': 'one-time'},
{'name': 'Annual Operating', 'amount': 20000, 'type': 'annual'},
]
benefits = [
{'name': 'Revenue', 'amount': 60000, 'type': 'annual'},
{'name': 'Cost Savings', 'amount': 15000, 'type': 'annual'},
]
result = cost_benefit_analysis(costs, benefits, years=5, discount_rate=0.08)
print(f"NPV: ${result['npv']:,.0f}")
print(f"BCR: {result['bcr']:.2f}")
print(f"ROI: {result['roi']:.1f}%")
print(f"Payback: Year {result['payback_year']}")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.