Skip to content
Omnikalc

Who gains from trade in your market?

Enter a linear demand curve, a linear supply curve and an optional tax: get the equilibrium, the consumer and producer surplus, the tax revenue and the deadweight loss.

Updated on
Your inputs
$

Value out of range

Value out of range

$

Value out of range

Value out of range

$

Value out of range

Results

Consumer surplus

$900

Producer surplus

$450

Deadweight loss

$6

The tax creates a deadweight loss: trades that no longer happen
Equilibrium price
$40.00
Equilibrium quantity
30.00
Total surplus
$1,350
Quantity traded with the tax
28.00
Price paid by buyers with the tax
$44.00
Price received by sellers with the tax
$38.00
Tax revenue
$168

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.

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.

Frequently asked questions

What is consumer surplus?

The gap between what buyers would be willing to pay and what they actually pay, added up over all units. On a chart, it is the triangle between the demand curve and the market price.

What is producer surplus?

The gap between the price sellers receive and the minimum price at which they would sell, added up over all units. It is the triangle between the price and the supply curve.

What is deadweight loss?

The value of trades that would have benefited both sides but do not happen because of a tax, a price control or another distortion. It is a loss for society as a whole.

Who pays a tax on sellers?

Both sides share the burden, whichever side the law taxes. The side with the less responsive, steeper curve pays the larger share.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.