ForHosting KIT · Math

Quartile and IQR calculator

For the numbers 1 to 9, Q1 is 2.5, the median is 5 and Q3 is 7.5, so the IQR is 5 and the outlier fences sit at −5 and 15. Paste a list to get the quartiles, IQR, fences and any outliers. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Quartiles split an ordered sample into four roughly equal parts and sit at the heart of every box plot and robust spread summary. The first quartile Q1 marks the 25th percentile region of the ordered data, the second quartile Q2 is the median, and the third quartile Q3 marks the 75th percentile region. Their difference is the interquartile range (IQR), a resistant measure of spread that ignores the extreme tails. Classic Tukey fences at Q1 minus 1.5 times IQR and Q3 plus 1.5 times IQR flag mild outliers without assuming a normal distribution. This capability takes a non-empty list of finite numbers and returns Q1, Q2, Q3, IQR, both fences, the sorted sample, min, max and the values that fall outside the fences in one deterministic call.

What Q1, Q2, Q3, IQR and outlier fences mean on a list of numbers

The lower half is the first floor of n over two observations and the upper half is the last floor of n over two observations; when n is odd the overall median itself is excluded from both halves so that Q1 and Q3 are not double-counted through the center. Q1 is the median of the lower half and Q3 is the median of the upper half. The interquartile range is simply Q3 minus Q1 and measures the width of the central fifty percent of the data.

Mild-outlier fences follow the textbook rule lower equals Q1 minus one point five times IQR and upper equals Q3 plus one point five times IQR. Any observation strictly below the lower fence or strictly above the upper fence is reported in the outliers array. Because hinges depend only on order statistics, a single extreme value can move min or max without dragging Q1, Q2 or Q3 as violently as a mean would move, which is why box plots and IQR summaries are preferred for skewed or contaminated samples.

Classic classroom walk-through: the integers one through nine have Q1 equal to two point five, Q2 equal to five, Q3 equal to seven point five, IQR equal to five, lower fence equal to negative five and upper fence equal to fifteen, so none of those nine points are outliers. Replace nine with one hundred and the same hinges flag one hundred as an upper outlier. A single-element list sets all three quartiles to that value, IQR to zero and both fences to the same value.

Always reject empty input rather than inventing quartiles from no data.

Quick robust sample summary in pipelines

Summarize sensor batches, quiz scores or experiment cells with quartiles and IQR without installing a full stats library in every service.

Outlier screening before analysis

Flag values outside Tukey 1.5×IQR fences on a plain list before deeper modeling or before loading a spreadsheet into a dashboard.

What happens if the list is empty?

There are no quartiles of nothing; failed validation is not charged.

Which quartile method is used?

Tukey exclusive hinges: Q2 is the sample median; Q1 and Q3 are medians of the lower and upper halves, excluding the overall median when n is odd.

How are outlier fences defined?

Lower fence is Q1 − 1.5×IQR and upper fence is Q3 + 1.5×IQR. Sample values strictly outside either fence appear in outliers.

Is the quartile calculator free?

The browser tool is free and runs locally.

What happens to the median when the count is odd?

It is left out of both halves, so Q1 is the median of the lower half and Q3 the median of the upper half, without counting the centre twice.

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/quartiles

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/quartiles \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"numbers":[1,2,3,4,5,6,7,8,9]}'
{
  "numbers": [
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.quartiles",
  "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.

Empty lists are rejected with invalid_input and are never charged.

What Q1, Q2, Q3, IQR and outlier fences mean on a list of numbers

After sorting the sample in ascending order, the second quartile Q2 is the median of the whole list: the middle value when the count n is odd, or the average of the two central values when n is even. This calculator uses Tukey exclusive hinges for the outer quartiles.

How to call the API and what comes back

Numeric strings inside the array are coerced; a comma or whitespace separated string is also accepted for simple text forms. Use it from homework checkers, spreadsheet enrichment, sensor sample summaries, quality-control dashboards that need a quick robust center and spread, or any workflow that wants quartiles and IQR without installing a statistics package on every machine. Send a JSON body with one required field named numbers: a non-empty array of finite numbers. Aliases values, data and list are accepted and behave the same. On success the response includes count as n, numbers as the ascending sorted copy used for the hinges, min and max of the sample, q1, q2 and q3, median as an alias of q2, iqr equal to q3 minus q1, lower_fence and upper_fence using the one point five multiplier, fence_k equal to one point five, method set to tukey_exclusive so clients know which hinge convention was used, outliers as the sorted list of sample values strictly outside the fences, and outlier_count as the length of that list. Failed validation—missing numbers, an empty list, non-finite entries, or a list longer than one hundred thousand values—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

When teaching, pair the one-through-nine walk-through with an even-length list such as one two three four five six to show averaged hinges, and inject a clear outlier such as one hundred to demonstrate fences that catch the extreme without changing Q1 and Q3 as much as a mean would. Prefer IQR and fences over range when the sample may contain transcription errors or rare spikes; prefer the sibling mean median mode calculator when you need average and mode rather than quartile fences. This page targets people searching for a quartile calculator, IQR calculator or interquartile range and outlier fences on a plain list of numbers, not a multi-column exploratory profile of a whole CSV file. Keep lists within the published size cap so interactive Worker and browser paths stay fast; one hundred thousand finite numbers is ample for classroom sets and most operational samples. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap while students type empty arrays by mistake. Prefer sending the raw list once and reading Q1, Q2, Q3, IQR and both fences from one response instead of stitching several tools: one contract, one charge unit, identical results in browser and API.

Homework and exam answer keys

Give students a short numeric sample; check their hand-computed Q1, Q2, Q3, IQR and fences against a deterministic browser or API result.

What does this quartile and IQR calculator return?

For a non-empty list it returns count, sorted numbers, min, max, q1, q2, q3 (and median alias of q2), iqr, lower_fence, upper_fence, fence_k, method, outliers and outlier_count.

Read the full KIT documentation →