This free supply and demand calculator finds the equilibrium price and quantity, shows the shortage or surplus from a price ceiling or floor, works out consumer and producer surplus, and calculates price elasticity of demand.
How to use the supply and demand calculator
- Write demand as Qd = a − bP and supply as Qs = c + dP, then enter a, b, c and d.
- Read the equilibrium price and quantity, and the shaded consumer surplus on the graph.
- Add a price ceiling or floor to see whether it binds and how big the shortage or surplus is.
- Use the shift buttons to move demand or supply and watch the equilibrium change.
- Switch to Elasticity to compare two price–quantity points with the midpoint method.
Worked example
Demand is Qd = 100 − 2P and supply is Qs = 10 + P.
- Set them equal: 100 − 2P = 10 + P, so 3P = 90 and P* = 30.
- Plug back in: Qd = 100 − 60 = Q* = 40.
- Consumer surplus is the triangle under demand and above P*: ½ × 40 × (50 − 30) = 400.
- A price ceiling of 20 is below P*, so it binds: buyers want 60, sellers offer 30, a shortage of 30.
Equilibrium
A market is in equilibrium when the quantity buyers want equals the quantity sellers want to sell. Above P*, sellers offer more than buyers want (a surplus), and price tends to fall. Below P*, buyers want more than is offered (a shortage), and price tends to rise. That’s why the market settles where the curves cross.
Shifts vs. movements along a curve
| What changes | Effect | New P* | New Q* |
|---|---|---|---|
| Demand increases (income, tastes, price of a substitute rises) | Demand shifts right | Up | Up |
| Demand decreases | Demand shifts left | Down | Down |
| Supply increases (cheaper inputs, better technology) | Supply shifts right | Down | Up |
| Supply decreases | Supply shifts left | Up | Down |
A change in the good’s own price never shifts its curve. It’s a movement along the curve. On the AP Micro exam, this distinction comes up constantly.
Price ceilings and floors
A price ceiling is a legal maximum, like rent control. It only matters if it’s set below equilibrium, and then it creates a shortage. A price floor is a legal minimum, like a minimum wage. It only matters above equilibrium, and then it creates a surplus. Both create deadweight loss: trades that would have helped both sides no longer happen.
Consumer and producer surplus
Consumer surplus is the difference between what buyers would have paid and what they did pay: the area under the demand curve and above the price. Producer surplus is the difference between the price and the lowest price sellers would have accepted: the area above the supply curve and below the price. Together they’re total surplus, which is largest at the competitive equilibrium.
Price elasticity of demand
Elasticity measures how strongly quantity demanded responds to price. The midpoint method divides each change by the average of the two values:
Elasticity = [(Q₂ − Q₁) ÷ ((Q₁ + Q₂)/2)] ÷ [(P₂ − P₁) ÷ ((P₁ + P₂)/2)]
| |Elasticity| | Meaning | Example |
|---|---|---|
| Greater than 1 | Elastic | A brand of cereal with many substitutes |
| Equal to 1 | Unit elastic | Total revenue stays the same when price changes |
| Less than 1 | Inelastic | Gasoline or insulin in the short run |
Elasticity tells a seller what happens to total revenue: raising price on an inelastic good raises revenue; on an elastic good it lowers revenue.
Practice problem
Demand is Qd = 80 − 4P and supply is Qs = −10 + 2P.
- Equilibrium: 80 − 4P = −10 + 2P, so 6P = 90 and P* = 15. Then Q* = 80 − 60 = 20.
- Consumer surplus: demand hits the price axis at P = 20, so CS = ½ × 20 × (20 − 15) = 50.
- Producer surplus: supply starts at P = 5, so PS = ½ × 20 × (15 − 5) = 100.
- A price floor of 18: it’s above P*, so it binds. Buyers want 80 − 72 = 8, sellers offer −10 + 36 = 26: a surplus of 18.
Enter a = 80, b = 4, c = −10 and d = 2 in the calculator to check each step.
Common mistakes
- Confusing a change in demand (a shift) with a change in quantity demanded (a movement).
- Drawing a ceiling above equilibrium and calling it a shortage.
- Using the plain percent change instead of the midpoint method for elasticity.
Review the whole unit on the AP® Microeconomics Unit 2 cheat sheet: supply and demand. Getting ready for the exam? Try the AP® Microeconomics score calculator and the AP® Microeconomics guides.
FAQ
How do you find equilibrium price?
Set quantity demanded equal to quantity supplied and solve for P. With Qd = 100 − 2P and Qs = 10 + P, 100 − 2P = 10 + P gives P* = 30 and Q* = 40.
When does a price ceiling cause a shortage?
Only when it is set below the equilibrium price. Then buyers want more than sellers offer, and the gap is the shortage. A ceiling above equilibrium has no effect.
What is the midpoint method for elasticity?
It divides each change by the average of the two values, so you get the same answer whether price rises or falls. Elasticity is %ΔQ ÷ %ΔP.
What does elastic demand mean?
The absolute value of elasticity is above 1: quantity demanded changes by a bigger percentage than price. Below 1 is inelastic, exactly 1 is unit elastic.