Easy CalculatorsOnline
A little less guesswork.

Statistics · EVERYDAY CLARITY

Quartiles and IQR calculator

Find percentiles and the spread of the middle half of your data.

Units & number format

Number formatting changes the display; the interface and guides are in English. Dates use calendar controls; numeric lists use decimal points and comma or space separators.

01 · CALCULATE

Work out your numbers

Your inputs stay in this browser.

Example result · using the values shown

Interquartile range
3.5
Q12.75
Median4.5
Q36.25
See visual ↓

Type 7 inclusive linear interpolation at positions (n − 1)p, used consistently for Q1 and Q3.

02 · SEE THE RESULT

Your numbers, pictured

Example visualization

Your five-number summary

01Minimum1Equivalent measurement
02Q12.75Equivalent measurement
03Median4.5Equivalent measurement
04Q36.25Equivalent measurement
05Maximum8Equivalent measurement

Quartile conventions differ. This page uses inclusive linear interpolation.

03 · UNDERSTAND THE METHOD

How the quartiles and iqr calculator works

Quartiles mark the quarter, middle, and three-quarter positions of an ordered dataset. The interquartile range, or IQR, is Q3 minus Q1 and describes the spread of the middle portion under the selected quartile convention. There is no single universal algorithm for sample quartiles. This calculator uses type 7 inclusive linear interpolation, the default sample-quantile method documented by R. Naming the method matters because another calculator using a different convention may return different quartiles for exactly the same finite dataset without either calculation containing an arithmetic error.

The formula and its variables

Sort n values. For percentile p, zero-based position h = (n − 1)p; interpolate between adjacent values around h. Q1 uses p = 0.25, median 0.5, Q3 0.75; IQR = Q3 − Q1.
n
Number of observations
p
Requested percentile expressed as a fraction
h
Position counted from zero in the sorted list
IQR
Interquartile range in the original data units

The calculation, step by step

  1. Enter and sort the numerical observations, retaining repeats. Index the sorted list starting at zero for the interpolation formula.
  2. Calculate h for each requested percentile. Take the lower-index value plus the fractional part of h times the difference to the next value.
  3. Subtract Q1 from Q3 and review the five-number summary. Use the same quartile convention when comparing other datasets or software results.

A worked example

For values 1 through 8, n is 8. Q1 has position 7 × 0.25 = 1.75, interpolating between 2 and 3 to give 2.75. The median is 4.5. Q3 has position 5.25, interpolating between 6 and 7 to give 6.25. The resulting IQR is 6.25 − 2.75 = 3.5.

Example inputs and calculated output
Numbers1,2,3,4,5,6,7,8
Interquartile range3.5

How to read the result and visual

IQR measures an internal spread rather than the distance between the minimum and maximum. It is less affected by extreme endpoints than the full range, but interpolation means a reported quartile need not be an observed value. A single-value dataset has identical quartiles and zero IQR under this method.

Assumptions, rounding, and limitations

Quartile conventions differ most visibly in small datasets. This tool does not automatically label outliers or claim that a certain number of observations must lie strictly between interpolated bounds. Data entry, ordering, and sample representativeness still matter. IQR alone does not describe the entire distribution.

Frequently asked questions

Why do another site’s quartiles differ?

It may use a different sample-quantile convention, such as medians of two halves rather than type 7 interpolation.

Must a quartile be in the original list?

No. This method can interpolate a value between two observed values.

Reference sources

How we check calculations and what verification covers