ForHosting KIT · Math

Unit rate calculator

Divide a total by a number of units and see how much belongs to one: 240 miles in 4 hours is 60 miles per hour. It works the same for cost per item, words per minute or litres per serving. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Amount
240
Quantity
4
You get
Unit rate
60

A unit rate tells you how much of one quantity belongs to a single unit of another: miles per hour, dollars per item, words per minute, or litres per serving. Students meet the idea in middle-school ratios, shoppers use it when a pack lists a total but not a per-piece figure, and operations scripts need a deterministic divide that refuses a zero count instead of returning Infinity. This unit rate calculator accepts a finite total amount and a finite non-zero unit count, divides amount by count, and returns the rate per unit together with the echoed inputs and a short formula string you can show next to the answer. Non-finite values such as NaN or Infinity are rejected the same way.

What a unit rate tells you

A unit rate answers one question: how much of something belongs to a single unit of something else. Miles per hour, cost per item, words per minute and litres per serving are all unit rates. You start with a total and a count, divide the first by the second, and the result is the share of one unit. If a trip covers 240 miles in 4 hours, the unit rate is 60 miles per hour. The calculator shows the formula next to the answer, so you can see how the figure was reached and copy the method into homework or notes.

When to use it and what to watch for

Students meet unit rates in school lessons on ratios, and shoppers use them when a pack shows a total but no figure per piece. Order matters: the total goes on top and the count underneath. A count of zero has no answer, so the calculator refuses it instead of showing a meaningless result. Negative values are accepted and keep their sign, which suits a refund per item or an inventory correction. This tool divides one total by one count; it does not compare several packages against each other, and it does not measure how fast a chemical reaction runs.

Classroom ratio and rate checks

Let students submit a total distance, cost, or word count plus the matching hours, items, or minutes and verify the unit rate against textbook methods.

Exam and LMS auto-grading

Mark unit-rate items with a deterministic oracle that rejects a zero count as undefined and never invents Infinity as a passing answer.

Line items from a bulk total

Turn a pack total and a pack size into a stored per-unit figure in invoicing or inventory scripts without a spreadsheet library.

How do I calculate a unit rate from a total and a count?

Send finite numbers amount (the total) and count (the unit count, non-zero).

What happens if the unit count is zero?

Dividing by zero is undefined, so a zero count is rejected and is not billed.

Is this the same as a unit price comparison?

No. This calculator divides one total by one count. A unit-price comparison ranks several products by price per size and picks a best value; that is a different search and a different tool.

Can amount or count be negative?

Yes. Signs are preserved, so a refund per item or a signed adjustment still yields a well-defined unit rate. Only a zero count, missing fields, and non-finite values are rejected.

What is the difference between a ratio and a unit rate?

A unit rate is a ratio reduced so that the second quantity equals one. Instead of saying 240 miles in 4 hours, you say 60 miles in each single hour.

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.

POSThttps://api.kit.forhosting.com/math/unit-rate

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.

curl -X POST https://api.kit.forhosting.com/math/unit-rate \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":240,"count":4}'
{
  "amount": 240,
  "count": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.unit_rate",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_abs1000000000000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

When the unit count is zero the quotient is undefined, so the task fails with invalid_input rather than a hollow success. A successful API call costs $0.002; invalid input is not billed.

What a unit rate is and how amount divided by count produces it

A unit rate is a ratio reduced so the second quantity equals one: if a trip covers two hundred forty miles in four hours, the unit rate is sixty miles per hour; if a carton costs twelve dollars and fifty cents for five identical jars, the unit rate is two dollars and fifty cents per jar. The arithmetic is always the same: divide the total amount by the unit count. Negative amounts and negative counts are allowed and keep their signs, because a refund per item or a signed inventory adjustment is still a well-defined unit rate. Search traffic for a unit rate calculator is looking for this elementary divide, not a shopping comparison of many packages and not a chemical reaction rate, which is why this landing has its own type and its own slug. That single quotient is what middle-school ratio units, rate tables, and dimensional-analysis courses ask students to find, and it is also what a script needs when a payload arrives as a bulk total plus a count instead of a ready-made per-unit figure. This calculator does not compare several products against each other, convert currencies, or invent a label such as miles per hour: those jobs belong to a unit-price comparison tool, a currency converter, or your own display layer. It only computes amount divided by count for finite numbers and returns that rate with the echoed inputs and a formula string.

Input contract, response shape, and when the unit rate is undefined

Canonical names are amount and count. If count is exactly zero, including a minus-zero that coerces to zero, the task fails with a message that the unit count is zero, because the unit rate would be undefined. Validation failures are not billed. The capability does not convert units, apply tax, or rank multiple products: keep amount and count in one consistent pair of dimensions before you call. Send a JSON body with two required finite numbers: amount, the total quantity you want to spread across units, and count, the number of those units. Each field may be a JSON number or a numeric string in ordinary decimal or scientific notation; missing fields, empty strings, not-a-number values, and infinities fail with invalid_input and name the offending field. Absolute magnitudes above one quadrillion are rejected so the quotient stays finite in IEEE double precision on the Worker and in the browser. On success the body echoes amount and count, reports unit_rate as the quotient rounded to twelve decimal places, and includes a formula string restating unit_rate equals amount divided by count. Example: amount two hundred forty and count four yields unit_rate sixty. Example: amount twelve point five and count five yields unit_rate two point five. A successful API request is charged the published $0.002 base price with unit item.

Where a unit rate API earns its keep, and what this page is not

Classrooms and tutoring platforms use a unit rate calculator so learners can check miles per hour, cost per item, words per minute, or servings per tray without flipping a division error by hand. Exam-prep generators need a deterministic oracle that marks a zero count as invalid instead of silently returning Infinity that a buggy grader might treat as success. Failed validation does not consume balance. Operations and finance notebooks often receive a bulk total plus a pack size and need the per-unit figure before they store a line item; calling a tiny parse endpoint avoids pulling a spreadsheet library for a two-number divide. Keep requests small, pin the rounded unit_rate in tests, and you get reproducible rates for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own. Prefer this endpoint when you already have one total and one count; if you need to rank several shelf prices, use a comparison tool instead.

What does the unit rate calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →