Opportunity Cost Calculator
When you spend money instead of investing it, you give up the future growth that money could have earned. This calculator quantifies that trade-off: enter the amount you plan to spend, your expected investment return, how long you would have invested it, and the tax and inflation rates that apply to your situation. You get the after-tax, inflation-adjusted opportunity cost, the full gain breakdown, and a year-by-year growth chart so you can see exactly what you are forgoing.
What is opportunity cost?
Opportunity cost is the value of the best alternative you give up when you make a choice. In personal finance, it is the return you forgo by spending money rather than investing it. If you spend $5,000 on a vacation and your alternative was to invest that money at 7% per year for 10 years, the opportunity cost is not just the $5,000 but the $9,836 you could have had after a decade of compound growth (before tax and inflation). The concept comes from economics, where it extends to time, labour, and any resource that has competing uses. Opportunity cost is invisible on a price tag, which is why people routinely underestimate it. A car, a holiday, a kitchen renovation or an impulse purchase all carry an opportunity cost that grows with both the amount spent and the length of time you would otherwise have stayed invested. This calculator makes that hidden cost visible.
How this calculator works
Enter the amount you are thinking of spending, the annual return you could realistically earn by investing it instead, how long you would keep that investment, your capital gains tax rate, and the expected rate of inflation. The calculator uses monthly compounding: your investment grows by (annual rate / 12) each month, which is more accurate than simple annual growth. The gross gain is the total interest earned over the period. Capital gains tax is applied to that gain at period end. The inflation adjustment then deflates the after-tax total back to today's purchasing power, giving you the real opportunity cost: what the forgone investment would actually be worth to you in present-day dollars. The year-by-year chart shows how both the nominal and real opportunity costs grow over time so you can see the compounding effect visually.
Tax-advantaged accounts and how they change the math
If you invest inside a Roth IRA, Roth 401(k), or similar tax-sheltered vehicle, qualified withdrawals are tax-free. Set the capital gains tax rate to 0% to model this scenario. The result will typically be substantially higher, because you keep the full gross gain rather than paying a percentage to the government. Traditional 401(k) and IRA contributions are pre-tax, so the comparison is more nuanced: you get a deduction now but pay ordinary income tax on withdrawal. For a rough estimate, use a tax rate equal to your expected marginal income tax rate in retirement.
Limitations and practical context
This calculator assumes a fixed annual return, which real investments do not deliver. Market returns fluctuate year to year, sometimes sharply. The model also assumes you invest the entire lump sum on day one rather than dollar-cost averaging, and that you reinvest all gains throughout the period. Inflation compounds too: the calculator applies the inflation rate as a steady annual deflator, which is a reasonable long-run approximation but not a precise forecast. Tax law changes, account contribution limits, and transaction costs are also excluded. Use the output as an order-of-magnitude guide to the true cost of spending versus investing, not as a precise financial forecast.
How return rate and time interact
| Return rate | 5 years | 10 years | 20 years | 30 years |
|---|---|---|---|---|
| 4% | $935 | $2,040 | $5,052 | $9,513 |
| 6% | $1,449 | $3,335 | $9,085 | $19,009 |
| 8% | $1,988 | $4,827 | $14,693 | $35,440 |
| 10% | $2,554 | $6,541 | $22,381 | $63,081 |
| 12% | $3,148 | $8,508 | $32,843 | $109,020 |
After-tax gain on $5,000 at a 15% capital gains rate with 3% inflation, illustrating how return rate and time horizon compound the opportunity cost.
Frequently asked questions
What is opportunity cost in simple terms?
Opportunity cost is what you give up by choosing one option over another. When you spend money, you give up the growth that money could have earned if invested. When you invest, you give up the enjoyment of spending it now. This calculator focuses on the financial side: how much wealth you forgo when you choose to spend rather than invest.
Why does this calculator use monthly compounding?
Monthly compounding is the most common real-world convention for investment accounts and savings. It means interest is calculated and added to your balance 12 times per year rather than once. Over long periods, this produces meaningfully more growth than simple annual compounding. Using monthly compounding gives a more accurate picture of what an investment account would actually earn.
How do I choose a realistic annual return?
For broad stock-market index funds (S&P 500 type), long-run historical nominal returns have averaged around 10% per year and around 7% after inflation. For a balanced portfolio of stocks and bonds, something like 5-7% nominal is a common planning assumption. For cash savings accounts or short-duration bonds, use 3-5%. Always err toward the conservative side for planning purposes, since sequence-of-returns risk and fees can reduce the real outcome.
What capital gains tax rate should I use?
In the United States, long-term capital gains (on assets held more than one year) are taxed at 0%, 15%, or 20% depending on your taxable income. Most middle-income earners fall into the 15% bracket. If you plan to hold the investment in a Roth IRA or another tax-free account, enter 0%. If your investment would be taxed as ordinary income (short-term gains or certain account types), use your marginal income tax rate instead.
Why does inflation reduce the opportunity cost?
Inflation erodes purchasing power over time. A nominal gain of $10,000 in 20 years is worth less in real terms than it sounds today, because prices will be higher. When inflation is high relative to your investment return, the real opportunity cost can be surprisingly low, or even negative if your after-tax return fails to keep up with inflation. This is why beating inflation is a core goal of any investment strategy.
Can I use this for decisions other than financial investments?
The formula here applies specifically to money invested in a financial asset. For broader opportunity cost analysis involving time, labour, or business decisions, the concept is the same but the numbers are harder to quantify. Think of this calculator as a tool for one important subset of opportunity cost: the financial cost of spending versus investing a lump sum.