Why do countries trade even when one is better at making everything? Because of comparative advantage, an idea of David Ricardo: what matters is not who is more productive, but who gives up less to produce a good. This calculator takes the output per hour of two countries in two goods, computes their opportunity costs, says who should specialize in what, and shows the range of prices at which both gain from trade.
How the calculation works
- Opportunity cost of wheat in country A = cloth per hour ÷ wheat per hour, and the same for B
- Comparative advantage goes to the country with the lower opportunity cost
- Mutually beneficial prices lie between the two countries’ opportunity costs
- Gain compares total output when each splits its hours equally with the output after specialization, valued at the midpoint price
Example
In country A an hour yields 6 wheat or 3 cloth; in country B, 2 wheat or 2 cloth. A’s opportunity cost of one wheat is 0.5 cloth, B’s is 1 cloth, so A has the comparative advantage in wheat and B in cloth, even though A is better at both. Prices between 0.5 and 1 cloth per wheat benefit both. With 100 hours each, specialization raises output by the equivalent of about 100 cloth at the midpoint price of 0.75.
Why it matters
Comparative advantage is the main argument for free trade and the division of labour, from nations to individuals and firms. It explains why a lawyer who types faster than her assistant still hires one. It also shows who gains and who loses when trade opens, which informs trade policy.
Good to know
The model’s simplifications matter: opportunity costs are constant here, but in practice they rise with specialization, and adjustment costs fall on workers moving between sectors. The result is an illustration. This tool is for education, and real trade decisions also depend on transport costs, tariffs and risk.
Related tools
The market surplus calculator shows the welfare of buyers and sellers, the price elasticity calculator measures demand response, and the GDP calculator adds up output.