Connect via MCP →

Enter Calculation

Enter how many units of each good each country can produce with the same resources (e.g. one labor-hour or one unit of resources).

Formula

Show calculation steps (2)
  1. Country B — Opportunity Costs

    Country B — Opportunity Costs: Comparative Advantage Calculator

    Units of one good forgone to make 1 unit of the other for Country B.

  2. Comparative Advantage Rule

    Comparative Advantage Rule: Comparative Advantage Calculator

    The country with the LOWER opportunity cost for a good holds the comparative advantage in it.

Advertisement

Results

Comparative Advantage
Country A in Good X
Country B in Good Y
based on lower opportunity cost
Opportunity cost Country A Country B
1 unit of X costs (Y forgone) 0.5 1
1 unit of Y costs (X forgone) 2 1

What Is Comparative Advantage?

Comparative advantage, a cornerstone of David Ricardo's trade theory, describes the ability of a country or producer to make a good at a lower opportunity cost than another. Even if one party is more productive at everything (absolute advantage), both still gain from trade by specializing in the good where they sacrifice the least. This universal economic concept applies to any two producers and any two goods.

Two producers each making two goods, with arrows showing specialization based on lower opportunity cost
Each producer specializes in the good for which they have the lower opportunity cost, then trade benefits both.

How to Use This Calculator

Enter how many units of two goods — Good X and Good Y — each of two countries (A and B) can produce using the same fixed resources, such as one labor-hour. The calculator computes each country's opportunity cost for both goods and identifies who holds the comparative advantage in each.

The Formula Explained

If Country A can make 10 units of X or 5 units of Y with the same resources, then producing one X means giving up \(5/10 = 0.5\) units of Y. So the opportunity cost of Good X is simply Y output ÷ X output. The country with the lower opportunity cost for a good should specialize in it.

$$\text{OppCost}_{X} = \frac{\text{Good Y output}}{\text{Good X output}} \qquad \text{OppCost}_{Y} = \frac{\text{Good X output}}{\text{Good Y output}}$$

Opportunity cost formula shown as units of good Y forgone divided by units of good X produced
Opportunity cost of good X equals the units of good Y given up per unit of X produced.

Worked Example

Country A produces 10 X or 5 Y; Country B produces 4 X or 4 Y. A's opportunity cost of one X is \(5/10 = 0.5\) Y, while B's is \(4/4 = 1\) Y. Since \(0.5 < 1\), Country A has the comparative advantage in X. For Good Y, A gives up \(10/5 = 2\) X while B gives up \(4/4 = 1\) X — so Country B specializes in Y.

FAQ

Is comparative advantage the same as absolute advantage? No. Absolute advantage is about producing more output; comparative advantage is about producing at a lower opportunity cost. A country can hold absolute advantage in both goods yet still benefit from trade.

Can both countries have the advantage in the same good? No — if opportunity costs differ, each country will have the advantage in a different good, which is why trade is mutually beneficial.

What if opportunity costs are equal? Then there is no comparative advantage and no gain from specialization; the producers are equally efficient relatively.

Last updated: