Price ceiling and price floor calculator
Set a maximum or minimum price and the demand and supply lines. The graph draws the legal price as a line, brackets the shortage or surplus at it, shades what buyers, sellers and the government end up with, and works out the deadweight loss.
Inputs
A ceiling only matters when it is set below the equilibrium price, and a floor only when it is set above it.
The price the government does not let the market go above (ceiling) or below (floor).
The price at which buyers want nothing (a in P = a − bQ).
How much the price falls for each extra unit (b). Both lines need a slope above 0 here.
The lowest price at which sellers offer anything (c in P = c + dQ).
How much the price must rise for each extra unit sellers offer (d).
Shortage
15
At the ceiling of 30, buyers want 35 units but sellers offer only 20, so 15 units of demand go unmet. Without it the price would be 40.
- Quantity buyers want
- 35
- Quantity sellers offer
- 20
- Quantity traded
- 20
- Consumer surplus
- 1,000
- Producer surplus
- 200
- Deadweight loss
- 150
- Total surplus
- 1,200
- Equilibrium without it
- P* 40 · Q* 30
- Demand
- P = 100 − 2Q
- Supply
- P = 10 + Q
- Demand (D)
- Supply (S)
- Consumer surplus 1,000
- Producer surplus 200
- Deadweight loss 150
Drag a line, its round knob or its ring to move it. On a keyboard, tab to a knob and use the arrow keys.
Demand P = 100 − 2Q and supply P = 10 + Q cross at a price of 40 and a quantity of 30. A price ceiling of 30 is below that, so buyers want 35 units but sellers offer only 20: a shortage of 15, and only 20 units are traded. Consumer surplus is 1,000 (900 before), producer surplus 200 (450 before), and 150 is lost as deadweight loss.
How to read this graph
- Price goes up the side, quantity along the bottom. The blue line is demand and the orange line is supply; drag either one, or type its equation.
- The dashed horizontal line is the legal price. A ceiling is a maximum price and a floor is a minimum.
- The bracket on it is the shortage or surplus. It runs from the quantity buyers want at that price to the quantity sellers offer. Under a ceiling sellers offer less than buyers want; under a floor they offer more.
- Only the smaller quantity is traded. That is the quantity under the ceiling (supply) or under the floor (demand).
- The shaded areas show who gets what. Blue is consumer surplus, orange is producer surplus, and the hatched triangle is the deadweight loss from trades that no longer happen. Under a floor, the extra hatched shape is the cost of making output nobody buys, and the green dashed outline is what the government pays to buy it.
How it works
demand P = a − b × Q supply P = c + d × Q legal price L quantity wanted Qd = (a − L) ÷ b quantity offered Qs = (L − c) ÷ d traded Q = min(Qd, Qs) ceiling below P*: shortage = Qd − Qs floor above P*: surplus = Qs − Qd consumer surplus = area under demand out to Q, minus L × Q producer surplus = L × (units sold) − the cost of the units made deadweight loss = surplus at equilibrium − (consumer + producer surplus + government)
- A limit on the other side does nothing. A ceiling at or above P* or a floor at or below it leaves the market where it was.
- Under a ceiling the goods go to the buyers who value them most, so consumer surplus is the area under demand up to Q, less the price paid.
- Under a floor there are three cases for the unsold units. Make only what sells: Q = Qd. Make it all, waste the rest: sellers sell Qd but pay for Qs. Government buys the surplus: it pays the floor price (plus any storage) for Qs − Qd units.
- Deadweight loss splits into two parts: the trades that no longer happen, and (under a floor with extra output) the cost of making goods that nobody uses.
- Both lines need a slope above zero here, or the quantities at a price are not finite.
- Nothing has units. Use dollars and units, euros and tonnes, or whatever your problem uses.
Worked example
Kansas State’s beef market: demand P = 20 − 2Q, supply P = 4 + 2Q and a ceiling of 10. Open it in the calculator.
- Free market: 20 − 2Q = 4 + 2Q gives Q* = 4 and P* = 12. Consumer surplus and producer surplus are each 16.
- At the ceiling of 10: sellers offer Q = 3 (10 = 4 + 2Q) and buyers want 5 (10 = 20 − 2Q), a shortage of 2. Only 3 are traded.
- Consumer surplus is 21: the area under demand out to 3 units is 51, less the 30 buyers pay (10 × 3). It rises by 5 because the buyers who get a unit pay less. Producer surplus falls to 9.
- Deadweight loss is 2: the 16 + 16 = 32 of surplus fell to 30. Buyers gained 5, sellers lost 7.
More to try:
- UW–Madison coffee, $5 ceiling: Qs = 2P − 8 and Qd = 16 − P give a shortage of 9. An $11 floor leaves a surplus of 9, and a $10 ceiling does nothing.
- Kansas State wheat, the three floor cases: a floor of 8 leaves 4 unsold. Switch “What happens to unsold output” to waste it or to have the government buy it and compare the producer surplus and the deadweight loss.
- UW–Madison cotton: a $60 floor, consumers buy 4,000, producers make 6,000 and the government buys 2,000, at $120,000 before $20,000 of storage.
- OpenStax rent control: from $500 to $700 the book’s table is a straight line, and a ceiling held at $500 leaves 15,000 rented against 19,000 wanted, a shortage of 4,000.
Tips
- Start with the equilibrium. Set the limit equal to P* and you get no shortage or surplus; then nudge it and see the shortage grow.
- The gap grows as the limit tightens. Every step further from the equilibrium price widens the bracket, and the deadweight loss grows faster than the gap.
- Flatter lines mean bigger gaps. The more sensitive buyers and sellers are to price (flatter lines), the larger the shortage or surplus from the same limit.
- Check the quantities by hand. Put the legal price into Qd = (a − L) ÷ b and Qs = (L − c) ÷ d; if you get the same two numbers as the brackets, your equations are entered correctly.
- The model is a simplification. It assumes straight lines, a single price and no black market. Real ceilings also change quality and search costs, which the graph does not show.
FAQ
Why does a price ceiling above the equilibrium price do nothing?
Because the market never wants to go that high. A ceiling only bites when it is below the equilibrium price, and a floor only bites when it is above it. The calculator says so and shows no shortage or surplus. Try moving the limit across the equilibrium price to watch the effect switch on.
How do you find the shortage or the surplus?
Put the legal price into both equations. The quantity buyers want is Qd = (a − L) ÷ b and the quantity sellers offer is Qs = (L − c) ÷ d. Under a ceiling the shortage is Qd − Qs; under a floor the surplus is Qs − Qd. In the Wisconsin coffee problem a $5 ceiling gives 11 − 2 = 9 units short.
Who gets the goods when there is a shortage?
The model cannot say; it depends on how they are rationed. The surplus figures here follow Barkley's welfare analysis, where the goods go to the buyers who value them most (queues, black markets and favours can send them elsewhere). If lower-value buyers get some of them, consumer surplus is lower than shown.
What are the three choices for the unsold output under a floor?
They are Barkley's three cases for a wheat price support. Sellers can make only what sells, which loses the trades between the floor and the old price. They can make it all and watch the rest go to waste, which adds the cost of making it. Or the government can buy it at the floor, which moves that cost onto taxpayers. In his example the last two both lose 28; the first loses 4.
Does a price floor always help sellers?
No. Sellers gain the higher price on the units they sell but lose the sales between the floor and the old price, and if they produce output that goes unsold they pay for it. In Barkley's first wheat case producer surplus rises by 2; in his second, where the extra output is wasted, it falls by 22.
Sources
- The Economics of Food and Agricultural Markets, 2.1 Price Ceiling, Andrew Barkley, Kansas State University (New Prairie Press), via LibreTexts. A beef ceiling of 10 on P = 20 − 2Q and P = 4 + 2Q cuts the quantity from 4 to 3, with consumer surplus 21, producer surplus 9 and deadweight loss 2.
- The Economics of Food and Agricultural Markets, 2.2 Price Support, Andrew Barkley, Kansas State University (New Prairie Press), via LibreTexts. A wheat price support of 8 on P = 10 − Q and P = 2 + Q in three cases (sellers cut back, sellers produce the surplus, the government buys it), with deadweight losses of 4, 28 and 28.
- ECON 101 Fall 2012, Answers to Homework #2, question 5 (coffee beans), University of Wisconsin–Madison, Economics 101 (teaching assistant Kanit Kuevibulvanich). Qs = 2P − 8 and Qd = 16 − P, where a $10 ceiling does nothing, a $5 ceiling gives a shortage of 9, and an $11 floor gives a surplus of 9.
- ECON 101: Principles of Microeconomics, Discussion Section Week 5 (handout with solutions), University of Wisconsin–Madison, TA Kanit Kuevibulvanich (Fall 2013). A $60 cotton price floor on P = 100 − Q/100 and P = Q/100 leaves the government buying 2,000 units, for $120,000 before storage costs.
- 3.4 Price Ceilings and Price Floors, OpenStax, Principles of Economics 3e (Rice University). Table 3.7, the rent-control example, where a $500 ceiling with demand at 19,000 and supply at 15,000 gives a shortage of 4,000 apartments.
Formula and sources last checked September 30, 2026. How we test formulas.