To calculate opportunity cost, subtract the return of the option you chose from the return of the best alternative you turned down, using the same units over the same time period. If you put $10,000 into a bond paying 4% instead of a stock fund projected to return 10%, your opportunity cost is roughly $600 in the first year. The arithmetic is simple; the work is in picking the right two options and attaching honest numbers to each.
The Formula
The whole calculation is one line:
Opportunity Cost = Return on Best Foregone Alternative − Return on Chosen Option
A positive number means you left value on the table. A negative number means the option you picked actually beat the alternative, which supports the decision you made. The formula works with dollar amounts, percentages, or non-monetary values like hours, as long as both sides are measured the same way over the same stretch of time.
Pay attention to the phrase “best foregone alternative.” You compare exactly two paths: the one you took and the single strongest option you passed up. Trying to fold three or four alternatives into one calculation produces a number that doesn’t mean anything. Pick the strongest runner-up and measure against that.
Define the Two Options With Real Numbers
Before you can subtract anything, both options need enough specificity to carry a figure. “Investing in the stock market” is too loose. “Putting $10,000 into an S&P 500 index fund for five years” is something you can actually calculate.
Each option needs an expected return. For financial decisions, that might be an interest rate, a historical average, or a projected cash flow. For career or schooling choices, it could be a salary or an hourly wage. If you can’t put a number on it, the formula can’t help, and you’re deciding on gut feeling whether you admit it or not.
Count Explicit and Implicit Costs
Explicit costs are the ones you physically pay: tuition, brokerage fees, materials, rent. They show up on statements and are easy to track. Implicit costs are harder to see because no money changes hands. They represent the value of resources you already own that your choice uses up.
Time is the most common one. If you spend 20 hours a week on a side project instead of freelancing at $50 an hour, that’s $1,000 a week in implicit cost whether you think about it or not. Other examples: using personal equipment, giving up rental income on space you occupy yourself, or forgoing interest on cash tied up in inventory.
To turn implicit costs into numbers you can plug in, use fair market value. Your time is worth what someone would pay you for it. Your workspace is worth what a comparable space rents for. These estimates don’t need to be exact, but skipping them entirely means your calculation will undercount the real cost of your choice.
Worked Example: Two Investments
Say you have $10,000 to invest for five years. Option A is a high-yield savings account earning about 4% annually. Option B is an S&P 500 index fund. The S&P 500 has returned roughly 10% per year on average since the late 1950s in nominal terms, and around 7% after adjusting for inflation. Use the 10% nominal figure here so both options are measured the same way.
- Savings account (chosen): $10,000 × 1.04^5 ≈ $12,167
- Index fund (foregone): $10,000 × 1.10^5 ≈ $16,105
- Opportunity cost: $16,105 − $12,167 ≈ $3,938 over five years
That $3,938 is the price of choosing safety over growth. Whether that price is worth paying depends on your circumstances. If you needed the cash accessible for emergencies, the savings account was probably the right call anyway. The formula doesn’t tell you what to pick. It tells you what you’re giving up.
One caution with this kind of comparison: the 10% long-run average includes years with 30% gains and years with 40% losses. Over any particular five-year window, actual returns can swing hard. The opportunity cost figure is only as reliable as the return estimates you feed it.
Worked Example: College vs. Working
Opportunity cost isn’t just for investment accounts. Consider someone choosing between a full-time job out of high school paying $35,000 a year and a four-year college program. The explicit cost of college might be $20,000 a year in tuition and fees. The implicit cost is four years of wages given up.
- Explicit cost of college: $20,000 × 4 = $80,000
- Foregone wages: $35,000 × 4 = $140,000
- Total opportunity cost of attending: $220,000
That’s the number that belongs in the decision alongside the expected payoff of a degree. If the degree leads to a job paying $60,000 instead of $35,000, the extra $25,000 a year recovers the $220,000 in about nine years, and everything beyond that is net gain across a working life.
The same logic scales down. Spending a Saturday on home repairs instead of taking a freelance shift costs you whatever you would have earned. Watching a movie instead of working costs you the ticket plus the lost income. The formula doesn’t change with the stakes.
Leave Sunk Costs Out
This is where most people trip. Money you’ve already spent and can’t get back doesn’t belong in an opportunity cost calculation. If you paid $5,000 for a non-refundable training program and later found a better path, that $5,000 is gone either way. It should not pull on your forward-looking choice.
The sunk cost fallacy is the pull to keep spending because “we’ve already put so much in.” A company that has sunk $2 million into a product with poor prospects will often keep going rather than cut losses, because walking away feels like wasting the $2 million. But that money is already spent. The only live question is whether the next dollar on the old project returns more than the next dollar on the best alternative. Opportunity cost is always about what comes next.
Adjust for Inflation Over Long Horizons
When you’re comparing options across several years, inflation distorts the numbers. A dollar five years from now buys less than a dollar today. If one option returns 10% nominally and inflation runs at 3%, the real return is closer to 7%. The shortcut:
Real return ≈ Nominal return − Inflation rate
What matters is measuring both options the same way. Compare both in nominal terms or both in real terms. Mixing them produces a meaningless result.
Compare After-Tax Returns When Tax Treatment Differs
Taxes can shrink actual returns enough to flip which option wins. Interest from a savings account is taxed as ordinary income at your marginal rate. Long-term capital gains on stocks held more than a year are taxed at preferential rates of 0%, 15%, or 20%, depending on your taxable income.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses Higher earners may also owe an additional 3.8% net investment income tax on top of those rates.2Internal Revenue Service. Topic No. 559, Net Investment Income Tax
Back to the investment example. Suppose you’re in the 15% long-term capital gains bracket and the 22% ordinary income bracket. The savings account’s 4% drops to an after-tax return of about 3.12%. The index fund’s 10% nominal return, after the 15% capital gains rate, nets about 8.5%. The after-tax opportunity cost over five years comes out larger than the pre-tax version because the tax system treats the two options differently. When the tax treatment isn’t the same for both sides, always compare after-tax returns.
What the Formula Can’t Tell You
The biggest weakness of opportunity cost analysis is that it runs on estimates. You rarely know the actual return of the option you didn’t take, because you didn’t take it. Historical averages help, but past performance genuinely does not guarantee future results. Comparing a guaranteed 4% savings rate against a “historical average” 10% stock return treats a certainty and a probability as the same kind of number. They aren’t.
Non-monetary outcomes resist the math. How do you weigh an evening of studying against an evening with family? You can try to convert everything to dollars, but forcing a number onto some values produces false precision. The formula works best when both options have outcomes you can measure in the same units with reasonable confidence.
Opportunity cost also says nothing about risk. Two options with the same expected return can carry very different odds of loss. A fuller analysis pairs the opportunity cost figure with an honest read on your risk tolerance. Treat the number as one useful input, not a verdict.