Data range calculator
The data range calculator measures the full spread between the smallest and largest values in a numeric dataset.
Run — free
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. 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. Pair it with measures such as median, quartiles, or standard deviation when the internal distribution matters.
Prepare and validate the numeric array
Send the observations in the numbers field as a JSON array containing at least one finite number. Integers, decimals, zero, and negative values are accepted, and their original order does not affect the answer. The capability deliberately treats numeric-looking strings as invalid: the JSON value "12" is text, while 12 is a number. 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. Infinite values and NaN are also rejected because they cannot produce a finite, portable JSON result. When validation succeeds, the response includes count, minimum, maximum, and range, making the calculation easy to audit. 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
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. 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. 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. 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.
What you can do with it
Check measurement spread
Compare the distance between the lowest and highest readings with a permitted quality-control tolerance.
Summarize a score set
Report the observed span of assessment, survey, or competition scores together with their endpoints.
Validate imported data
Reject empty or contaminated numeric arrays before their spread is used by a downstream workflow.
FAQ
How is the data range calculated?
The smallest value is subtracted from the largest value: range = maximum - minimum.
Can the array contain negative numbers or decimals?
Yes. Any finite JSON number is accepted, including negative values, zero, integers, and decimals.
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.
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.
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/stat/data-range \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"numbers":[12,7,19,4,15]}'const res = await fetch("https://api.kit.forhosting.com/stat/data-range", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"numbers": [
12,
7,
19,
4,
15
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/data-range",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"numbers": [
12,
7,
19,
4,
15
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/data-range", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"numbers":[12,7,19,4,15]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"numbers":[12,7,19,4,15]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/data-range", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"numbers": [
12,
7,
19,
4,
15
]
}Example response
{
"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.
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. |