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
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.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Producer A: output of good X: enter 0 or more.
- Producer A: output of good Y: enter 0 or more.
- Producer B: output of good X: enter 0 or more.
- Producer B: output of good Y: enter 0 or more.
- 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
| Symbol | Meaning |
|---|---|
| Producer A: output of good X | |
| Producer A: output of good Y | |
| Producer B: output of good X | |
| Producer B: output of good Y | |
| A's opportunity cost of 1 X (units of Y) | |
| B's opportunity cost of 1 X (units of Y) | |
| Comparative advantage in X |
Worked example
| Producer A: output of good X | 10 |
|---|---|
| Producer A: output of good Y | 5 |
| Producer B: output of good X | 6 |
| Producer B: output of good Y | 6 |
| 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 Y | Producer B |
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.