Quantity supplied from a linear supply function calculator
This calculator evaluates a linear supply function of the form Qs = a + bP, where a is the intercept, b is the slope, and P is the chosen price.
Run — free
It returns both the raw result and the usable quantity supplied. If the equation produces a negative quantity, the usable result is clamped to zero because a seller cannot supply fewer than zero items. The calculation is deterministic, runs without external data, and is available through the API for $0.002 per request.
Enter the linear supply function correctly
Start by identifying the three parts of the supply equation Qs = a + bP. Enter the constant term as the intercept, the coefficient on price as the slope, and the price you want to evaluate. The intercept can be negative, zero, or positive. A negative intercept is common in textbook supply functions because it implies that production begins only after price reaches a threshold. The slope must be nonnegative: it measures how much additional quantity producers are willing to offer for each one-unit rise in price. Price must also be nonnegative. Keep the units consistent. If price is measured in dollars and the slope is items per dollar, the result is measured in items. If a problem states Qs = -30 + 6P and asks for supply at P = 12, enter -30, 6, and 12 respectively. Do not enter the entire equation as text or reverse the intercept and slope; each value has a distinct economic role in the calculation.
Understand the calculation and the zero floor
The calculator first multiplies slope by price and then adds the intercept. This produces the raw quantity supplied, exactly as the linear equation specifies. It then applies a lower bound of zero to produce the practical quantity supplied. For example, Qs = -50 + 5P evaluated at P = 6 gives a raw result of -20. A negative result does not mean that firms literally place negative goods on the market. It means the selected price lies below the range in which this simplified supply relationship predicts active production. The reported usable quantity is therefore zero, while the raw result remains visible so you can inspect the equation and recognize that the floor was applied. When the raw result is zero or positive, no adjustment is made. The clamped flag makes this distinction explicit, which is useful when the result feeds a worksheet, economic model, validation rule, or automated decision rather than being read only once by a person.
Interpret results without overstating the model
A linear supply function is a compact model, not a complete description of a market. The calculated quantity is conditional on the chosen price and on the intercept and slope supplied to the tool. It does not account for taxes, input costs, capacity constraints, expectations, regulation, weather, or shifts in the number of sellers unless those effects have already been incorporated into the coefficients. Use the result to answer a point-evaluation question, compare quantities at several prices, populate a supply schedule, or check a hand calculation. When comparing scenarios, hold the equation fixed if you want to isolate movement along one supply curve. Change the intercept or slope only when modeling a shift or a different curve. The zero floor prevents an impossible negative quantity, but it does not establish the true shutdown price or prove that supply is exactly zero in observed data. For empirical work, verify that the selected price lies within the range used to estimate the linear relationship and preserve the original units with the result.
What you can do with it
Solve an economics exercise
Evaluate a stated linear supply equation at the price given in a homework, exam, or training problem.
Build a supply schedule
Run several prices through the same intercept and slope to create quantity points for a table or chart.
Validate model output
Compare a spreadsheet or application result with a transparent calculation that identifies when the zero floor applies.
FAQ
What formula does the calculator use?
It evaluates Qs = a + bP, where a is the intercept, b is the slope, and P is the selected price.
Why is a negative result changed to zero?
Negative physical supply is not meaningful. The raw equation result is retained, but the usable quantity supplied is floored at zero.
Can the intercept be negative?
Yes. A negative intercept often indicates that the linear equation predicts positive supply only above a threshold price.
Can the slope be negative?
No. This calculator models an upward-sloping or perfectly flat supply function, so the slope must be zero or positive.
What units does the result use?
The result uses the quantity unit implied by your inputs. Keep price, slope, and quantity units consistent when interpreting it.
How much does an API calculation cost?
Each API request costs $0.002. The same deterministic calculation can also run in the browser.
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/quantity-supplied-linear \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"intercept":-20,"slope":4,"price":15}'const res = await fetch("https://api.kit.forhosting.com/econ/quantity-supplied-linear", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"intercept": -20,
"slope": 4,
"price": 15
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/econ/quantity-supplied-linear",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"intercept": -20,
"slope": 4,
"price": 15
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/econ/quantity-supplied-linear", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"intercept":-20,"slope":4,"price":15}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"intercept":-20,"slope":4,"price":15}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/econ/quantity-supplied-linear", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"intercept": -20,
"slope": 4,
"price": 15
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "econ.quantity_supplied_linear",
"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. |