rapunzl logo green investing castle
Request Free DemoFree Demo
rapunzl mobile hamburger icon

Opportunity Cost Calculator

An opportunity cost calculator shows what a purchase gives up when the same money could be invested instead.

What else could my money become?

Purchase frequency

Once is a single purchase today. Every month and every year repeat the same cost at the end of each month or year. The money that would have been spent is invested on the same schedule.

What one purchase costs. Type a plain number like 180, with no dollar sign or commas. The most we accept is $1,000,000.

How many whole years the money has to grow. We accept 1 to 80.

The yearly return you want to try, as a plain number like 10.2. It starts at the S&P 500's long-run return for January 1928 to June 2026, which is an assumption and not a forecast. We accept 0 to 30.

How Does an Opportunity Cost Calculator Work?

An opportunity cost calculator totals what the purchases cost, then grows the same money as if it had been invested on the same schedule. In the formulas, r is the yearly return as a decimal, y the years and price the amount of one purchase.

value = price × (1 + r)^y

value = price × ((1 + r)^y - 1) ÷ r

value = price × ((1 + i)^m - 1) ÷ i, where i = (1 + r)^(1/12) - 1 is the growth for one month and m is the number of months.

  1. Choose a cost, a purchase frequency, a number of years and a yearly return.
  2. We total what is spent. A one-time purchase is paid once, an every-month purchase is paid 12 times a year and an every-year purchase is paid once a year.
  3. Then we invest the same money on the same schedule. A one-time price goes in on day one. A monthly or yearly price goes in at the end of each month or year.
  4. The return is an effective yearly return, so 12 months of growth add up to exactly that rate. We turn it into a rate for one month with (1 + r)^(1/12) - 1.
  5. Growth is the invested value minus the total spent. The multiple of total spent is the invested value divided by the total spent.
  6. The table shows the same plan every 5 years, and always the last year.
$180 every year for 10 years, invested instead and shown every 5 years. The 10.2% return is the S&P 500's nominal annualized total return for January 1928 to June 2026, before inflation, taxes and fees. The return is an assumption, and history is not a forecast.
YearTotal spentIf investedGrowth
0$0$0$0
5$900$1,103$203
10$1,800$2,896$1,096

The Math Behind Opportunity Cost

What does a pair of sneakers really cost?

Opportunity cost is the value of the next best alternative you give up when you choose something, and money is only one way to measure it. Rapunzl's calculator measures one alternative: investing the price instead. For the default price of a pair of sneakers, $180 every year for 10 years costs $1,800, and the same money invested at an assumed 10.2% a year would be worth about $2,896. The difference, $1,096, is the growth the investing alternative adds. It is one alternative among many, and the sneakers have value to the person wearing them, so the number shows a trade-off rather than a verdict. The return is an assumption, and history is not a forecast.

Does it matter how often the purchase repeats?

How often a purchase repeats matters a great deal, because every repeat adds to the total spent and gives the invested money more to grow from. Rapunzl's calculator shows it by changing only Purchase frequency for the default $180. Bought once, it costs $180 and would be worth about $475 after 10 years, which is 2.6 times the money spent. Every year it costs $1,800 and would be worth about $2,896, or 1.6 times the money spent. Every month it costs $21,600 and would be worth about $36,353, or 1.7 times the money spent. The one-time purchase has the highest multiple because all of it is invested on day one. A repeating purchase is invested at the end of each month or year, so each payment has less time to grow. The return is an assumption, and history is not a forecast.

What changes the answer more, the years or the return?

The years and the return both change the answer, and the calculator lets you move each one alone. Rapunzl's calculator starts at 10.2% for 10 years, which ends at about $2,896. Double the years to 20 and it ends at about $10,547, with $3,600 spent. Keep the 10 years and lower the return to 4%, and it ends at about $2,161. At 7% it ends at about $2,487. At 0% the invested value equals the $1,800 spent, so all of the growth comes from the return. Those returns are assumptions, and history is not a forecast.

Using the Calculator in Class

Hold up a pair of sneakers and ask students what else the same money could do, then ask them to name their next best alternative before you show the investing line. Project the default, $180 every year for 10 years, and compare the $1,800 spent with the $2,896 it could grow to. Change only Purchase frequency to Once and ask why the total spent drops to $180. Then try returns of 4% and 7% and ask what the result depends on. Close by asking what the sneakers give the buyer that the investing line cannot show. The modules below cover opportunity cost, saving versus investing and budgeting, and the post has a worksheet for the same idea.

Questions about the opportunity cost calculator

At an assumed 10.2% a year, $180 every year for 10 years costs $1,800 and would grow to about $2,896 if invested instead. That is $1,096 of growth, or 1.6 times the money spent. The return matters a lot: the same plan ends at about $2,161 at 4% and about $2,487 at 7%. These are assumed returns, and history is not a forecast.

Opportunity cost is the value of the next best alternative you give up when you make a choice. Spending $180 on a pair of sneakers gives up whatever else that $180 could have done, such as being saved, invested or spent on something else. This calculator measures one alternative, investing the money, and it leaves out the value of the sneakers themselves. The purchase has value to the buyer too, so this shows one side of a trade-off, not a verdict.

Compare what the purchase costs with the value of the alternative you picked. When that alternative is investing, a one-time purchase uses value = price × (1 + r)^y, where r is the yearly return as a decimal and y the years. $180 invested once at 10.2% for 10 years becomes about $475. A repeating purchase needs a sum over every payment, and the calculator does that for you, which is how $180 every year for 10 years reaches $2,896. The growth is the invested value minus the money spent, here $1,096.

The starting return is the S&P 500's nominal annualized total return for January 1928 to June 2026, computed from Robert Shiller's data with dividends reinvested. It is before inflation, taxes and fees. A different start or end date gives a different number, and you can type any return from 0 to 30. For the default plan, 7% ends at about $2,487 and 10.2% ends at about $2,896. Real returns rise and fall from year to year, and history is not a forecast.

No. The invested value is arithmetic on the numbers you enter, not a prediction. It assumes the same return every year and a payment at the end of each month or year, and it leaves out taxes, account fees and inflation. Prices rise over time, so $2,896 after 10 years buys less than $2,896 does today. Real investments rise and fall, and history is not a forecast.

Want this in your school?

Rapunzl is a personal finance course with a real-time investing simulator, built for classrooms. Request a free demo, or pass this page to a teacher who would want it.

Request A Free Demo

Bring This And Much More To Your Child

Your child gets $10,000 in practice money to invest at real market prices, plus lessons on budgeting, credit and paying for college. They can work through all of it at home.

See Rapunzl For Parents

Sources. Econlib (Library of Economics and Liberty): Opportunity Cost: Opportunity cost is the value of the next-highest-valued alternative use of a resource. Computed from the repo's src/tools/data/sp500-monthly.json, Robert J. Shiller's S&P Composite price and dividend (ie_data.xls), monthly total-return index, dividends reinvested: as of January 1928 to June 2026 (computed 2026-10-17). Figures last checked October 12 2026.

The starting return is the S&P 500's nominal annualized total return for January 1928 to June 2026, with dividends reinvested. A one-time purchase is invested on day one, and a monthly or yearly purchase at the end of each month or year. The return is an effective yearly return. It is an assumption, results are before taxes, fees and inflation, and history is not a forecast.