Home · Finance · Economics & Macro · Comparative Advantage Calculator
Comparative Advantage Calculator
Works out each country's opportunity cost of two goods from the labour each unit takes to produce, showing who holds the comparative advantage in what.
What this calculator does
Works out each country's opportunity cost of two goods from the labour each unit takes to produce, showing who holds the comparative advantage in what. Every figure on this page is your own input — no lender's rate, no country's tax table and no market forecast is built in — and every result is computed from the formula stated below, with no hidden rounding steps. Results are estimates for planning, not financial advice.
The formula and method
Inputs are the hours (or workers) one country needs to produce one unit of each good. A country's opportunity cost of X is how much Y it gives up to make one more X.
The country with the lower opportunity cost of a good has the comparative advantage in that good and gains by specialising in it and trading — even if the other country is faster at making both goods.
Worked example
With the example inputs this page opens with (country a — labour per unit of x 10, country a — labour per unit of y 20, country b — labour per unit of x 15, country b — labour per unit of y 25), the result is 0.5000 — country a opportunity cost of x (in units of y). Computed from the inputs on this page with the formula below — change any figure and every result updates.
Quick reference
| Country A — labour per unit of X | Country A opportunity cost of X (in units of Y) |
|---|---|
| 5 | 0.2500 |
| 8 | 0.4000 |
| 10 | 0.5000 |
| 12.5 | 0.6250 |
| 15 | 0.7500 |
| 20 | 1.0000 |
Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.
Common questions
How does the Comparative Advantage Calculator work?
Works out each country's opportunity cost of two goods from the labour each unit takes to produce, showing who holds the comparative advantage in what. Labour per unit (Country A: X, Y · Country B: X, Y) → Opportunity costs. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.
What inputs does the Comparative Advantage Calculator need?
Labour per unit (Country A: X, Y · Country B: X, Y) → Opportunity costs. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.
Is the Comparative Advantage Calculator free to use?
Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.