# What is the consumer surplus?

Computes consumer surplus and producer surplus from the market price and quantity with straight-line demand and supply, or for single purchases, with total social surplus.

- Page: https://www.acalculator.org/finance/consumer-surplus-calculator
- JSON spec: https://www.acalculator.org/finance/consumer-surplus-calculator.json
- Version: e95005b56b98

## Default answer

Example with the default inputs (Market Demand and supply lines, Market price $80.00, Quantity sold 28, Highest price a buyer would pay $120.00, Lowest price a seller would accept $40.00): Consumer surplus is $560.00.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| mode | Market | Straight-line demand and supply curves, or purchases where every unit has the same value and cost. |
| p | Market price | The price buyers pay and sellers receive for each unit. |
| q | Quantity sold | How many units are bought and sold at the market price. |
| pmax | Highest price a buyer would pay | Where the demand line meets the price axis: the price at which nobody would buy. For one buyer, the most they would pay per unit. |
| pmin | Lowest price a seller would accept | Optional: where the supply line meets the price axis, or the least the seller would take per unit. Leave empty to skip producer surplus. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| consumer | Consumer surplus | What buyers would have paid minus what they paid, in total. |
| producer | Producer surplus | What sellers received minus the least they would have accepted, in total. |
| social | Social surplus | Consumer surplus + producer surplus. |
| perUnit | Consumer surplus per unit | Consumer surplus ÷ quantity. |

## Method

Lines: CS = ½ × Q × (highest price − P), PS = ½ × Q × (P − lowest price). Same value per unit: CS = Q × (highest price − P), PS = Q × (P − lowest price). Social surplus = CS + PS.

## Assumptions

- Lines mode: demand and supply are straight lines through the market point, so each surplus is a triangle.
- Same value per unit: every unit is worth the same to the buyer and costs the same to the seller.

## Worked examples

1. mode = linear, p = $80.00, q = 28, pmax = $120.00, pmin = $40.00 gives consumer = $560.00, producer = $560.00, social = $1,120.00, perUnit = $20.00. Source: https://openstax.org/books/principles-economics-3e/pages/3-5-demand-supply-and-efficiency.
2. mode = single, p = $30.00, q = 1, pmax = $45.00, pmin = $18.00 gives consumer = $15.00, producer = $12.00, social = $27.00. Source: https://openstax.org/books/principles-economics-3e/pages/3-5-demand-supply-and-efficiency.
3. mode = linear, p = $10.00, q = 100, pmax = $30.00 gives consumer = $1,000.00, perUnit = $10.00. Source: https://openstax.org/books/principles-economics-3e/pages/3-5-demand-supply-and-efficiency.

## FAQ

### How do I calculate consumer surplus?

With a straight-line demand curve, consumer surplus is the triangle between the demand line and the market price: ½ × quantity × (highest price buyers would pay − market price). At $80 and 28 units, with demand reaching 0 at $120: ½ × 28 × 40 = $560.

### How do I calculate producer surplus?

With a straight-line supply curve, producer surplus is the triangle between the market price and the supply line: ½ × quantity × (market price − lowest price a seller would accept). At $80 and 28 units, with supply starting at $40: ½ × 28 × 40 = $560.

### What is consumer surplus for a single purchase?

The most you would have paid minus what you paid. If you would pay $45 for a ticket and buy it for $30, your consumer surplus is $15. Choose “Same value per unit” for this case.

### What is social surplus?

Consumer surplus plus producer surplus: the total gain to buyers and sellers from trading. OpenStax calls a market efficient when it produces the quantity that makes social surplus as large as possible.

### Where do the highest and lowest prices come from?

They are where the demand and supply lines meet the price axis. If demand is P = 120 − 2Q, the highest price is $120; if supply is P = 40 + Q, the lowest price is $40. Read them from your graph or equations.

### Can consumer surplus be negative?

No. If the market price is above the highest price any buyer would pay, nobody buys, and the page gives no answer.

## Sources

- OpenStax. Principles of Economics 3e, §3.5 Demand, Supply, and Efficiency (consumer surplus, producer surplus, social surplus; tablet example at $80 and 28 million), retrieved 2026-10-18. https://openstax.org/books/principles-economics-3e/pages/3-5-demand-supply-and-efficiency
