Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Free tool · Math and study

Interquartile range calculator

Paste your numbers to get Q1, the median, Q3 and the IQR, the 1.5 × IQR fences, any outliers, and a box plot, with the method named and the others shown.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

Separate them with commas, spaces or new lines, in any order. Decimals and negatives work. These ten numbers are an example: type your own.
Books and software calculate quartiles in slightly different ways. The table in the result shows all four.
Interquartile range (IQR)

9Q3 18 minus Q1 9. Method: median of halves, middle left out.

  • Median of halves, middle left out
  • 10 numbers
  • 1 outlier
441
Q1 (25%)
9
Median (50%)
12.5
Q3 (75%)
18
Lowest value
4
Highest value
41
Range
37
Lower fence
-4.5
Upper fence
31.5
Outliers
41
The same data by each method
MethodQ1Q3IQR
Median of halves, middle left out9189
Median of halves, middle kept9189
Interpolated, inclusive9.2517.258
Interpolated, exclusive8.518.510
The working (median of halves, middle left out)
StepWhat happens
1Sort the 10 numbers from smallest to largest: 4, 7, 9, 10, 12, 13, 15, 18, 20, 41.
2Median: 12.5.
3Lower half: 4, 7, 9, 10, 12. Its median is Q1 = 9.
4Upper half: 13, 15, 18, 20, 41. Its median is Q3 = 18.
5IQR = Q3 − Q1 = 18 − 9 = 9.
6Fences: Q1 − 1.5 × IQR = -4.5 and Q3 + 1.5 × IQR = 31.5.
7Outside the fences: 41.

Split the sorted list at the median. With an odd count, the middle value belongs to neither half. Q1 is the median of the lower half and Q3 is the median of the upper half.

How to use the Interquartile Range Calculator

  1. Type or paste your numbers into Your numbers, in any order.
  2. Pick a Quartile method. If your teacher or software names one, choose that one.
  3. Read the IQR in the big answer, then Q1, the median, Q3 and the fences in the cards.
  4. Compare The same data by each method, follow The working, and press Copy the answer to keep the result.

What is the interquartile range?

The interquartile range, or IQR, is the width of the middle half of your data. Put the numbers in order and cut them into four equal groups. The first quartile, Q1, is the cut point with a quarter of the numbers below it. The third quartile, Q3, has three quarters below it. The IQR is Q3 minus Q1.

For 4, 7, 9, 10, 12, 13, 15, 18, 20, 41, Q1 is 9 and Q3 is 18, so the IQR is 9. Half of the values lie within that span. Because the IQR ignores the lowest and highest quarters, one extreme value hardly changes it, which makes it a steady measure of spread. The standard deviation calculator gives a spread measure that does react to extreme values, and the average calculator covers the centre of the data.

Compare it with the plain range, the highest value minus the lowest. Here the range is 37, far larger than the IQR of 9, because the single value 41 stretches it. The IQR shrugs that value off. That is why it is used to describe the spread of skewed data such as incomes, waiting times or house prices.

How do I calculate the IQR step by step?

Sort the numbers. Find the median, which splits the list in two. Q1 is the median of the lower half and Q3 is the median of the upper half. Then subtract. With the default method, the lower half of the example is 4, 7, 9, 10, 12, so Q1 = 9. The upper half is 13, 15, 18, 20, 41, so Q3 = 18. IQR = 18 − 9 = 9.

When the count is odd, the middle value needs a rule. Take 1 3 5 7 9 11 13, with seven values and the median 7. If the median is left out of both halves, Q1 is 3, Q3 is 11 and the IQR is 8. If it is kept in both halves, Q1 is 4, Q3 is 10 and the IQR is 6. Both are correct under their own rule.

Why do different calculators give different quartiles?

There is no single agreed way to cut a list at 25% and 75%, so several methods are in use. Two split the list into halves and take medians. Two use a position in the list and blend the neighbours when the position falls between two values. This page uses the median-of-halves method that leaves the middle value out, the one most school books teach, unless you choose another.

The spreadsheet functions QUARTILE.INC and QUARTILE.EXC use inclusive and exclusive percentile values. This page offers an inclusive and an exclusive interpolated method in the same spirit. For the example, the inclusive one gives Q1 = 9.25, Q3 = 17.25 and IQR = 8. The exclusive one gives 8.5, 18.5 and 10. The numbers differ because the rules differ, not because something is wrong. Use the method your course or software uses.

Quartiles of two data sets by method
MethodQ1 of 10 numbersQ3IQR7 numbers (1 3 5 7 9 11 13)
Halves, middle left out91893 to 11 (IQR 8)
Halves, middle kept91894 to 10 (IQR 6)
Interpolated, inclusive9.2517.2584 to 10 (IQR 6)
Interpolated, exclusive8.518.5103 to 11 (IQR 8)

How do I find outliers with the IQR?

A common rule of thumb marks a value as an outlier if it lies more than 1.5 × IQR below Q1 or above Q3. These limits are called fences. For the example, 9 − 1.5 × 9 = -4.5, and 18 + 1.5 × 9 = 31.5. The value 41 lies above the upper fence, so it is flagged. The highest value that is not flagged is 20.

The box plot under the answer draws all of this. The box runs from Q1 to Q3 with a line at the median. The whiskers reach the lowest and highest values that are inside the fences, and each outlier is a small circle. A flagged value is only a candidate: check it before you drop it, since it may be a real measurement.

A wide IQR with no outliers means the data is simply spread out. A tiny IQR with several outliers means most values bunch together and a few sit far away. Reading the IQR together with the fences and the box plot tells you which of these you have.

Use it with

Questions

How do you calculate the interquartile range?

Sort the data, find Q1 and Q3, and subtract. For 4, 7, 9, 10, 12, 13, 15, 18, 20, 41, 18 − 9 = 9.

What does the IQR tell you?

The width of the middle 50% of the data. A small IQR means the middle values are close together, a large one means they are spread out.

How do you find outliers using the IQR?

Compute the fences Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Values outside them are outliers. In the example the fences are -4.5 and 31.5.

Why does my textbook give a different answer?

Quartile methods differ, mostly for the middle value of an odd count. For 1 3 5 7 9 11 13, the IQR is 8 with the middle left out and 6 with it kept.

Is the IQR affected by outliers?

Very little. It uses only the middle half of the data, so a few extreme values at either end do not move Q1 or Q3 much.

How many numbers do I need?

Two will run, but quartiles of a very short list are rough. The exclusive interpolated method needs at least three.

The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.