calculator.onl
Categories50

Quartiles and IQR calculator

With the values 1 through 8 and a final value of 13, the upper fence is 13. Change the last value to 14 and it becomes an outlier. The upper whisker moves back to 8 while the quartiles stay at 3 and 7.

A worked example

Interquartile range IQR 11.5 · Upper fence 38.5 · Outliers 1
Separate values with semicolons, spaces or line breaks. Use a dot for decimals; replace decimal commas before pasting. Scientific notation such as 1e3 is accepted.

Default: R type 7 with linear interpolation. The alternative takes the median of each half, excluding the central observation when the count is odd.

Updates as you type

Enter 2–1000 finite numbers separated by semicolons or whitespace. Use decimal dots, not commas. Choose a supported method; all calculated values must remain finite.

YOUR RESULT

Interquartile range IQR

11.5

Calculated from your inputs

First quartile Q19.75
Median15.5
Third quartile Q321.25
Lower fence-7.5
Upper fence38.5
The numbers, at a glance

Calculations run in your browser.
UNDERSTAND THE RESULT

A little context. A clearer answer.

↑ Back to calculator

When this calculator is useful

Paste your observations and select a quartile method. Review Q1, median, Q3, IQR, fences, actual whiskers and flagged observations. All processing stays in your browser. For a related calculation, try Variance, Standard Deviation & MAD Calculator.

What to enter

InputWhat it meansExample value
ObservationsSeparate values with semicolons, spaces or line breaks. Use a dot for decimals; replace decimal commas before pasting. Scientific notation such as 1e3 is accepted.1;2;3;4;5;6;7;8;13
Quartile methodDefault: R type 7 with linear interpolation. The alternative takes the median of each half, excluding the central observation when the count is odd.R type 7 · linear interpolation

How the calculation works

  1. Sort the observations. Type 7 uses h = (n − 1)p and interpolates between adjacent values, counting positions from zero.
  2. Calculate Q1 at p = 0.25, the median at 0.5 and Q3 at 0.75; IQR = Q3 − Q1.
  3. Fences are Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Flag only observations strictly outside them.
The formulaIQR = Q3 − Q1; L = Q1 − 1.5 × IQR; U = Q3 + 1.5 × IQR

A worked example

Interquartile range IQR · 7 − 3 = 4 · 7 + 1.5 × 4 = 13 · 14 > 13

Example you can load

What to enter
Result for this example · Interquartile range IQR4
Result for this example · Upper fence13

This is a fixed example; changing the form above does not change these numbers.

Assumptions & limits

For 2–1000 unweighted observations, not grouped or frequency data. Quartile definitions can give different answers, especially for small samples. Duplicates and negative values are valid. Zero IQR collapses the fences; flags are descriptive and do not justify deleting data.

Frequently asked questions

Why do quartile methods disagree?

There is more than one accepted definition. Type 7 interpolates; the halves method uses two medians. Always report the chosen method.

Are flagged observations mistakes?

Not necessarily. A flag calls for context, not automatic removal. A value equal to a fence is not flagged.

Are the whiskers the fences?

No. Whiskers end at actual observations inside the fences. When IQR is zero, observations differing from the common quartile can be flagged.