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.

Your figures

Example result — edit the figures to make it yours

0.5

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.

Country B opportunity cost of X (in units of Y)0.6000
Country A opportunity cost of Y (in units of X)2.0000
Country B opportunity cost of Y (in units of X)1.6667

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

Opportunity cost of X = Labour per unit of X ÷ Labour per unit of Y

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

Quick reference — varying country a — labour per unit of x
Country A — labour per unit of XCountry A opportunity cost of X (in units of Y)
50.2500
80.4000
100.5000
12.50.6250
150.7500
201.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.