Whether or not a country can gain by using a tariff depends crucially on how they can affect the price of the taxed good in the rest of the world. A small country cannot affect the price in the rest of the world. On the other hand, a large country can change the world price of the good by taxing the good as it moves over its border. In order to measure the change in a country's welfare with a tariff, we need to define two new terms. The first of these is consumer surplus .
Consumer surplus is the net gain for consumers from consumption.
If we add this up across all the consumers, this is the consumer surplus. Producer surplus is the net gain a producer gets for making and selling the good. Add this up across all producers, and we get the producer surplus. Welfare for a country is the sum of consumer surplus, producer surplus, and tariff revenues. When a small country implements a tariff, it raises the domestic price relative to the world price.