# Why is consumer surplus the area under the curve?

So I understand that the definition of consumer surplus is the difference between what the consumer pays and what the consumer would have been willing to pay. I just don't understand why the consumer surplus is the area of the triangle, as shown in the diagram. Is it representing all the possible consumer surpluses?

Imagine that there are $$n$$ consumers in the market. You sort them by their willingness to pay from high to low. So the first consumer is willing to pay very high, and so on. Let's say the willingness to pay (sorted) is 12, 10, 9, 7, 5, 4, 2. This is represented by the downward-sloping demand curve.
Let's say the price is \$8. The first consumer's surplus is $$12-8 = 4$$. The second consumer's surplus is $$10-8 = 2$$. The third consumer's surplus is $$9-8 = 1$$. The fourth consumer onward wouldn't buy the item, since their willingness to pay is lower than the price. Their surpluses are all zero. They are the ones on the right of the equilibrium quantity. The sum of the consumers' surplus is 4 + 2 + 1 = 7, which is given by the area under the demand curve and above the price the consumer pays. Hope that helps! • +1 This is a good explanation of consumer surplus for a case in which each consumer buys at most one item (or unit of the good), but the price they are willing to pay differs. It should be noted however that consumer surplus can also arise, even for consumers with identical willingness to pay, if the number of items each is willing to pay for is greater when the price is lower - say 1 item each at price \$12, 2 at \$10, 3 at \$8. – Adam Bailey Aug 22 '19 at 14:54
Using almost 50 million individual-level observations [...], we estimate that in 2015 the UberX service generated about \$2.9billion in consumer surplus in the four U.S. cities included in our analysis. For each dollar spent by consumers, about \$1.60 of consumer surplus is generated. Back-of-the-envelope calculations suggest that the overall consumer surplus generated by the UberX service in the United States in 2015 was \\$6.8 billion.