Supply and Demand Calculator

Linear market equilibrium price and quantity from demand and supply curves.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter the intercepts and slopes of a linear demand and supply curve. The calculator finds the equilibrium price and quantity, the choke prices, and the consumer, producer and total surplus, and draws the market.

How to use

1
Step 1
Enter the demand intercept a and slope b, for Qd = a − bP.
2
Step 2
Enter the supply intercept c and slope d, for Qs = c + dP.
3
Step 3
Press Compute, or load the textbook example.

How it works

Equilibrium is where quantity demanded equals quantity supplied, which solves to P* = (a − c) ÷ (b + d). Substitute it into either curve for Q*. The demand choke price is a ÷ b, where demand falls to zero. Consumer surplus is the triangle between the demand curve and the price; producer surplus is the triangle between the price and the supply curve.

P* = (a − c) ÷ (b + d)      Q* = a − bP*      CS = ½ × Q* × (a/b − P*)      PS = ½ × Q* × (P* − (−c/d))

Worked example

Qd = 100 − 2P and Qs = 20 + 2P

Input
a 100; b 2; c 20; d 2
Output
P* 20; Q* 60; CS 900; PS 900; total surplus 1,800
Walkthrough
100 − 2P = 20 + 2P gives 80 = 4P, so P = 20 and Q = 60. The demand choke price is 100 ÷ 2 = 50, and the supply choke price is −20 ÷ 2 = −10. CS = ½ × 60 × (50 − 20) = 900 and PS = ½ × 60 × (20 + 10) = 900.

Limitations

  • Linear curves only.
  • Slopes b and d must be positive.
  • A textbook model: no market power, taxes or other distortions unless you use the related tools.

Questions

How do I find equilibrium price and quantity?
Set quantity demanded equal to quantity supplied and solve for P, then substitute back for Q. 100 − 2P = 20 + 2P gives P = 20, Q = 60.
What are the choke prices?
The price at which quantity demanded reaches zero (a ÷ b) and the price at which quantity supplied reaches zero (−c ÷ d).
How is consumer surplus calculated?
As the triangle under the demand curve and above the price: ½ × quantity × (choke price − price).
Can supply intercept be negative?
Yes. A negative intercept means suppliers need a positive price before they supply anything.

Features

  • Equilibrium and surplus
  • Choke prices
  • Market diagram
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Supply and demand

    Khan Academy

    Equilibrium framing for the linear market tools.

    Watch on YouTube
  • Price ceilings and floors

    Khan Academy

    Binding controls, shortage, and surplus intuition.

    Watch on YouTube