ForHosting KIT · Math

Data range calculator

For 12, 7, 19, 4 and 15 the range is 15: the largest value, 19, minus the smallest, 4. You also see how many values were read, which makes it quick to compare a batch of measurements with its allowed tolerance. 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
Numbers
12, 7, 19, 4, 15
You get
Quantity
5
Minimum
4
Maximum
19
Range
15

The data range calculator measures the full spread between the smallest and largest values in a numeric dataset. Supply a non-empty array of numbers and receive the count, minimum, maximum, and range, where range is calculated as maximum minus minimum. The operation is deterministic, keeps negative values and decimals intact, and rejects empty arrays or values that are not finite numbers. Use it for a quick descriptive statistic, a validation rule, or a small building block in a repeatable data-processing workflow.

What the range tells you about a dataset

Range is one of the simplest measures of statistical spread. It answers a direct question: how far apart are the smallest and largest observations? The calculator inspects every supplied number, identifies the minimum and maximum, and subtracts the former from the latter.

For the values 4, 7, 12, 15, and 19, the minimum is 4, the maximum is 19, and the range is 15. A single-value dataset has a range of zero because its minimum and maximum are identical. Negative numbers need no special treatment: if the minimum is -8 and the maximum is 3, the range is 11.

The result is always non-negative for valid finite input. Pair it with measures such as median, quartiles, or standard deviation when the internal distribution matters.

Use the result in analysis and automation

A data range works well as a compact screening metric. A quality-control process can compare the range of repeated measurements with an allowed tolerance and flag a batch whose spread is too wide. An application monitoring response times can track the daily difference between its fastest and slowest observations.

Remember that range is highly sensitive to outliers: a single erroneous sensor reading can dominate the statistic even when every other value is stable. If that sensitivity is undesirable, inspect the source values and consider a quartile-based measure alongside the range. The calculator performs one deterministic pass over the array and uses no network services, randomness, or clock-dependent behavior.

Check measurement spread

Compare the distance between the lowest and highest readings with a permitted quality-control tolerance.

Validate imported data

Reject empty or contaminated numeric arrays before their spread is used by a downstream workflow.

How is the data range calculated?

The smallest value is subtracted from the largest value: range = maximum - minimum.

What happens when the array is empty?

The capability returns an invalid-input error because a minimum and maximum cannot be defined for an empty dataset.

Can I find the range of negative numbers?

Yes. Negative values and decimals are used as they are: if the smallest value is −8 and the largest is 3, the range is 11. For any valid list the range is never negative.

What is the range of a single value?

Zero. With only one value, the minimum and the maximum are the same number, so their difference is 0. The count in the result confirms that just one observation was read.

Why can one outlier distort the range?

Because the range looks only at the two extreme values. A single wrong sensor reading can stretch it even when every other value is stable, so check the source data and look at quartiles as well.

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/stat/data-range

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/stat/data-range \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"numbers":[12,7,19,4,15]}'
{
  "numbers": [
    12,
    7,
    19,
    4,
    15
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.data_range",
  "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.

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.

What the range tells you about a dataset

This statistic is useful for a fast sense of scale, but it describes only the two endpoints. It does not reveal how values are distributed between them, whether most observations cluster tightly, or whether one extreme observation stretches the result.

Prepare and validate the numeric array

Integers, decimals, zero, and negative values are accepted, and their original order does not affect the answer. Convert imported spreadsheet cells or form fields before submitting them so that accidental labels, blank strings, null values, and malformed measurements cannot silently influence the calculation. When validation succeeds, the response includes count, minimum, maximum, and range, making the calculation easy to audit. Send the observations in the numbers field as a JSON array containing at least one finite number. The capability deliberately treats numeric-looking strings as invalid: the JSON value "12" is text, while 12 is a number. Infinite values and NaN are also rejected because they cannot produce a finite, portable JSON result. The minimum and maximum show exactly which endpoints produced the difference, while count confirms how many observations were inspected. If the array is empty or any member is non-numeric, the request returns an invalid-input error instead of a partial statistic. This strict behavior is especially valuable in automated pipelines, where an apparently plausible result could otherwise conceal dirty source data.

Use the result in analysis and automation

Teachers and students can verify introductory statistics exercises while still seeing the endpoints behind the answer. In an API workflow, store the returned minimum, maximum, range, and count beside the source batch so later reviewers can reproduce the conclusion. The browser version is suitable for interactive checks, while API requests cost $0.002 each and support the same input and calculation rules for repeatable integrations.

Summarize a score set

Report the observed span of assessment, survey, or competition scores together with their endpoints.

Can the array contain negative numbers or decimals?

Yes. Any finite JSON number is accepted, including negative values, zero, integers, and decimals.

Are numeric strings accepted?

No. Values such as "12" are text and are rejected; submit 12 as a JSON number instead.

What does an API request cost?

Each API request costs $0.002. The same deterministic calculation can also run in the browser.

Read the full KIT documentation →