Home / Science / Social sciences / Economics / Supply and demandTool #738

Supply and demand calculator: equilibrium, elasticity, consumer and producer surplus, tax incidence, price ceilings and floors

Enter a demand and a supply curve (straight lines or constant elasticity) and see the market price and quantity, price elasticities, consumer and producer surplus, and what a per-unit tax, subsidy, price ceiling or price floor does: who pays, the shortage or surplus and the deadweight loss, with a chart.

Keep it one tap away for everyday use.

Bookmark Supply and demand?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Curves
  2. Equilibrium
  3. Tax or cap
  4. Surplus
Nothing is uploadedWorks offline once open

The market

Government policy

Result

Before and after

Download

Elasticity between two points

Two observed prices and quantities, for example before and after a price change. The midpoint (arc) formula gives the same answer whichever point comes first.

What it does

This calculator works through the supply and demand questions from a first economics course, and the ones policy analysts ask for real. You describe how much buyers want at each price (demand) and how much sellers offer (supply). The tool finds where they meet, the equilibrium price and quantity, and then shows:

  • the price elasticity of demand and of supply at that point, and whether each is elastic or inelastic;
  • consumer surplus (what buyers would have paid above the price) and producer surplus (what sellers get above the least they would accept);
  • what a per-unit tax, subsidy, price ceiling or price floor does to prices, quantity, each side’s surplus, the government budget and the deadweight loss;
  • the arc (midpoint) elasticity between any two observed price and quantity points.

Everything is worked out in your browser. Nothing is sent anywhere.

It works well with the uncertainty propagation calculator, the publication plot maker and the trend and anomaly analyser.

How to use it

  1. Choose the curve shape. Straight lines use demand Q = a − b·P and supply Q = c + d·P: enter the quantity at a price of 0 and how much the quantity changes for each 1 rise in price. A negative supply quantity at price 0 simply means sellers start offering only above some price. Constant elasticity uses Q = A·P^e: enter the quantity at a price of 1 and the elasticity, handy when you have elasticities from a study.
  2. Pick a policy and its amount: tax or subsidy per unit, or the legal maximum or minimum price.
  3. Read the result, the chart (price up the side, quantity along the bottom) and the before-and-after table. The dashed outline on the chart is the deadweight loss.
  4. Download the table as CSV, or the whole report as an image, PDF or Word file.

Worked example (made-up market)

Demand is Q = 100 − 2P and supply is Q = −20 + 4P. They meet at a price of $20 and a quantity of 60. Demand elasticity there is −0.667 (inelastic) and supply elasticity 1.33 (elastic). Consumer surplus is $900 and producer surplus $450, a total of $1,350.

Add a tax of $6 per unit. Buyers now pay $24, sellers keep $18, and 52 units are sold. Buyers carry 66.7 % of the tax because demand is less elastic than supply. Consumer surplus falls to $676 and producer surplus to $338; the government collects $312. The total, $1,326, is $24 less than before: that is the deadweight loss, the trades worth making that no longer happen.

A price ceiling of $16 instead leaves sellers offering 44 while buyers want 68: a shortage of 24 and a deadweight loss of $96.

Tips

  • Elasticities matter more than the exact curves for who pays a tax: the side that can less easily walk away pays more.
  • With constant-elasticity demand between −1 and 0, consumer surplus is unbounded (the curve never reaches zero), but changes in surplus and the deadweight loss are still finite and shown.
  • The ceiling result assumes the goods go to the buyers who value them most. Queues, rationing by luck and black markets make the real loss larger.

FAQ

Which side of the market pays the tax legally? It does not matter for the result. A tax on sellers and the same tax on buyers give the same prices and quantity.

Why is the arc elasticity different from the simple percentage change? The simple version depends on which point you start from. The midpoint formula divides by the average price and quantity, so it is the same in both directions.

Can I use real data? Yes. Fit or estimate the curves elsewhere, then enter the numbers here. The example is made up.

Where the numbers come from

  • Standard microeconomics formulas (Marshallian surplus, point and midpoint elasticity, tax incidence); no tables copied.
  • Written by fibub. Checked in the tests against an independent SciPy calculation (brentq for prices, numerical integration of the inverse curves for surplus and deadweight loss) and the textbook closed forms.
  • The example market is made up.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Trend and anomaly analyser #138 Paste or open a time series (yearly, monthly or any steps) and test for a trend with Mann-Kendall, the Hamed-Rao autocorrelation correction or the seasonal test, get Sen's slope with its confidence interval, a Pettitt change point and anomalies from a baseline period. Uncertainty propagation calculator #25 Type your formula and your measurements with their uncertainties, or paste repeated readings. Get the result with its uncertainty, which input matters most, and a Monte Carlo check. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. Inflation calculator #739 Turn money from one date into money of another with the price index (CPI) numbers you enter, or with a steady yearly rate. Paste a whole index series to rebase it, see inflation each period and year on year, and convert wages or sales into real values. Includes the Fisher equation for real interest rates, exact and approximate. Nash equilibrium solver #740 Type in a two-player game of up to 6 × 6 strategies and get every Nash equilibrium, pure and mixed, with each player's payoff. Best replies are marked in the payoff table, dominated strategies are removed step by step, and zero-sum games get their value and the safest mixes. Matches nashpy. Gini and Lorenz curve #742 Paste incomes (with optional weights such as household size or survey weights) or grouped income shares, and get the Gini coefficient, the Lorenz curve, quintile, top 10 % and top 1 % shares, the Palma ratio, Theil T and L, Atkinson indices and the P90/P10 ratio.