NOTACAL logo

Opportunity Cost Calculator

Opportunity Cost Calculator

Give us your feedback! Was this useful?

Introduction

Every financial decision quietly makes a second decision for you. When you choose one option, you lose whatever the alternative would have earned — and that hidden loss is called opportunity cost. It is not the amount you spend; it is the value of the road not taken. The same is true for time: an hour spent streaming could have produced an hour of a side project, and a dollar spent today on a latte is a dollar that will not compound for the next twenty years.

Opportunity cost is the core idea of economics — the cost of any choice measured in terms of the best alternative forgone [investopedia-oppcost]. The Federal Reserve introduces it to students as the fundamental scarcity problem: because resources are limited, every "yes" requires a "no" [federalreserveedu-oppcost]. The concept applies to money, time, education, career moves, and even which project to ship next. This calculator focuses on the money version, where the numbers are concrete enough to measure.

The calculator has three scenarios. Spending vs. Investing shows what a purchase today would be worth if the same money grew in the market. Option A vs. Option B compares two investments with different expected returns over the same horizon. Invest vs. Pay Off Debt compares investing a lump sum against using it to retire debt, accounting for the guaranteed interest you avoid. Each scenario answers a different version of the same question: what am I really giving up?

How to Use

All three modes recalculate automatically as you type, so you can explore trade-offs without pressing a button.

Scenario 1 — Spending vs. Investing. Enter the amount you are considering spending, an expected annual return, and a time horizon. The featured result is the opportunity cost of spending today: the future value that money would have reached. The third result subtracts your original amount to show the foregone growth alone. Try it with a $50-per-week habit: that is $2,600 a year. At 7% over 20 years, one single year of that habit costs roughly $10,064 in future value — before considering that the habit repeats every year.

Scenario 2 — Option A vs. Option B. Enter one amount and two different expected returns. The calculator compounds both to their future values and shows the difference as the opportunity cost of choosing Option A. If the difference is negative, Option A actually won — the output shows how much better it performed. For example, a $10,000 investment at 5% versus 8% over 20 years: Option A grows to $26,532.98 and Option B to $46,609.57, so choosing A costs $20,076.59 in forgone growth.

Scenario 3 — Invest vs. Pay Off Debt. Enter the debt balance, its APR, the expected investment return, and a horizon. The featured output is the net opportunity cost: investment value minus debt value. A positive number means investing earned more than the debt cost you; a negative number means paying off the debt was the better financial move. On a $10,000 balance at 6% APR versus an 8% expected return over 10 years, investing wins by $3,680.77 — but raise the APR to 9% and paying the debt wins by $8,871.19. The break-even happens exactly where the debt rate equals the expected return.

The Formula

The engine behind all three modes is the future-value formula:

FV=P×(1+r)tFV = P \times (1 + r)^t

Where P is the principal, r is the annual return expressed as a decimal, and t is the number of years. Because the exponent grows the multiplier, small differences in r widen dramatically over long horizons — the mathematical reason opportunity cost compounds.

In the debt scenario, the calculator runs the same formula twice: once with the investment return and once with the debt APR. The net opportunity cost is the difference:

OppCost=P×(1+ri)tP×(1+rd)tOppCost = P \times (1 + r_i)^t - P \times (1 + r_d)^t

This is a simplification that assumes both returns stay flat over the full horizon and that interest compounds annually. Real debts compound monthly and real markets fluctuate yearly, but the ranking of the two options is almost always the same: if the debt rate exceeds your realistic expected return, paying the debt wins; if your expected return comfortably exceeds the APR, investing wins.

Reference Table

Historical long-run averages give you realistic inputs instead of wishful ones. The table shows what $10,000 grew to over 30 years at the annualized returns Aswath Damodaran calculated for U.S. asset classes from 1928 through 2024 [damodaran-histret], using the same future-value formula this calculator applies.

Asset classAverage annual returnValue of $10,000 after 30 years
U.S. large-cap stocks9.94%$171,661
Small-cap stocks11.74%$279,422
Long-term bonds4.50%$37,453
Cash (T-bills)3.31%$26,563
Real estate4.23%$34,656
Gold5.12%$44,726
Average annual returns by asset class, 1928–2024 (Damodaran data).

The table makes the opportunity cost story vivid: the gap between cash and small-cap stocks is the difference between $26,563 and $279,422 on the same $10,000 — more than a tenfold gap driven entirely by asset allocation [wocs-histret]. When you leave a lump sum in a checking account "while you decide," you are not preserving it; you are quietly choosing cash returns over stock returns for every month the money sits idle.

Practical Tips

Use a conservative expected return. A 10% assumption is an aggressive pick even with history on your side; 5-7% after inflation is a defensible planning number for diversified portfolios. If your opportunity-cost conclusion flips when you move the return by one point, the decision is too close to call on returns alone — let risk and liquidity decide instead.

Treat debt differently by type. The calculator treats all debt with one APR, but real life splits it: a 29% credit-card balance should almost always be paid first regardless of market expectations, while a 3% mortgage might rationally stay open. Run the Invest vs. Pay Off Debt scenario on each debt separately and rank them by their APRs.

Remember that expected return is not a bank yield. The calculator compares a guaranteed debt rate against a volatile expected return. A stock portfolio averaging 8% still has down years, and someone who must sell during a downturn realizes a different number. If you need the money within five years, the volatility risk usually outweighs the expected-return edge.

Pair this tool with its siblings. Use the Return on Investment (ROI) Calculator to measure what a completed investment actually earned after the fact, and the CAGR Calculator to convert lumpy multi-year returns into a single annualized figure for a fair comparison. For project decisions, the Payback Period Calculator answers a different question — how long until you break even — which matters when your bottleneck is cash, not long-run return.

Do not let analysis freeze you. Opportunity cost cuts both ways: the time spent endlessly comparing two nearly identical options has its own opportunity cost. Set your assumptions, run the scenario once, and move on. A good-enough decision executed beats a perfect one analyzed for weeks.

Limitations

The calculator assumes constant returns. Real markets deliver returns that swing year to year, and the future value of the market path is not the same as the future value of its average — sequence-of-returns risk is invisible in this model. Treat outputs as planning estimates, not forecasts.

It ignores taxes, fees, and inflation. Capital-gains tax, fund expense ratios, and the erosion of purchasing power all reduce the real outcome. For a closer view, pair this with the Inflation Calculator, which shows how much nominal dollars lose in real terms over the same horizon.

It assumes a single lump sum. Real behavior is recurring contributions, which the Future Value Calculator handles with periodic-payment options. If you are comparing a habit you repeat every month, model one month as a lump sum and multiply the lesson, rather than treating it as a one-time amount.

Opportunity cost is not always monetary. Choosing a job for the paycheck may cost you time with family; choosing the safe project may cost you the learning from the ambitious one. This calculator quantifies the financial leg of the trade-off only. The other legs are real, even if they do not appear in a result row.

Opportunity Cost in Everyday Decisions

The most expensive decisions are rarely the obvious ones. A $6 premium coffee every workday sounds harmless, but modeled with the Spending vs. Investing mode the numbers stop sounding harmless: at 7% over 30 years, one year of that habit — roughly $1,560 — compounds past $11,900. Multiply by the 20 years of work life ahead of you and the same habit at the same rate grows into a six-figure forgone sum. The purchase was never just $6; it was a slice of a future balance.

The same logic applies to cash drag. Many households hold checking-account balances that exceed three months of expenses, money earning near zero while it waits for a decision. The Federal Reserve's scarcity teaching emphasizes that holding idle money is itself a choice with a cost: every month that cash sits outside the market, it foregoes the compounding that stocks have historically delivered [federalreserveedu-oppcost]. Run the $10,000 row from the reference table through the calculator and the cost of "just parking it for now" becomes concrete.

Opportunity cost also explains why diversification is not laziness. Because no one knows which asset class will lead the next decade, a balanced portfolio deliberately accepts the opportunity cost of not holding only last decade's winner — in exchange for not holding only this decade's loser. The Option A vs. Option B mode makes this trade-off visible: a mix that trails the best single asset still beats the asset that loses. Once you frame investing this way, the goal stops being "pick the winner" and becomes "avoid paying the largest hidden costs."

Frequently Asked Questions

What is opportunity cost in simple terms?
Opportunity cost is the value of the best alternative you give up when you make a choice. If you spend $1,000 today instead of investing it at 7% for ten years, the opportunity cost is the $1,967.15 that money would have become — you did not lose $1,000, you lost the $967.15 of growth on top of it.
Why does opportunity cost matter for investing?
Because every dollar has a competing use. Money in a checking account earns almost nothing while the same dollar in a broad index fund has historically returned near 10% a year. Over decades, the difference between those two choices is often six figures — which is exactly why the calculator's Spending vs. Investing mode exists.
Should I invest or pay off debt first?
Compare the debt's APR with your realistic expected return. If the APR is higher, pay the debt — it is a guaranteed return equal to the rate. If your expected return clearly beats the APR, investing wins, but only if you can tolerate the volatility. The Invest vs. Pay Off Debt mode computes the exact dollar difference over your chosen horizon.
What is a good expected return to use?
A common planning assumption is 7-10% for a diversified U.S. equity portfolio before inflation, or 5-7% after inflation. Long-run history from Damodaran shows large-cap stocks averaging 9.94% since 1928. Use a lower number for conservative planning and a higher number only if you genuinely accept the volatility.
Is opportunity cost the same as sunk cost?
No. Sunk cost is money already spent that cannot be recovered, and it should be ignored in forward decisions. Opportunity cost is the value of the alternative you would forgo by choosing a path. The two fight each other: a sunk cost can trick you into holding a losing position that has a better alternative — which is itself an opportunity cost.
How is opportunity cost used outside of money?
In time management, every hour on one activity is an hour not spent on another. In career planning, a salary offer's opportunity cost includes lost learning or flexibility. In business, choosing one project means not funding another. Economists define it broadly as the value of the next-best use of any scarce resource.
What is the formula for opportunity cost?
The simplest version is Opportunity Cost = Return of Best Forgotten Option − Return of Chosen Option. For money that compounds, the calculator applies the future-value formula FV = P(1 + r)^t to each option and subtracts the results, so the difference reflects years of compounding rather than a single-year comparison.
Does opportunity cost increase or decrease with time?
It compounds, so it grows faster than linearly. A 2% annual difference seems small, but over 30 years it is the gap between $34,656 and $44,726 or even $171,661 depending on asset class — the exponent in the future-value formula turns small rate gaps into large dollar gaps the longer the horizon.
Can opportunity cost be negative?
Yes. In the calculator, a negative 'Opportunity Cost of Choosing A' simply means Option A outperformed Option B. The sign is informative: it tells you which option won and by how much. What matters is that you are comparing apples to apples — same amount, same horizon, different returns.
How does inflation change opportunity cost?
The calculator shows nominal dollars. If inflation averages 3%, the real value of any future result is lower, and cash loses purchasing power every year it sits. The Inflation Calculator converts nominal amounts to real terms, which is especially important for long horizons where inflation compounds alongside returns.

References

  1. [1]Investopedia. (2026). Opportunity Cost: Definition, Formula, and Examples.
  2. [2]Federal Reserve Education. (2026). Opportunity Cost — Scarcity Teaching Module.
  3. [3]Corporate Finance Institute. (2026). What Is Opportunity Cost?
  4. [4]Damodaran, A. (2025). Historical Returns on Stocks, Bonds and Bills: 1928–2024.
  5. [5]Accidental FIRE. (2025). Historical Returns for Stocks, Bonds, Cash, Real Estate and Gold.
  6. [6]U.S. Securities and Exchange Commission. (2026). Compound Interest Calculator.

Last updated: August 7, 2026

1b

UnByte — Independent Software Engineering

Every calculator references authoritative sources — Editorial policy