Skip to content
FiftyCalc Free calculators for all 50 states

Comparative Advantage Calculator

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter how much of each good each producer can make with the same resources (per worker or per day). The calculator compares opportunity costs and says who should specialize in what.

Result

Sample figures

Comparative advantage in X—

Comparative advantage in Y —

  • A's opportunity cost of 1 X (units of Y)—
  • B's opportunity cost of 1 X (units of Y)—
  • A's opportunity cost of 1 Y (units of X)—
  • B's opportunity cost of 1 Y (units of X)—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Comparative Advantage Calculator

Producer A: output of good X: enter 0 or more. Prefilled example: 10.

Producer A: output of good Y: enter 0 or more. Prefilled example: 5.

Producer B: output of good X: enter 0 or more. Prefilled example: 6.

Producer B: output of good Y: enter 0 or more. Prefilled example: 6.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Producer A: output of good X: enter 0 or more.
  2. Producer A: output of good Y: enter 0 or more.
  3. Producer B: output of good X: enter 0 or more.
  4. Producer B: output of good Y: enter 0 or more.
  5. Read the result: Comparative advantage in X; the panel also shows A's opportunity cost of 1 X (units of Y), B's opportunity cost of 1 X (units of Y), A's opportunity cost of 1 Y (units of X), B's opportunity cost of 1 Y (units of X) and Comparative advantage in Y.

How this calculator works

David Ricardo's principle of comparative advantage (1817): a producer has the comparative advantage in a good when its opportunity cost of making it, measured in the other good given up, is lower.

Opportunity cost of X = output of Y ÷ output of X with the same resources. Each producer gains from trade by specializing in the good where its opportunity cost is lower, even if one is better at making both (absolute advantage).

The formula

  1. Oax=ayax
  2. Obx=bybx
  3. Wx={0if |Oax−Obx|<1×10−121if Oax<Obx2otherwise
Symbols used in the formula
SymbolMeaning
axProducer A: output of good X
ayProducer A: output of good Y
bxProducer B: output of good X
byProducer B: output of good Y
OaxA's opportunity cost of 1 X (units of Y)
ObxB's opportunity cost of 1 X (units of Y)
WxComparative advantage in X

Worked example

Producer A: output of good X10
Producer A: output of good Y5
Producer B: output of good X6
Producer B: output of good Y6
A's opportunity cost of 1 X (units of Y)0.5
B's opportunity cost of 1 X (units of Y)1
A's opportunity cost of 1 Y (units of X)2
B's opportunity cost of 1 Y (units of X)1
Comparative advantage in YProducer B
  1. Oax=510=0.5
  2. Obx=66=1
  3. Wx=1

Comparative advantage in X Producer A

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

A makes 10 X or 5 Y, B makes 6 X or 6 Y. Who should make what?

A gives up 0.5 Y per X and B gives up 1, so A has the comparative advantage in X and B in Y.

What is the difference from absolute advantage?

Absolute advantage means producing more of a good with the same resources. Comparative advantage compares opportunity costs, and every producer has one unless their costs are identical.

Related calculators