Opportunity Cost Formula: Worked Examples and Graph Calculations

October 3, 2026 Updated: December 3, 2026 · By Taylor Yang · #mental models #decision-making

Choose the right opportunity cost formula, work through a numerical example, and calculate units forgone from a graph without confusing cost with a return gap.

Pick the calculation that matches the question. For a decision, use the value of the best feasible alternative you forgo. To compare two returns, subtract them on the same basis. On a production-possibility graph, divide the units of Y forgone by the extra units of X to get the cost per extra unit of X.

For a full calculation with realistic constraints, see the Saturday opportunity cost example.

In 1817, David Ricardo published a puzzle built from four numbers. A fixed amount of cloth took the labour of 100 men for a year in England and 90 in Portugal. A fixed amount of wine took 120 men in England and only 80 in Portugal. Portugal was better at both. Ricardo still argued that Portugal should import its cloth.

The opportunity cost formula depends on the question you are asking. For a choice, opportunity cost is the value of the best feasible alternative you give up. For a trade-off between two goods, you divide the units given up by the units gained. Subtracting one return from another gives you a return gap, which is a third number, not a synonym for the first one.

That is the whole difficulty with “the formula”: there is more than one, they are not interchangeable, and mixing them produces confident wrong answers. This page sorts them out, works one through in five steps, and shows how to read the same trade-off off a graph.

Ricardo’s puzzle is one division

Ricardo never used the phrase “opportunity cost.” Modern textbooks still teach his example with it, because the per-unit formula solves the puzzle.

CountryLabour for the clothLabour for the wineOpportunity cost of the wineOpportunity cost of the cloth
England100 men-years120 men-years120 ÷ 100 = 1.2 cloth100 ÷ 120 ≈ 0.83 wine
Portugal90 men-years80 men-years80 ÷ 90 ≈ 0.89 cloth90 ÷ 80 = 1.125 wine

When England makes the wine, the labour it uses could have made 1.2 units of cloth. Portugal gives up only 0.89 cloth for the same wine. So wine is cheaper in Portugal and cloth is cheaper in England, measured in what each country sacrifices. Ricardo’s conclusion follows: “England would give the produce of the labour of 100 men, for the produce of the labour of 80.”

Comparing labour hours alone made Portugal look better at everything. Writing the cost in units of the other good made the right specialisation obvious. Pick the formula that answers your question, and keep the units attached.

Three formulas for three questions

QuestionCalculationWhat the answer means
What am I giving up by choosing A?Value of the best alternative to AThe forgone value
How much more return would B provide than A?Return from B − return from AThe relative return gap
How much Y do I give up for each additional X?Units of Y given up ÷ additional units of XOpportunity cost per unit of X

You may see OC = FO − CO, where FO is the return from the forgone option and CO is the return from the chosen option. That subtraction compares two returns; under the next-best-alternative definition, FO itself is the forgone value. Write which quantity you mean before you calculate.

One selected option sits beside the best feasible alternative, while a weaker alternative is set farther away
One selected option sits beside the best feasible alternative, while a weaker alternative is set farther away

Forgone value versus return gap

Take a one-year comparison of net returns, after each project’s relevant costs:

ProjectIllustrative net returnStatus
A$600Chosen
B$900Best alternative
C$400Other alternative

Choosing A forgoes B’s $900 net return. The return gap is $900 − $600 = $300. Adding B and C to get $1,300 would count two alternatives you could never have done together. Calling $300 the entire value forgone mixes two questions into one number.

A classroom case holds the same three quantities apart more cleanly. A student takes A levels instead of a job: tuition is $1,000 a year for two years, and the job would pay $5,000 a year. The cost is $2,000, the tuition actually paid. The opportunity cost is $10,000, the pay given up. The total economic cost is $12,000. The most common error in the whole subject is to call that $12,000 the opportunity cost, because the forgone pay is already the opportunity cost and the tuition sits beside it.

Before you calculate anything, write down which of the three you want: the forgone value, the return gap, or the per-unit cost. Most bad answers to “what is the opportunity cost” are not arithmetic errors. They are answers to a different question.

Calculate it in five steps

  1. State the choice and resource. For example: “Which project gets our one available machine next week?”
  2. List the realistic alternatives. Include doing nothing if it is a real option. Remove anything that breaks the budget, deadline, or capacity.
  3. Choose a common comparison basis. Use the same period and consistent gross or net figures. If you use net benefits, do not subtract the same costs again.
  4. Find the best alternative you would give up. With mutually exclusive projects, this is one alternative. A combination counts as one alternative only if you could actually carry it out.
  5. Calculate and label the answer. Say “$900 forgone net return,” “$300 return gap,” or “3 units of Y per additional X.” Record assumptions beside it.

If the result depends on a forecast, rerun it with a less favorable assumption. A precise subtraction does not make an uncertain input reliable. A trade-off is also not the same thing as the value of the best alternative — the trade-off vs opportunity cost guide keeps those two apart.

Read opportunity cost from a graph

On a production possibilities frontier, getting more of one good means giving up some of another. The ratio is the same one Ricardo’s numbers needed:

Opportunity cost of X = decrease in Y ÷ increase in X

Read the axis labels first, because reversing the direction changes both the numerator and the units.

PointUnits of XUnits of Y
A218
B412
C62
A fictional production frontier connects A at 2 X and 18 Y, B at 4 X and 12 Y, and C at 6 X and 2 Y
A fictional production frontier connects A at 2 X and 18 Y, B at 4 X and 12 Y, and C at 6 X and 2 Y

The cost rises from the first segment to the second, and the 4 Y average does not mean every extra X costs exactly 4 Y. Ricardo’s countries had constant costs, which would draw a straight line. Rising costs like these are the subject of the law of increasing opportunity cost.

Going back from B to A gives up 2 X to gain 6 Y, so the reverse cost is 1/3 X per Y. That is the reciprocal in different units, and it does not contradict the first answer.

When the formula misleads

Comparing totals instead of ratios. Portugal’s lower labour counts hid the real answer. Two options can differ in total cost while the sacrifice per unit points the other way.

Adding every rejected choice. Use the single best alternative you could really have taken. An impossible bundle of everything you turned down is not a cost you faced. The same confusion turns a career pivot into a “$500,000 opportunity cost” — but $500,000 is exactly the real trade-off: $300,000 of forgone wages plus the $200,000 loan you would only take on the new path. What is wrong is the label, not the total.

Pricing every hour at your wage. An evening is worth your hourly rate only if paid work was actually available and you would have taken it.

Counting sunk costs. An unrecoverable fee is the same under every option, so it cannot separate them. See sunk cost fallacy vs opportunity cost.

Trusting the model’s assumptions. Ricardo’s example ignores transport costs, other inputs, and rising costs. A clean ratio is only as good as the conditions behind it, and a long-run average return is not a forecast for a two-year decision.

Ignoring what the analysis itself costs. If two evenings of comparison matter more to you than the $600 gap you are trying to close, the calculation has produced a decision that costs more than it decides.

A worksheet for your own trade-off

FieldFill in
Choice and limited resourceWhat can only be used once?
Feasible optionsWhat could I actually do?
Chosen optionWhich option am I evaluating?
Best alternativeWhat would I otherwise choose?
Comparison basisSame period, units, and treatment of costs
Forgone valueValue of the best alternative
Optional return gapAlternative value minus chosen value
Uncertain assumptionWhat could change the ranking?
A trade-off notebook keeps the chosen option, best alternative, and comparison units visible together
A trade-off notebook keeps the chosen option, best alternative, and comparison units visible together

Keep the choice, the alternative, and the units in the same record. A worksheet that records “the opportunity cost” without units will be misread the next time you open it.

For practice, choose P with a net benefit of $80 when the other options, Q and R, offer $110 and $65. The forgone value is $110; the return gap is $30. You do not add Q and R.

Frequently asked questions

What is the formula for opportunity cost?

For a choice, find the value of the best option you could actually have taken instead. For a per-unit trade-off, divide what you give up by what you gain. Subtracting the chosen return from the alternative return gives a comparison gap, so label it that way.

How do you calculate opportunity cost with a graph?

Read two points and the axis units. Divide the reduction in the forgone good by the increase in the desired good. On a curved frontier, a ratio between two points is an average over that interval.

What is a famous example of opportunity cost?

Ricardo’s England and Portugal. England’s wine cost 1.2 units of cloth; Portugal’s cost about 0.89. That gap, not total labour, decides who should make what.

Your 5-minute opportunity cost check

Choice:
Limited resource (money / hours / machine time):
Best feasible alternative (one, not a bundle):
Question I'm answering: forgone value / return gap / per-unit cost
Answer, with units:
Assumption that could flip the ranking:

Two pages this guide leans on are worth reading next: the law of increasing opportunity cost for what happens when the per-unit cost climbs, and sunk cost fallacy vs opportunity cost for the line items that belong in neither column. To turn one idea a day into a habit, Daily Read is built for that. And for the core idea underneath every formula here, start with the opportunity cost guide.

Font