User Rating 0.0
Total Usage 0 times
Labor hrs/unit Good 1 Good 2
Country A
Country B
Presets:
Is this tool helpful?

Your feedback helps us improve.

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.

comparative advantage opportunity cost trade Ricardo absolute advantage economics calculator terms of trade

Formulas

The opportunity cost of producing Good 1 in Country A is computed as the ratio of labor hours:

OCA,1 = LA,1LA,2

Symmetrically for Country B and for Good 2. Country A has a comparative advantage in Good 1 when:

OCA,1 < OCB,1

Absolute advantage exists when one country requires fewer labor hours per unit:

LA,1 < LB,1 Country A has absolute advantage in Good 1

The mutually beneficial terms of trade for Good 1 (expressed in units of Good 2 per unit of Good 1) lie between:

min(OCA,1, OCB,1) < ToT < max(OCA,1, OCB,1)

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 ExampleCountry ACountry BGood 1Good 2A: Hrs/Good 1A: Hrs/Good 2B: Hrs/Good 1B: Hrs/Good 2A Advantage InB Advantage In
Ricardo (1817)EnglandPortugalClothWine1001209080ClothWine
Textbook StandardUSJapanCarsComputers8462ComputersCars
Agricultural vs IndustrialBrazilGermanySoybeansMachinery21054SoybeansMachinery
Developing vs DevelopedVietnamSouth KoreaTextilesElectronics31565TextilesElectronics
Equal ProductivityCanadaAustraliaTimberWool4683TimberWool
Services EconomyIndiaUKSoftwareFinance512106SoftwareFinance
Resource IntensiveSaudi ArabiaNorwayOilFish1832OilFish
No Comp. AdvantageAlphaBetaGood XGood Y4824None (equal OC)
Extreme DisparityCountry MCountry NWheatSteel120105WheatSteel
Absolute in BothChinaMexicoToysAvocados26510AvocadosToys
Symmetric CaseFranceItalyCheeseWine3553CheeseWine
Large vs SmallUSCosta RicaMicrochipsCoffee412202MicrochipsCoffee

Frequently Asked Questions

Absolute advantage in both goods does not eliminate comparative advantage. Ricardo's key insight is that trade gains depend on relative (opportunity) cost, not absolute productivity. Even if Country A produces both goods with fewer labor hours, it should specialize in the good where its opportunity cost is lowest. The calculator correctly identifies comparative advantage in this scenario by comparing OC ratios, not absolute labor values.
No comparative advantage exists when both countries have identical opportunity costs for both goods. Mathematically, this occurs when L(A,1)/L(A,2) equals L(B,1)/L(B,2). In that degenerate case, neither country benefits from specialization under the Ricardian model. The calculator detects this condition by checking if the OC values are equal (within floating-point tolerance of 0.0001) and reports it explicitly.
Both input formats are valid and produce equivalent results. This calculator uses labor hours per unit (input requirement) because it directly represents cost. A higher number means the good is more expensive to produce. The opportunity cost formula OC = L₁/L₂ then gives units of Good 2 forgone per unit of Good 1 produced. If using output per hour, the OC formula inverts to OC = Output₂/Output₁.
The terms-of-trade range defines the set of exchange ratios where both countries benefit. Any ratio between the two countries' opportunity costs makes both better off than autarky. The closer the actual terms of trade are to a country's own opportunity cost, the smaller that country's gains. In practice, the equilibrium terms of trade depend on relative demand, which the Ricardian model does not specify. The calculator provides the full feasible range.
No. The Ricardian model implemented here assumes exactly two countries, two goods, and one factor of production (labor). For multiple goods, a chain of comparative advantage ordered by relative labor productivity applies. For multiple factors, the Heckscher-Ohlin model is more appropriate. This calculator is designed for the standard 2×2 framework used in introductory and intermediate trade theory.
A proportional improvement in both goods for one country (e.g., halving all labor requirements) changes absolute advantage but leaves opportunity costs unchanged. Comparative advantage shifts only when productivity changes are asymmetric across goods. For example, if Country A improves its Good 1 productivity by 50% but Good 2 stays constant, its OC for Good 1 drops, potentially shifting or reinforcing its comparative advantage in Good 1.