In a competitive market, the price settles where the quantity demanded equals the quantity supplied. Buyers who would have paid more gain a consumer surplus, and sellers who would have accepted less gain a producer surplus. This calculator takes a linear demand curve and a linear supply curve, finds the equilibrium, and measures both surpluses. If you add a tax per unit, it also gives the new prices, the tax revenue and the deadweight loss.
How the calculation works
- Demand: price = a − b × quantity; supply: price = c + d × quantity
- Equilibrium quantity = (a − c) ÷ (b + d), and price = a − b × quantity
- Consumer surplus = ½ × (a − price) × quantity
- Producer surplus = ½ × (price − c) × quantity
- With a tax t: quantity = (a − c − t) ÷ (b + d), and deadweight loss = ½ × t × (change in quantity)
Example
Demand is P = 100 − 2Q and supply is P = 10 + Q. The equilibrium quantity is 30 and the price is $40. The consumer surplus is $900, the producer surplus is $450, and the total surplus is $1,350. A tax of $6 per unit cuts the quantity to 28. Buyers pay $44 and sellers keep $38. The tax raises $168 and causes a deadweight loss of $6.
Where it is used
Microeconomics courses use these triangles to teach the gains from trade, and policy analysts use the same logic to judge taxes, subsidies, price ceilings and tariffs. The size of the deadweight loss grows with the square of the tax, so doubling a tax multiplies the loss by four, which is an argument for broad taxes with low rates.
Good to know
Real demand and supply curves are rarely straight lines, so treat the numbers as an approximation near the equilibrium. The surplus is measured in money and ignores who gets it, so it says nothing about fairness. The model assumes a competitive market, no externalities and no other taxes. The tax is shared between buyers and sellers, whichever side the law names.
Related tools
For how sensitive demand is to price, use the price elasticity calculator, and for how spending ripples through the economy, the spending multiplier calculator. The break-even calculator covers a single firm.