In economic theory, the law of comparative advantage states that, even if one of two producers had an absolute advantage over the other in every type of activity, both will benefit if each concentrates upon what he does best and exchanges the product with the other . For example it would pay a writer of best-sellers who was better at plumbing than any of the available plumbers, to stick to his writing and hire a plumber. What is true of skill differences is true also of other advantages, such as the possession of better tools or access to more advanced technology. It was first formulated in terms of differences between countries, and David Ricardo illustrated it in terms of the trade in cloth and wine between Britain and Portugal . The Nobel Prize winner, Paul Samuelson, once gave it as the best proposition from the social sciences that was both true and non-trivial.
The logical basis of the law of comparative advantage can be demonstrated by a simple example.
- Able needs 10 pairs of shoes and 20 shirts each year, either of which he can either make himself or obtain by trading with Ben. It takes Able 20 weeks to make 10 pairs of shoes and 10 weeks to make 20 shirts so, if he decides to make them both, he has to spends a total of 30 weeks a year to meet his needs. If, on the other hand, he could get 10 pairs shoes from Ben in exchange for fewer than 20 shirts, he would have to work fewer hours to get all the shoes and shirts he needs.
- It would be to Ben’s advantage to provide Able with 10 pairs of shoes for fewer than 20 shirts provided that he is able to make the 10 pairs of shoes in less time than it would take him to make the 20 shirts. That comparative advantage would provide a motive that is independent of any differences in absolute advantage. The exchange would be mutually beneficial even if Ben needed both more time than Able's 20 weeks to make 10 pairs of shoes and more time than Able's 10 weeks to make 20 shirts.
- The logical conclusion is thus that even if Ben’s absolute costs were all higher than Able's , the difference in comparative costs would make the exchange beneficial to both Able and Ben.
The logic of the example would be unchanged by substituting the names of companies or countries for the names Able and Ben, or by substituting different commodities for shoes and shirts. It does not depend upon observation, and it does not depend upon any postulate except rationality. In its international context, in particular, it does not depend, as is sometimes claimed, upon the assumption that there is perfect competition.
The validity of the law of comparative costs is independent of any assumption concerning the origins of the postulated comparative costs. International trade theorists have generally assumed that cost differences between countries arise from differences in the quality and availability of the factors of production and in the technology available for their use. The Heckscher-Ohlin Theorem , assumed that there were no differences of technology between developed countries, and that cost differences arise from international differences in the relative abundance of labor and capital (referred to as factor endowments). Based upon the law of comparative advantage, the theorem predicted that countries with relatively abundant capital resources would tend to export capital-intensive products and that countries with relatively abundant labor resources would export mainly labor–intensive products. The law gave a good fit to nineteenth century trade, but was undermined by Wassily Leontief's 1954 finding  that the U.S. (the world’s most capital-abundant country) exported labor-intensive commodities and imported capital-intensive commodities. It is now generally accepted that other factors such as political stability and human and social capital must be included in any attempt to explain the pattern of international trade.
In the paragraph on comparative advantage in Ricardo’s Principles of Political Economy he shows that, because of its comparative advantage in producing wine, it would pay Portugal to import cloth from England, is followed by a paragraph in which he argues that it would pay English industrialists to install cloth-making capital in Portugal and make their cloth there – but that in practice they were reluctant to do so . Some writers, such as the political philosopher John Gray  have concluded that the law of comparative advantage holds only on Ricardo’s assumption of capital immobility, and that present-day capital mobility renders the law invalid. The law does not, however, depend upon that particular assumption: it depends only upon the existence of comparative advantage, whatever its source. Martin Wolf has argued  that international differences in the levels of social and human capital are greater than they have ever been, and that far from being less relevant than before, comparative advantage has never been more relevant.
- David Ricardo On the Principles of Political Economy and Taxation Chapter 7 John Murray, 1821. Third edition.(First published: 1817)
- Douglas Irwin "Free Trade Under Fire" Page 25. Princeton: Princeton University Press
- See the article on International economics
- Wassily Leontief, Domestic Production and Foreign Trade: The American Capital Position Re-examined Proceedings of the American Philosophical Society, vol. XCVII p332 September , 1953
- John Gray. False dawn: The Delusions of Global Capitalism New York: The New Press, 1998.
- Martin Wolf Why Globalization Works Yale Nota Bene 2005