Price quantity calculator
A unit price of 12.5 times 4 units gives a line total of 50, and 2.5 metres of fabric at 10 a metre gives 25. Use it to check an invoice, quote or order line before you send it. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Price
- 12.5
- Quantity
- 4
- Total
- 50
Retail lines, invoices, and purchase orders almost always reduce to one identity: the unit price of an item times how many of that item you buy. Twelve dollars and fifty cents each times four units is fifty; nine ninety-nine times three is twenty-nine ninety-seven. This price-quantity calculator accepts those two finite non-negative numbers, multiplies them, and returns the total amount so a clerk, a spreadsheet, or an automation script can check a line without standing up a billing engine. Zero is allowed and yields a total of zero.
How unit price times quantity becomes a line total
A shop that sells a notebook at twelve dollars and fifty cents and a customer who takes four notebooks owes fifty, not a guessed round number. The same identity covers fractional quantities: two and a half metres of fabric at ten a metre is twenty-five, and a litre and a quarter of solvent at eight a litre is ten. Quantity is a non-negative finite number, not necessarily an integer, because many SKUs sell by weight, length, or time.
Price is a non-negative finite number in one currency; this calculator does not convert currencies, apply tax, or take a discount. Zero is a legitimate input: a complimentary sample with price zero, or a line with quantity zero, both yield a total of zero rather than an error. Infinity and NaN are rejected as not finite.
The product is rounded half-up to two decimal places so money compares byte-for-byte across runtimes.
Where a price-quantity calculator earns its keep
Clerks and warehouse staff use a price-quantity calculator to check a handwritten pick ticket against the posted unit price before the invoice is cut. Catalog teams drop a list price and a pack count, then pin total so a storefront teaser and a quote PDF never disagree. Product teams wire the same contract into cart previews and onboarding quizzes that must show a line total for a sample basket without calling an ERP.
Price times quantity prices one SKU against one count and returns money. Failed validation does not consume balance. Keep price and quantity non-negative and finite, pin the rounded total in tests, and you get a reproducible line amount for teasers, pick tickets, and edge workers without standing up a billing ledger of your own.
Tax, shipping, and promotional discounts stay outside this identity on purpose: fold them in your own layer after you have the raw extended price.
What you can do with it
Check a quote line before you send the PDF
Drop the unit price from the catalogue and the quantity from the order, then pin total so the quote line matches the cart before anyone signs.
Verify a warehouse pick ticket against list price
Enter the posted unit price and the count on the pick ticket, then confirm total matches the invoice line before it ships.
FAQ
How is the total calculated from unit price and quantity?
Send finite non-negative numbers price (unit price) and quantity (count, weight, length, or time).
What happens if price or quantity is negative?
A negative unit price or a negative quantity is not allowed in this contract and is not billed. Zero is valid and yields a total of zero.
Can quantity be a fraction, or must it be a whole number?
Quantity may be any finite non-negative number, including fractions such as 2.5 metres or 1.25 litres. It does not have to be an integer. A non-finite value is rejected.
Does this include tax, discounts, or currency conversion?
No. This calculator only multiplies unit price by quantity. Apply tax, coupons, shipping, and currency conversion in your own layer after you have the extended price.
Can the price or the quantity be zero?
Yes. A complimentary sample priced at zero, or a line with zero units, gives a total of zero instead of an error. Only negative values and numbers that are not finite are turned away.
Related tools
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/fin/price-quantity \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"price":12.5,"quantity":4}'const res = await fetch("https://api.kit.forhosting.com/fin/price-quantity", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"price": 12.5,
"quantity": 4
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fin/price-quantity",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"price": 12.5,
"quantity": 4
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fin/price-quantity", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"price":12.5,"quantity":4}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"price":12.5,"quantity":4}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fin/price-quantity", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"price": 12.5,
"quantity": 4
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fin.price_quantity",
"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. |
Technical notes
A negative price or quantity, or a value that is not a finite number, fails with invalid_input and is not billed.
How unit price times quantity becomes a line total
The extended price of a line is the product of a unit price and a quantity: total equals price times quantity. A negative price or a negative quantity is not a credit memo in this contract—it is invalid_input—because a credit belongs on its own document with an explicit sign convention, and silently multiplying a minus into a cart total is how worksheets go wrong. Pair the result with your own tax and discount layer if you need a grand total; this endpoint only multiplies the two numbers you send. That is the whole job of a price-quantity calculator: one line, two numbers, one total.
Input contract, response shape, and error behaviour
Zero quantity is valid and returns total of zero. On success the body echoes price and quantity, then reports total as the product rounded to two decimal places, and a formula string restating the identity total equals price times quantity. Example: twelve point five of unit price times four of quantity yields total of fifty. Keep requests small, pin the rounded total in tests, and you get a reproducible line amount for worksheets, POS plugins, and edge workers without standing up an invoicing engine of your own. POST a JSON body with two required finite numbers. price is the unit price in one currency; aliases unit_price, unit_cost, and cost map to the same field so a catalogue export can keep its column names. quantity is how many units you are buying; aliases qty, count, units, and q are accepted. Each numeric field may arrive as a JSON number or a numeric string. Missing fields, empty strings, and non-finite values such as NaN or Infinity fail with invalid_input naming the field. Pair the JSON with your own rule for tax, coupons, or multi-line invoices, because this endpoint multiplies the two numbers you send; it does not look up a SKU, convert currencies, or split a basket.
Where a price-quantity calculator earns its keep
This is a different search and a different job from a unit-price comparison, from a unit-rate calculator, and from a recipe batch cost: those tools divide price by pack size across products, divide a total by a count to get a rate, or sum many ingredients.
Integration use cases
Drive a cart teaser or POS plugin from the same numbers
Send price and quantity from a SKU record, then display total in the teaser; the free widget and the API path round the same way.
Technical questions
What does the price quantity calculator cost?
The browser tool is free. API requests use prepaid balance at $0.002 per successful call; invalid input is not billed.