In order to calculate consumer surplus, we need to define a concept called willingness to pay. A consumer's willingness to pay (WTP) for an item is the maximum amount that she would pay. Therefore, willingness to pay amounts to a dollar representation of how much utility or value an individual gets from an item. (For example, if a consumer would pay a maximum of $10 for an item, it must be the case that this consumer gets $10 of benefits from consuming the item.)
Interestingly enough, the demand curve represents the willingness to pay of the marginal consumer. For example, if demand for an item is 3 unit at a price of $15, we can infer that the third consumer values the item at $15 and thus has a willingness to pay of $15.

