Percentile calculator
In the list 7, 15, 36, 39, 40, 41 the 50th percentile is 37.5, halfway between 36 and 39. Paste your numbers, pick k from 0 to 100 and get the interpolated value, plus the percentile rank of any score you add. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Value
- 36
- Values
- 7, 15, 36, 39, 40, 41
- K
- 50
- N
- 6
- Percentile
- 37.5
- Index
- 2.5
- Lo index
- 2
This percentile calculator finds the k-th percentile of a finite list of numbers using linear interpolation between adjacent order statistics, the same inclusive convention used by spreadsheet PERCENTILE.INC functions and many scientific libraries. You also get the sorted series, the interpolation index, the neighboring ranks, the observed minimum and maximum, and—when you supply an optional score—the midrank percentile rank of that value among the sample. Classic checks include the six-point series seven, fifteen, thirty-six, thirty-nine, forty, forty-one, whose fiftieth percentile is thirty-seven point five, with k equals zero returning the minimum and k equals one hundred returning the maximum.
What a percentile tells you about your data
A percentile answers where a threshold sits inside an ordered sample: the twenty-fifth percentile is a lower quartile, the fiftieth is a median under this inclusive definition, and the seventy-fifth is an upper quartile. After the data are sorted ascending, the engine places an index at i equals k over one hundred times n minus one, then linearly interpolates between the floor and ceiling order statistics so that intermediate k values are not forced to snap to a single observed point.
That is the linear method used by Excel PERCENTILE.INC and by NumPy when method equals linear; it is not nearest-rank, not the exclusive PERCENTILE.EXC convention, and not a weighted or continuous distribution fit. This calculator always returns n, k, the interpolated percentile, the method label linear, the raw index, the lo and hi integer ranks, the fractional weight, the full sorted copy, min, max, a short formula string, and the published length ceiling so clients can validate before they send a batch.
When you also pass a value field, the response adds the midrank percentile rank of that score—count of observations strictly below plus half the ties, divided by n, times one hundred—together with below, equal, and above counts.
Where percentiles and ranks fit in study, science, and product work
Students meet percentiles when a textbook introduces quartiles and deciles, when a standardized test reports a score as a national percentile rank, or when they need a clean check against a calculator that only exposes one of several competing definitions. Teachers can pre-generate answer keys for modest series without trusting opaque apps that round intermediate weights differently or silently switch between inclusive and exclusive conventions.
Developers call the same contract from scripts to seed deterministic test vectors, to validate feature pipelines that bin by quantile thresholds, or to satisfy data-quality gates that flag columns whose ninetieth percentile drifts after a deploy. Analysts use k-th percentiles as robust alternatives to means when outliers dominate latency or revenue series, and they use percentile rank when they need to place a single observation on a zero-to-one-hundred scale relative to peers.
Product and operations teams watch the ninety-fifth or ninety-ninth percentile of request latency, basket size, or error counts to catch tail regressions that averages and even medians would mask. Admissions, hiring, and grading workflows often need both the cutoff value at a chosen percentile and the rank of a candidate score against a fixed cohort file. Pair it with the standard-deviation calculator when you need spread as well as position, and with CSV profiling when you need multi-column summaries rather than a single numeric series.
What you can do with it
Homework and quartile checks
Verify medians, quartiles, and custom k-th percentiles for textbook series with transparent linear interpolation steps.
Scoreboards and cutoffs
Place a candidate score on a 0–100 rank scale and read the threshold at any k for admissions, hiring, or grading cohorts.
FAQ
What does the percentile calculator cost?
It is free in your browser on this page.
How is the k-th percentile defined?
On sorted data, i = (k/100)·(n−1) and the result linearly interpolates between the floor and ceiling order statistics (inclusive / PERCENTILE.INC style).
How is percentile rank computed?
When you pass value, rank is (count of observations strictly below + half the ties) divided by n, times 100. The k-th percentile is still computed independently.
Is this the same as nearest-rank or PERCENTILE.EXC?
No. This tool uses linear interpolation on the inclusive index. Nearest-rank and exclusive methods can differ on small samples; use this page only when you want the linear inclusive definition.
Is the 50th percentile the same as the median?
Yes, under this inclusive definition the 50th percentile is the median. In the same way the 25th percentile is the lower quartile and the 75th is the upper quartile.
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/stat/percentile \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"values":[7,15,36,39,40,41],"k":50}'const res = await fetch("https://api.kit.forhosting.com/stat/percentile", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"values": [
7,
15,
36,
39,
40,
41
],
"k": 50
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/percentile",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"values": [
7,
15,
36,
39,
40,
41
],
"k": 50
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/percentile", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"values":[7,15,36,39,40,41],"k":50}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"values":[7,15,36,39,40,41],"k":50}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/percentile", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"values": [
7,
15,
36,
39,
40,
41
],
"k": 50
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.percentile",
"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.
Limits
max_n | 10000 |
max_abs | 1000000000000000 |
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
The engine rejects any k outside zero to one hundred with a clear invalid_input error so bad query strings never become silent extrapolations.
What the k-th percentile means and what the response contains
There is no Monte Carlo path presented as truth and no silent coercion of text labels into zeros: the engine either finishes the sort-and-interpolate arithmetic inside the supported length and magnitude limits or rejects the input with invalid_input. Rejected cases include a missing values field, an empty list, non-finite entries such as Infinity or NaN, non-numeric tokens, arrays longer than the published maximum, a missing k, and any k strictly below zero or strictly above one hundred.
How values and k are read and how linear interpolation stays reproducible
Each element is parsed as a finite decimal; optional leading signs and scientific notation are allowed, while empty tokens, bare letters, and non-numeric objects fail with a field index in the message so a bad cell does not become a silent zero. Computation sorts a copy of the sample ascending, builds index i, interpolates between the bracketing order statistics, and only then optionally counts how many observations fall below, equal, or above the requested score. The preferred field is values, an array of finite numbers, but aliases data, numbers, x, and series are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. A single comma-separated or whitespace-separated string of numbers is also accepted when a form posts plain text instead of JSON arrays. The required field k—aliases percentile, p, and percent—must be a finite number between zero and one hundred inclusive; the engine does not clamp out-of-range k to the nearest endpoint because that would hide caller mistakes in grade cutoffs and SLA thresholds. Optional value—aliases score, x0, rank_value, and query—triggers the midrank percentile-rank block without changing how the k-th percentile itself is computed. The engine enforces a hard maximum of ten thousand points and a per-value magnitude ceiling so memory and latency stay inside a predictable budget on the free browser path and on the edge Worker. Pair the free browser run on this page with the priced API when you need the identical descriptive result inside an automated pipeline without re-implementing linear percentile interpolation yourself.
Where percentiles and ranks fit in study, science, and product work
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result.
Integration use cases
Deterministic CI fixtures
Generate reproducible percentile and rank values for unit tests, SLA thresholds, and data-quality gates without hand tables.
Technical questions
What happens if k is below 0 or above 100?
Both cases are rejected with invalid_input. k must be between 0 and 100 inclusive; the engine does not clamp out-of-range values.