Skip to content
Omnikalc

Who should specialize in what, and how much do both gain?

Enter the output per hour of two countries in two goods: get opportunity costs, comparative advantage, the range of beneficial prices and the gain from trade.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Results

Country A: opportunity cost of 1 wheat (cloth)

0.500

Country A has the comparative advantage in good X (wheat); country B in good Y (cloth)
Country B: opportunity cost of 1 wheat (cloth)
1.000
Country A: opportunity cost of 1 cloth (wheat)
2.000
Country B: opportunity cost of 1 cloth (wheat)
1.000
Lowest mutually beneficial price of 1 wheat (cloth)
0.500
Highest mutually beneficial price of 1 wheat (cloth)
1.000
Gain from specialization at the midpoint price (in cloth)
100.0

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.

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.

Frequently asked questions

What is comparative advantage?

A country has a comparative advantage in a good when its opportunity cost of producing it, the amount of other goods given up, is lower than another country's. It is what makes trade beneficial even when one country is better at everything.

What is the difference with absolute advantage?

Absolute advantage compares productivity: who makes more of a good with the same resources. Comparative advantage compares opportunity cost. A country can have the absolute advantage in both goods yet a comparative advantage in only one.

What is the range of mutually beneficial prices?

Trade benefits both countries if the price of one good in terms of the other lies between the two opportunity costs. Each country then obtains the good for less than it would cost to make it at home.

What are the assumptions of the model?

Two countries, two goods, constant opportunity costs, no transport costs, and full mobility of labour between the two sectors within each country. Real trade involves many more factors.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.