Comparative Advantage Calculator
Calculate comparative and absolute advantage between two countries using opportunity cost analysis. Ricardian trade model with terms of trade.
| Labor hrs/unit | Good 1 | Good 2 |
|---|---|---|
| Country A | ||
| Country B |
About
Miscalculating opportunity cost leads to suboptimal trade policy. A country that fails to identify its comparative advantage may allocate labor to goods it produces relatively inefficiently, forfeiting gains from trade. This calculator implements David Ricardo's classical model: given labor requirements L per unit of two goods across two countries, it computes each country's opportunity cost OC, determines absolute and comparative advantage, and derives the mutually beneficial terms-of-trade range. The model assumes constant returns to scale, homogeneous labor, and no transport costs.
Inputs are expressed as labor hours required to produce one unit of each good. A lower value means higher productivity. Note: the Ricardian framework breaks down when one country has identical opportunity costs for both goods relative to the other. In that degenerate case no comparative advantage exists and the calculator will report accordingly. Real-world application requires adjusting for multiple factors of production (Heckscher-Ohlin) and non-constant costs.
Formulas
The opportunity cost of producing Good 1 in Country A is computed as the ratio of labor hours:
Symmetrically for Country B and for Good 2. Country A has a comparative advantage in Good 1 when:
Absolute advantage exists when one country requires fewer labor hours per unit:
The mutually beneficial terms of trade for Good 1 (expressed in units of Good 2 per unit of Good 1) lie between:
Where LA,1 = labor hours Country A needs per unit of Good 1, OCA,1 = opportunity cost of Good 1 for Country A (in units of Good 2 forgone), ToT = terms of trade (exchange ratio).
Reference Data
| Classic Example | Country A | Country B | Good 1 | Good 2 | A: Hrs/Good 1 | A: Hrs/Good 2 | B: Hrs/Good 1 | B: Hrs/Good 2 | A Advantage In | B Advantage In |
|---|---|---|---|---|---|---|---|---|---|---|
| Ricardo (1817) | England | Portugal | Cloth | Wine | 100 | 120 | 90 | 80 | Cloth | Wine |
| Textbook Standard | US | Japan | Cars | Computers | 8 | 4 | 6 | 2 | Computers | Cars |
| Agricultural vs Industrial | Brazil | Germany | Soybeans | Machinery | 2 | 10 | 5 | 4 | Soybeans | Machinery |
| Developing vs Developed | Vietnam | South Korea | Textiles | Electronics | 3 | 15 | 6 | 5 | Textiles | Electronics |
| Equal Productivity | Canada | Australia | Timber | Wool | 4 | 6 | 8 | 3 | Timber | Wool |
| Services Economy | India | UK | Software | Finance | 5 | 12 | 10 | 6 | Software | Finance |
| Resource Intensive | Saudi Arabia | Norway | Oil | Fish | 1 | 8 | 3 | 2 | Oil | Fish |
| No Comp. Advantage | Alpha | Beta | Good X | Good Y | 4 | 8 | 2 | 4 | None (equal OC) | |
| Extreme Disparity | Country M | Country N | Wheat | Steel | 1 | 20 | 10 | 5 | Wheat | Steel |
| Absolute in Both | China | Mexico | Toys | Avocados | 2 | 6 | 5 | 10 | Avocados | Toys |
| Symmetric Case | France | Italy | Cheese | Wine | 3 | 5 | 5 | 3 | Cheese | Wine |
| Large vs Small | US | Costa Rica | Microchips | Coffee | 4 | 12 | 20 | 2 | Microchips | Coffee |