Consumer Surplus Change Calculator
A price change affects both what buyers pay and how many units they choose to purchase.
Run — free
This consumer surplus change calculator measures that combined welfare effect for a linear demand curve. Enter the quantity intercept, the positive slope magnitude, and the prices before and after the change. The result shows quantities and consumer surplus in both situations, then reports the signed difference as a buyer gain, a buyer loss, or no change. It is useful for policy analysis, pricing studies, coursework, and transparent economic models.
Describe the linear demand curve correctly
The calculator uses the quantity-demand form Q = a - bP. The demand_intercept value is a, the quantity buyers would demand at a price of zero. The demand_slope value is the positive magnitude b, so quantity falls by b units whenever price rises by one currency unit. Do not enter b as a negative number: the minus sign is already part of the model. The ratio a divided by b is the choke price, where quantity demanded reaches zero. Both the old and new prices must lie between zero and that choke price, inclusive, because extending the line above it would imply a negative quantity. Use consistent measurement units throughout. If quantity is measured in thousands of items, the returned surplus is in thousands of currency units; if quantity is individual items, surplus is in ordinary currency units. This explicit form makes assumptions visible and keeps comparisons reproducible.
Understand how the welfare change is calculated
Consumer surplus is the area below the demand curve and above the market price for the units buyers purchase. With a straight demand curve, that area is a triangle. Its height is the difference between the choke price and the observed price, while its base is quantity demanded at that price. The calculator therefore evaluates one half times height times quantity at the old price, repeats the same calculation at the new price, and subtracts old surplus from new surplus. A positive result is a gain to buyers, normally caused by a price decrease. A negative result is a loss, normally caused by a price increase. The calculation captures two connected effects: continuing buyers pay a different amount, and marginal buyers enter or leave the market as quantity changes. The returned old and new quantities, surplus levels, absolute change, and effect label let you audit every stage instead of relying on a single unexplained number.
Interpret the result and its limits
Treat the output as a partial-equilibrium estimate under a stable linear demand curve. The signed consumer_surplus_change field answers the main welfare question: values above zero mean buyers collectively gain, values below zero mean they lose, and zero means their measured surplus is unchanged. The absolute_change field is convenient when a report needs the magnitude separately from direction. This model assumes the demand intercept and slope do not change between the two prices, all buyers face the same price, units are divisible enough for geometric area to be meaningful, and there are no additional fees or quality changes. It does not calculate producer surplus, tax revenue, external costs, income effects, or total social welfare. For a tax, subsidy, regulation, or firm-pricing decision, combine this buyer-side estimate with the relevant effects on sellers and third parties. Also avoid presenting precision beyond the quality of the demand estimates: a clean calculation cannot repair an uncertain or poorly fitted curve.
What you can do with it
Evaluate a proposed price increase
Estimate how much buyer welfare is lost when a firm raises price and quantity demanded moves along an estimated linear curve.
Measure the benefit of a price reduction
Quantify the consumer gain from a discount, subsidy-driven price decrease, or lower market price using consistent demand assumptions.
Check an economics exercise
Verify old and new quantities, triangular surplus areas, and the signed welfare change for a linear-demand problem.
FAQ
What does the signed change mean?
Consumer surplus change equals new surplus minus old surplus. A positive value is a buyer gain, and a negative value is a buyer loss.
What form of demand curve should I enter?
Use Q = a - bP, where demand_intercept is a and demand_slope is the positive magnitude b.
Why can neither price exceed the choke price?
The linear model implies negative demand above the choke price. The calculator rejects that economically invalid extension.
What units does consumer surplus use?
It uses price units multiplied by quantity units. Currency per item with quantity in items produces currency; quantity in thousands produces thousands of currency units.
Does this calculate total welfare or deadweight loss?
No. It measures only consumer surplus at two prices and their difference, without producer surplus, government revenue, or external effects.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/econ/consumer-surplus-change-price \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"demand_intercept":100,"demand_slope":2,"old_price":20,"new_price":30}'const res = await fetch("https://api.kit.forhosting.com/econ/consumer-surplus-change-price", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"demand_intercept": 100,
"demand_slope": 2,
"old_price": 20,
"new_price": 30
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/econ/consumer-surplus-change-price",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"demand_intercept": 100,
"demand_slope": 2,
"old_price": 20,
"new_price": 30
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/econ/consumer-surplus-change-price", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"demand_intercept":100,"demand_slope":2,"old_price":20,"new_price":30}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"demand_intercept":100,"demand_slope":2,"old_price":20,"new_price":30}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/econ/consumer-surplus-change-price", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"demand_intercept": 100,
"demand_slope": 2,
"old_price": 20,
"new_price": 30
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "econ.consumer_surplus_change_price",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |