Market Equilibrium Calculator

Introduction to linear market equilibrium

A competitive market reaches equilibrium when buyers want to purchase exactly the quantity sellers want to offer at the same price. This calculator solves that intersection for a downward-sloping linear demand curve and an upward-sloping linear supply curve. It then uses the geometry of those curves to estimate consumer surplus, producer surplus, total surplus and point price elasticities. An optional per-unit tax calculation shows the buyer price, seller price, quantity reduction, tax revenue, incidence shares and deadweight loss.

The calculator is designed for introductory microeconomics, policy illustrations and quick checks of linear models. Prices and quantities do not have built-in units. If price is measured in dollars per bushel and quantity in thousands of bushels per week, the result follows those units. Surplus is then measured in thousands of dollars per week. Elasticity has no unit because it compares proportional changes.

Market equilibrium is a model result rather than a prediction that every real transaction occurs at one exact price. Actual markets can include bargaining, contracts, transportation costs, product differences, inventories and imperfect information. The calculated intersection is best interpreted as the price and quantity implied by the two equations entered under the competitive, single-market assumptions described below.

How to use the supply and demand inputs

Enter demand and supply in quantity-as-a-function-of-price form:

  • Demand: Qd=adbdP
  • Supply: Qs=as+bsP

The demand intercept ad is quantity demanded at a price of zero and must be positive. The demand slope bd is entered as a non-negative magnitude; the minus sign is already part of the equation. A value of 4 means a one-unit price increase reduces quantity demanded by four units.

The supply intercept as is quantity supplied at a price of zero. It may be negative, which means the linear supply curve reaches zero output at a positive shutdown price. The supply slope bs is the increase in quantity supplied for a one-unit increase in price. Either slope may be zero, but they cannot both be zero because two fixed quantities do not determine a unique market-clearing price.

If a problem gives inverse demand, rearrange it first. For example, P=300.25Q becomes Qd=1204P. Enter 120 for the demand intercept and 4 for the demand slope. Leave the tax at zero for an ordinary equilibrium, or enter a non-negative amount for a specific tax per unit.

Keep all coefficients on a consistent time and quantity scale. Monthly demand cannot be compared directly with annual supply, and units cannot be mixed with thousands of units without conversion. A slope also depends on the price denomination: changing dollars to cents changes the numerical slope even though the underlying economic relationship is unchanged.

The market-clearing formulas for price and quantity

The model begins by setting quantity demanded equal to quantity supplied:

Formula: Q_d(P) = Q_s(P)

Qd(P)=Qs(P)

Substitution produces adbdP=as+bsP, so the equilibrium price is:

Formula: P^* = (a_d − a_s) / (b_d + b_s)

P*=adasbd+bs

Substituting this price into either curve gives:

Formula: Q^* = (a_d b_s + a_s b_d) / (b_d + b_s)

Q*=adbs+asbdbd+bs

The demand choke price and non-negative supply shutdown price help determine whether the algebraic intersection is economically meaningful:

Formula: P_choke = a_d / b_d, P_shut = max(0, − a_s / b_s)

Pchoke=adbd,Pshut=max(0,asbs)

A negative algebraic price means supply already exceeds demand at a zero price. Rather than presenting a negative price as an ordinary equilibrium, the calculator reports a zero-price outcome and the unsold excess supply. If the calculated quantity is zero or negative, it reports no trade.

Formulas for consumer, producer and total surplus

Consumer surplus is the area below inverse demand and above the market price. With linear demand it is a triangle:

Formula: CS = 1 / 2 Q^* (P_choke − P^*) = (Q^*)^2 / (2 b_d)

CS=12Q*(PchokeP*)=(Q*)22bd

If demand is perfectly inelastic, the linear curve has no finite choke price and this unrestricted surplus measure is unbounded. Producer surplus is the area above inverse supply and below the price. Using the shutdown price keeps the calculation valid when the supply intercept is either positive or negative:

Formula: PS = a_s (P^* − P_shut) + b_s / 2 ((P^*)^2 − P_shut^2)

PS=as(P*Pshut)+bs2((P*)2Pshut2)

When supply begins at a positive quantity at a price of zero, producer surplus is a trapezoid rather than the triangle often used in simplified examples. Total surplus is TS=CS+PS.

Point elasticity at the market equilibrium

Slope measures an absolute quantity response, while elasticity measures a proportional response. The calculator evaluates point elasticity at the equilibrium:

Formula: ε_d = − b_d P^* / Q^*, ε_s = b_s P^* / Q^*

εd=bdP*Q*,εs=bsP*Q*

A magnitude below one is inelastic, a magnitude above one is elastic, and a magnitude equal to one is unit elastic. Demand elasticity is normally negative because price and quantity demanded move in opposite directions. The result should not be interpreted as an arc or midpoint elasticity unless the tax comparison explicitly labels it that way.

The per-unit tax formulas and incidence

A tax creates a wedge between the price buyers pay and the price sellers retain. If the tax is t, the two prices are:

Formula: P_b = P^* + t b_s / (b_d + b_s), P_s = P^* − t b_d / (b_d + b_s)

Pb=P*+tbsbd+bs,Ps=P*tbdbd+bs

The statutory collection side does not determine the economic burden. Buyers bear the share bs/(bd+bs), while sellers bear the remaining share. The less responsive side generally bears more.

Taxed quantity, revenue and deadweight loss are:

Formula: Q_t = Q^* − t (b_d b_s) / (b_d + b_s), R = t Q_t, DWL = 1 / 2 t (Q^* − Q_t)

Qt=Q*tbdbsbd+bs,R=tQt,DWL=12t(Q*Qt)

Reading changes in the equilibrium coefficients

The four coefficients do more than locate two lines on a graph. They describe how the calculated market responds when demand or supply changes. A rise in the demand intercept can be represented by Δad>0. Holding the slopes and supply intercept constant, this is a parallel outward shift of demand. It raises both equilibrium price and equilibrium quantity in an ordinary positive-trade market.

A rise in the supply intercept is represented by Δas>0. It shifts supply outward and normally lowers price while raising quantity. These intercept shifts may stand for changes in population, income, preferences, productivity or input costs, but the equations themselves do not identify the cause.

The exact price response to the demand intercept is P*ad=1bd+bs. A larger combined slope makes quantity more responsive to price and therefore limits the price movement caused by a fixed horizontal shift.

The corresponding response to the supply intercept is P*as=1bd+bs. The minus sign captures the usual fall in equilibrium price after an outward supply shift.

Changes in slopes rotate curves rather than shifting them in parallel. The price derivative with respect to the demand slope is P*bd=adas(bd+bs)2. In a positive-price market, making demand quantity more responsive to price lowers the intersection price.

The analogous supply-slope derivative is P*bs=adas(bd+bs)2. Its interpretation depends on the chosen zero-price intercept because changing a slope rotates the line around that intercept.

Quantity rises with the demand intercept according to Q*ad=bsbd+bs. If supply is completely unresponsive to price, an outward demand shift raises price but cannot raise the fixed supplied quantity.

Quantity responds to the supply intercept according to Q*as=bdbd+bs. Perfectly inelastic demand similarly prevents an outward supply shift from changing traded quantity.

The demand-slope effect on quantity can be written as Q*bd=bs(asad)(bd+bs)2. This is generally negative when the unconstrained equilibrium price is positive.

The supply-slope effect on quantity is Q*bs=bd(adas)(bd+bs)2. This is generally positive for a positive-price market, although the meaning still depends on where the supply line is held fixed.

Units, inverse curves and internal equilibrium checks

Dimensional consistency provides a useful way to catch entry mistakes. The demand intercept has quantity units, written [ad]=Q. It must use the same quantity scale as every other quantity in the model.

The demand slope has quantity-per-price units: [bd]=QP. This is why a slope is not itself an elasticity.

The supply intercept likewise satisfies [as]=Q. A negative value is an extrapolated intercept, not a claim that firms literally produce negative units.

The supply slope has the units [bs]=QP. Its numerical value changes if either the price or quantity scale changes.

The equilibrium price preserves price units, as shown by [P*]=P, while equilibrium quantity obeys [Q*]=Q.

Consumer and producer surplus are areas on a price-quantity graph, so [CS]=PQ. The same units apply to producer surplus, total surplus, revenue and deadweight loss. If quantity is reported in thousands, every monetary area is also scaled by one thousand.

Elasticity is dimensionless: [ε]=1. This feature allows elasticities to be compared across markets that use different currencies or quantity units.

A valid unconstrained solution must reproduce demand, so Qd(P*)=Q*. It must also reproduce supply: Qs(P*)=Q*.

Equivalently, the excess-demand gap must satisfy Qd(P*)Qs(P*)=0. Small differences caused by displayed rounding are harmless because the calculator retains more precision internally.

A unique price requires bd+bs>0. If both slopes are zero, the equations describe two fixed quantities and do not produce a conventional unique clearing price.

An ordinary interior solution also requires Praw0 and Qraw>0. The calculator treats violations as boundary cases instead of presenting negative trade as economically meaningful.

With downward-sloping demand, a positive traded equilibrium lies no higher than the choke price: P*Pchoke. It should also lie at or above the non-negative shutdown boundary used here: P*Pshut.

For geometric interpretation, inverse demand is Pd(Q)=adQbd. Inverse supply is Ps(Q)=Qasbs when the corresponding slope is positive.

The area definition of consumer surplus is CS=0Q*(Pd(Q)P*)dQ. The producer-surplus area is PS=0Q*(P*Ps(Q))dQ, subject to the model’s non-negative shutdown convention.

Combining both sides gives the total-gains expression TS=0Q*(Pd(Q)Ps(Q))dQ. This describes gains from trade within the model, not a complete measure of social welfare when external effects are present.

Deriving the tax wedge, revenue and welfare result

After a specific tax, buyers and sellers face different prices connected by PbPs=t. Market clearing still requires the quantity buyers demand to equal the quantity sellers supply.

The taxed clearing condition is adbdPb=as+bsPs. Solving this condition with the wedge gives the buyer-price formula Pb=adas+bstbd+bs.

The seller price can be written directly as Ps=adasbdtbd+bs. These equations show why naming sellers as the statutory remitters does not force sellers to bear the full economic burden.

Substitution gives taxed quantity as Qt=adbs+asbdbdbstbd+bs. The reduction from the untaxed quantity is therefore ΔQ=Q*Qt=tbdbsbd+bs.

The amount of tax passed to buyers is PbP*=tbsbd+bs. The seller-side burden is P*Ps=tbdbd+bs. The two shares exhaust the tax because bsbd+bs+bdbd+bs=1.

Government revenue is the rectangular tax wedge multiplied by the quantity that continues to trade: Rt=tQt. Revenue is a transfer within this partial-equilibrium accounting, so it is included when comparing total welfare before and after tax.

Taxed consumer surplus remains a demand-side area: CSt=12Qt(PchokePb). Taxed producer surplus is based on the net seller price and can be summarized as PSt=0Qt(PsPsupply(Q))dQ.

The welfare retained after tax is Wt=CSt+PSt+Rt. The accounting definition of deadweight loss is then DWL=TSWt.

For linear curves and an interior taxed outcome, the lost gains form a triangle: DWL=12tΔQ. This formula does not value administrative costs, avoidance, evasion, externalities or the use of public revenue.

Connecting slopes, point elasticity and midpoint elasticity

Point demand elasticity starts with the derivative definition εd=dQddPPQd. For the entered linear demand curve, the derivative is constant: dQddP=bd. Elasticity nevertheless changes along the line because the price-to-quantity ratio changes.

Supply elasticity follows εs=dQsdPPQs, with the constant derivative dQsdP=bs.

At a common positive price and quantity, the relative point-elasticity magnitudes satisfy |εd|εs=bdbs. This relationship helps explain the incidence shares, although tax incidence is more safely read directly from the calculator’s buyer and seller price changes.

For a finite movement between two points, midpoint demand elasticity is εd,arc=(Q2Q1)/(Q1+Q22)(P2P1)/(P1+P22). The taxed results use this symmetric method for the displayed arc comparison.

The corresponding supply calculation is εs,arc=(Q2Q1)/(Q1+Q22)(P2P1)/(P1+P22). Seller prices, rather than buyer prices, are used for the supply-side comparison.

When bd=0, demand quantity is perfectly inelastic in this model and unrestricted consumer surplus lacks a finite choke-price boundary. When bs=0, supply quantity is fixed. These are useful benchmark cases, but they should be chosen deliberately rather than entered accidentally.

Worked example: a weekly wheat market

Suppose demand is Qd=1204P and supply is Qs=20+2P. If quantity is thousands of bushels per week and price is dollars per bushel, the equilibrium price is:

Formula: P^* = (120 − 20) / (4 + 2) ≈ 16.67

P*=120204+216.67

The equilibrium quantity is Q*=20+2×16.6753.33. Consumer surplus is about 355.56 thousand dollars per week. Because supply starts at 20 when price is zero, producer surplus is a trapezoid worth about 611.11, making total surplus approximately 966.67.

With a tax of 3 per bushel, buyers pay about 17.67, sellers keep about 14.67 and quantity falls to 49.33. Buyers bear one third of the tax and sellers bear two thirds. Revenue is about 148.00 and deadweight loss is 6.00 in the example’s price-times-quantity units. Use the example button to reproduce these values and inspect the chart.

The sensitivity table should be read as a collection of separate scenarios. Each row increases one coefficient by 10% while holding the other three coefficients constant. It is not a forecast and it does not assume that all four changes occur together. Because a percentage increase to a negative supply intercept makes that intercept more negative, interpret that row carefully.

Limitations of this linear market estimate

This is a partial-equilibrium model for one good and one period. It assumes competitive price-taking behavior, linear curves, no external costs or benefits and no feedback from related markets. It does not estimate supply or demand from observations; the coefficients must come from the user or from a separate statistical analysis. The tax is a specific amount per unit, not an ad valorem percentage.

Surplus measures efficiency under the model’s assumptions, not fairness. A larger total surplus does not show how gains are distributed, and an actual policy analysis may need to consider administration, compliance, market power, externalities and income effects. Curved demand or supply requires solving the actual functions and integrating their inverse forms rather than using these linear triangle and trapezoid formulas.

Linear curves are often local approximations. Extending them far beyond observed prices can imply implausibly large quantities, negative quantities or willingness to pay outside a sensible range. The boundary messages help avoid some misleading outputs, but they cannot determine whether the coefficients are empirically credible. Users should compare the calculated range with the data and institutional setting from which the equations came.

The tax calculation assumes full compliance and an immediate movement to a new static equilibrium. It does not model inventory adjustment, entry and exit, international trade, price controls, tax avoidance or delayed responses. Short-run and long-run slopes can differ substantially, so incidence and deadweight loss may also differ by time horizon.

Frequently asked questions about market equilibrium

Can I enter inverse demand or inverse supply directly?

No. Rearrange each equation so quantity is isolated as a function of price before entering its intercept and slope.

Why is a negative supply intercept allowed?

It can represent a positive shutdown price: the extrapolated linear curve reaches zero output only after price rises above zero.

Why are the slope fields non-negative?

Demand’s minus sign is already included. The calculator assumes ordinary downward-sloping demand and upward-sloping supply.

What happens when the curves do not support positive trade?

The result explains whether there is no trade or a zero-price glut rather than displaying an economically misleading negative price or quantity.

Are the surplus results measured in currency?

They are measured in price units multiplied by quantity units. They equal currency only after the quantity scale is interpreted correctly.

Sources for equilibrium and surplus definitions

Definitions and standard interpretations follow OpenStax, Principles of Economics 3e, including Demand, Supply, and Equilibrium, Demand, Supply, and Efficiency and Price Elasticity. The geometric surplus interpretation is also consistent with MIT OpenCourseWare’s 14.01 Principles of Microeconomics. The worked values are illustrative and are not empirical wheat-market estimates.

Quantity demanded when price is zero. Must be greater than zero.
Enter the non-negative magnitude of the demand response. Use 0 for perfectly inelastic demand.
Quantity supplied when price is zero. A negative value represents a positive shutdown price.
The non-negative increase in supply per one-unit increase in price.
Leave the tax at zero for the untaxed market. After calculation, the slider adapts to the current market.
Enter the four curve coefficients to compute equilibrium price, quantity, surplus and elasticities.

The supply and demand chart will be drawn here after a valid calculation.

The diagram places price on the vertical axis and quantity on the horizontal axis.

Arcade mini-game: supply and demand concept sorter

Catch statements that correctly describe a linear competitive equilibrium and avoid common mistakes.

Score: 0 Timer: 30s Best: 0

Start the game, then use your pointer or arrow keys to catch correct statements.

Embed this calculator

Copy and paste the HTML below to add the Market Equilibrium Calculator: Price, Quantity, Surplus and Tax to your website.