HomeArticlesEconomics & Social Systems

Supply & Demand: How a Market Finds Its Own Price

How the intersection of two curves sets a market's price and quantity, what consumer and producer surplus measure, and why price controls create deadweight loss.

mysimulator teamUpdated June 2026≈ 6 min read▶ Open the simulation

Two curves, one price

The demand curve slopes downward: as price rises, the quantity buyers are willing to purchase falls. The supply curve slopes upward: as price rises, the quantity sellers are willing to offer increases. Where the two curves cross is the market equilibrium — the price P* and quantity Q* at which the amount buyers want to buy exactly equals the amount sellers want to sell, with nothing left over and nothing unmet.

live demo · shifting curves finding a new equilibrium● LIVE

The linear model

With linear demand and supply functions, the equilibrium is just the solution of two simultaneous equations:

Q_d = a - b*P        (demand: falls as P rises)
Q_s = c + d*P        (supply: rises as P rises)

set Q_d = Q_s:   a - b*P* = c + d*P*
                 P* = (a - c) / (b + d)
                 Q* = a - b*P*

Consumer and producer surplus

Consumer surplus is the value buyers get above what they actually paid: the area between the demand curve and the horizontal line at P*, from zero up to Q*. Producer surplus is the mirror image — the area between the price line and the supply curve. For linear curves both are simple triangles, so total surplus, the standard economic measure of how much value a competitive market creates, is easy to compute directly from the diagram:

consumer surplus = 0.5 * Q* * (demand price at Q=0  -  P*)
producer surplus = 0.5 * Q* * (P*  -  supply price at Q=0)

Shifting the curves

A change in price moves you along a fixed curve. A change in anything else — income, the price of a substitute good, consumer tastes for demand; input costs, technology, the number of sellers for supply — shifts the entire curve to a new position, which moves the equilibrium point along the other curve. A rise in demand (the curve shifts right) raises both P* and Q*; a rise in supply (the curve shifts right) lowers P* but still raises Q*, since more is now offered at every price.

Price floors, price ceilings and deadweight loss

A price ceiling set below P* makes it illegal to charge the equilibrium price, so quantity demanded exceeds quantity supplied at the capped price — a shortage, which then has to be rationed by queues, waiting lists or luck instead of price. A price floor set above P* has the mirror effect: quantity supplied exceeds quantity demanded — a surplus of unsold goods or, in a labour market, unemployment. In both cases some trades that would have made both a buyer and a seller better off never happen, and the surplus that disappears entirely (captured by neither side) is the deadweight loss triangle, the standard measure of how costly it is to stop a market from clearing at its own equilibrium.

Frequently asked questions

Why does a price ceiling cause a shortage instead of just making things cheaper for everyone?

At the capped price, the quantity people want to buy is higher than the quantity sellers are willing to supply, so the market can no longer clear by price alone. The gap has to be filled some other way, such as queues, waiting lists or informal rationing, and some potential trades that would have benefited both a buyer and a seller simply never happen.

What is deadweight loss?

It is the total surplus that a market fails to create when it is prevented from reaching its own competitive equilibrium, for example by a binding price ceiling, price floor or tax. Geometrically it is the triangle of consumer and producer surplus that neither side captures because the corresponding trades never take place.

How do you tell a shift of a curve apart from a movement along it?

A change in the good's own price causes a movement along a fixed curve, tracing out different price-quantity combinations on the same curve. A change in anything else that affects buyers or sellers, such as income, input costs or the price of a related good, shifts the entire curve to a new position and produces a new equilibrium.

Try it live

Everything above runs in your browser — open Supply & Demand and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Supply & Demand simulation

What did you find?

Add reproduction steps (optional)