Finance calculator

Free opportunity cost calculator

See what your spending really costs. Enter a one-time purchase or a recurring habit, the return you could have earned by investing instead, and a time horizon. The calculator returns the opportunity cost — the forgone investment growth — plus the total spent, what it would have grown to, and the multiple of your money — updated live, as you type.

InputsLive
Spend type
How often
Amount (per day)
$
Forgone annual return
%
Time horizon
years
Result
Opportunity cost
$132,039
The investment growth you give up by spending $5 every day over 30 years instead of investing it.
Total spent$54,750
Future value if invested$186,789
Multiple of spend3.4×

Estimates only, based on a constant return and spend. Not financial advice.

Results are estimates. Consult a professional.

Definition

What is opportunity cost?

Opportunity cost is the value of the next-best thing you give up when you make a choice. Every dollar, hour, or resource can only be used once, so picking one option always means forgoing another. In money terms, the most useful version is the one this opportunity cost calculator measures: when you spend money instead of investing it, the opportunity cost is the growth that money would have earned if you had invested it instead. It is the invisible price tag on a purchase — what the same dollars could have become.

That makes opportunity cost different from the sticker price. A $5 coffee costs $5 today, but its opportunity cost is the future investment growth those $5 — repeated day after day — would have produced. This calculator separates the two: it shows the cash you actually spend, the amount that money would grow to if invested, and the gap between them. That gap is the opportunity cost.

The value of the next-best alternative you give up when you choose one option over another. Here: the forgone investment growth on money you spend.
The annual rate of return you could have earned on the money had you invested it instead of spending it.
What an amount of money grows to at a later date once compound returns are added.
Money already spent that cannot be recovered. Unlike opportunity cost, a sunk cost should not influence future decisions.
Formula

The opportunity cost formula

The economics textbook states opportunity cost as the difference between two returns — what the option you skipped would have paid, minus what your chosen option pays:

opportunity cost = return on the best forgone option return on the chosen option

For the everyday spend-vs-invest question, that idea becomes a future-value calculation. Your chosen option (spending) returns nothing, so the opportunity cost is simply the future value of the money if invested, minus the amount you spent:

opportunity cost = future value if invested total spent
one-time spend: future value = amount × (1 + r)^years
recurring spend: future value = amount × [ ((1 + r/m)^(years × m) 1) / (r/m) ]
When the return is 0%, money does not grow, so the opportunity cost is zero — your spend simply equals what you would have had. The calculator handles that edge so the result never breaks.
Method

How to calculate opportunity cost step by step

Whether you use the calculator above or a spreadsheet, the spend-vs-invest opportunity cost comes together in four steps:

  1. Set the amount. Enter the price of a one-time purchase, or the per-period cost of a recurring habit — for example $5 a day on coffee.
  2. Pick the forgone return. Choose the annual rate the money could have earned if invested instead. A long-run diversified stock-market average of about 7% (after inflation) is a common benchmark.
  3. Choose the time horizon. Decide how many years the money would have stayed invested. Opportunity cost grows dramatically with time because returns compound.
  4. Read the gap. The calculator compounds the money forward, totals what you actually spent, and shows the difference — the opportunity cost. It also reports the future value and how many times your money the spend could have become.
Inputs

The opportunity cost calculator inputs explained

Amount — one-time or recurring

A one-time amount is a single purchase — a $1,500 phone or a $30,000 car. A recurring amount repeats at a frequency you choose (daily, weekly, monthly, or yearly), which is where small habits turn into large numbers. The calculator compounds a one-time spend as a lump sum and a recurring spend as a stream of contributions.

Annual return — the forgone alternative

This is the rate your money could have earned elsewhere — the heart of opportunity cost. Use a realistic figure for your alternative: roughly 4–5% for a high-yield savings account or bonds, about 7% for the long-run real return of a diversified stock portfolio, or 10% for the historical nominal average of the US stock market before inflation. A higher assumed return produces a larger opportunity cost.

Time horizon — years invested

How long the money would have stayed invested. Because growth compounds, the horizon is the single biggest lever on the result: the same daily spend has a modest opportunity cost over 5 years and an enormous one over 40. This is why opportunity cost is most powerful as a lifetime, not a one-off, idea.

Worked example

A worked example using the opportunity cost calculator

Example: the $5-a-day coffee, invested for 30 years

Sam buys a $5 coffee every single day. Curious what the habit really costs, Sam uses the calculator to compare spending that money with investing it at a 7% annual return over a 30-year career. Here is how the calculator walks through it.

Step 1 — Enter the inputs

Sam sets the amount to $5, switches the mode to recurring at a daily frequency, sets the annual return to 7%, and the horizon to 30 years.

Step 2 — Total the spending and compound it forward

Over 30 years, $5 a day adds up to $54,750 of actual coffee spending (5 × 365 × 30). Treated instead as a daily $5 contribution earning 7% a year, that same stream grows to a future value of about $186,789.

total spent = 5 × 365 × 30 = 54,750
future value = 5 × [ ((1 + 0.07/365)^(365 × 30) 1) / (0.07/365) ] ≈ 186,789
opportunity cost = 186,789 54,750 = 132,039

Step 3 — Read the result

$132,039 opportunity cost
Sam spends $54,750 on coffee over 30 years, but the real cost is higher: investing that money instead would have grown it to about $186,789 — so the forgone growth, the opportunity cost, is roughly $132,039. The money could have become about 3.4 times the amount spent.

Note the precise wording. The coffee does not cost $186,789 — that is its future value if invested. What you give up by spending rather than investing is the growth: about $132,039. The next section shows how that gap widens year by year.

Compounding

How a small daily spend grows into a large opportunity cost

Opportunity cost is not linear — it accelerates, because returns compound on prior returns. The table below follows the same $5-a-day habit at a 7% annual return, showing how the future value pulls away from the money actually spent as the years pass.

YearsTotal spentFuture value if investedOpportunity cost
5$9,125$10,924$1,799
10$18,250$26,426$8,176
15$27,375$48,424$21,049
20$36,500$79,639$43,139
25$45,625$123,934$78,309
30$54,750$186,789$132,039

$5/day at a 7% annual return. Figures computed by this calculator.

Notice the acceleration: in the first 5 years the opportunity cost is smaller than the amount spent, but by year 30 the forgone growth ($132,039) is more than double the cash spent ($54,750). Time, not the size of the spend, does most of the work — which is the whole argument for starting early.
Two meanings

Opportunity cost in economics vs. everyday decisions

Opportunity cost is a cornerstone of economics, where it explains the difference between accounting profit and economic profit. Accounting profit is revenue minus the explicit, out-of-pocket costs you pay. Economic profit also subtracts implicit costs — the opportunity cost of resources you already own, such as the salary you forgo to run your own business, or the return your invested capital could have earned elsewhere.

  • Explicit cost — an actual cash payment: wages, rent, materials.
  • Implicit cost — the opportunity cost of a resource you own and use, with no cash changing hands.
  • Accounting profit — total revenue minus explicit costs only.
  • Economic profit — total revenue minus explicit and implicit (opportunity) costs.

For everyday choices the principle is identical but the unit changes — it can be money, time, or any scarce resource. Choosing a job two hours closer to home has an opportunity cost measured in salary; an afternoon spent on one project is an afternoon not spent on another. The two-option formula captures this directly: the opportunity cost of any choice is the return of the best alternative you turned down, minus the return of the option you picked. This calculator quantifies the money version, but the habit of asking "what am I giving up?" applies everywhere.

The latte factor

Opportunity cost and the latte factor

The most famous application of opportunity cost is the latte factor, a term coined by financial author David Bach. The idea: small, routine purchases — the daily coffee being the archetype — feel trivial in isolation but carry a large opportunity cost once you account for years of compounding. Cutting the habit and investing the money instead, Bach argued, can build a meaningful nest egg over a working lifetime.

The latte factor is not really about coffee. It is a lens for any recurring discretionary spend — subscriptions you forgot you have, daily lunches out, a habit you could downsize. Run each through the recurring mode of this calculator and you see the same pattern the worked example shows: a small number times a long horizon at a reasonable return becomes a surprisingly large opportunity cost.

A fair caveat: the latte factor is a thought experiment, not a guarantee. It assumes you actually invest the saved money and earn the assumed return every year. Spending on things you value is not a mistake — the point is simply to make the trade-off visible so the choice is deliberate.
Why it matters

Why opportunity cost matters for your decisions

Opportunity cost reframes spending as a trade-off rather than a sticker price, which sharpens almost every financial decision:

  • Big purchases — weigh a car upgrade or a renovation against what the same cash could earn invested over the years you would have held it.
  • Recurring habits — see whether a subscription or a daily indulgence is worth its lifetime opportunity cost.
  • Paying off debt vs. investing — the opportunity cost of overpaying a low-rate loan is the higher return you could earn investing instead, and vice versa.
  • Cash on the sidelines — money left in a no-interest account has an opportunity cost equal to the return it could earn elsewhere.

The goal is not to never spend — it is to spend deliberately. Pair this with the compound interest calculator to see the same growth from the saving side, the investment calculator to project a portfolio, or the Rule of 72 to estimate how fast the forgone money would double.

Methodology

Assumptions, sources, and methodology

This calculator computes opportunity cost as future value if invested minus the amount spent. One-time amounts compound annually as a lump sum; recurring amounts compound at the chosen frequency as the future value of an ordinary annuity. It assumes a constant return and a constant spend, and excludes taxes and inflation — so treat the result as a planning estimate, not a guarantee. Real returns fluctuate, and a return entered as a nominal figure will overstate purchasing power against an inflation-adjusted one.

The definitions of explicit and implicit costs, accounting profit, and economic profit follow standard microeconomics (OpenStax, Principles of Economics). The latte-factor concept is attributed to David Bach, The Automatic Millionaire.

OpenStax — Principles of Economics: Explicit and Implicit Costs, and Accounting and Economic Profit.
Questions

Frequently asked questions about the free opportunity cost calculator

An opportunity cost calculator is a free online tool that helps you calculate the opportunity cost of spending instead of investing — the forgone growth on a one-time or recurring purchase. Opportunity cost is the future value the money would reach if invested, minus what you spent. One-time spend compounds as a lump sum; recurring spend as an annuity. It runs entirely in your browser with instant results and no sign-up.
For a spend-versus-invest decision, calculate the future value the money would reach if invested, then subtract what you actually spent — the difference is the opportunity cost (the forgone growth). A one-time amount compounds as a lump sum: future value = amount × (1 + rate)^years. A recurring amount compounds as a stream of contributions. For example, $5 a day invested at a 7% annual return for 30 years grows to about $186,789 against $54,750 spent, an opportunity cost of roughly $132,039.
In economics, opportunity cost = the return on the best option you gave up − the return on the option you chose. For everyday spending, the chosen option (spending) returns nothing, so the formula becomes: opportunity cost = future value if invested − total spent. The future value uses standard compound-interest math at the rate and time horizon you expect the money could have earned.
A daily coffee is the classic example. Spending $5 a day costs $54,750 over 30 years, but that same money invested at a 7% annual return would grow to about $186,789 — so the opportunity cost, the growth you give up, is roughly $132,039. Opportunity cost also applies beyond money: taking one job means forgoing the salary of another, and an afternoon spent on one task is an afternoon not spent on another.
Opportunity cost is forward-looking: the value of the next-best alternative you give up by making a choice. A sunk cost is backward-looking: money already spent that cannot be recovered. The key rule is that sunk costs should not influence future decisions, because they are gone either way — only opportunity costs, the value of what you could still do with your remaining resources, should.
The latte factor is a term coined by author David Bach for the large opportunity cost hidden in small, routine purchases like a daily coffee. On its own each purchase feels trivial, but over years of compounding the forgone investment growth becomes substantial. The concept applies to any recurring discretionary spend — subscriptions, daily lunches, small habits — and is a reminder to make the trade-off deliberate, not a rule that you must cut every small expense.
About

About this opportunity cost calculator

This opportunity cost calculator runs entirely in your browser. Every figure you enter stays on your device — nothing is sent to a server, logged, or shared. It compounds a one-time spend as a lump sum and a recurring spend as an annuity, subtracts what you spent from what the money would have grown to, and shows the forgone growth instantly as you type.

Calculators Cloud offers 400+ free tools with no sign-up. The whole Finance calculators shelf includes Compound interest, Investment, and Rule of 72 tools alongside this one. Or browse the full calculator directory.

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.