Interquartile Range Calculator

Interquartile range (IQR)—
First quartile (Q1)—
Third quartile (Q3)—
Median (Q2)—

How Interquartile Range Calculator is calculated: IQR = Q3 − Q1, where Q1 and Q3 are the medians of the lower and upper halves (Tukey hinges)

What the interquartile range tells you about your data

The interquartile range, or IQR, is the distance between the first and third quartiles of a data set — the spread of the middle 50% of your numbers. The average tells you where the centre sits, but it says nothing about how spread out the values are. Two classes can both average 70 marks, yet one has every student between 65 and 75 while the other ranges from 30 to 100. The IQR exposes that difference in a single number.

For the default list on this page, 1, 2, 3, 4, 5, 6, 7, 8 and 9, the first quartile is 2.5 and the third quartile is 7.5, so the IQR is 5. That means the middle half of the numbers spans five units, from 2.5 to 7.5. A small IQR means the middle of your data is tightly packed; a large one means the middle values are spread widely.

This calculator takes your list of numbers and returns the first quartile, the third quartile, the IQR and the median. Paste a column of data or type the numbers in; the results update live as you type. Everything runs in your browser, so your data never leaves your device.

How quartiles split a data set into four parts

Quartiles cut a sorted list into four equal chunks. The first quartile, Q1, is the value below which the lowest 25% of the data sits. The second quartile, Q2, is the median — the middle value, with half the data below it and half above it. The third quartile, Q3, is the value below which 75% of the data sits. The IQR is simply Q3 minus Q1.

Think of a class of 100 students ranked by marks. Q1 is the mark of the student ranked 25th from the bottom, Q3 is the mark of the student ranked 25th from the top, and the IQR is the gap between those two marks. The students in the middle half all scored somewhere inside that gap. The top and bottom quarters — the highest and lowest scorers — sit outside it.

Quartiles are far tougher than the average when your data has outliers. One student scoring 0 or 100 drags the mean around, but it barely moves Q1 or Q3, because quartiles depend on position, not on the size of extreme values. That is why exam boards and salary surveys quote quartiles: a median calculator gives you the centre, and quartiles show how wide the typical range is around it.

Tukey hinges: the method this calculator uses

This calculator uses the Tukey hinges method, the one taught in most school and college statistics courses. First, sort the numbers from smallest to largest and find the median. Then split the list into a lower half and an upper half. When the count is odd, the median itself is left out of both halves. Q1 is the median of the lower half and Q3 is the median of the upper half.

Take the default list, 1 to 9. The median is 5. The lower half is 1, 2, 3, 4 and its median is 2.5, so Q1 is 2.5. The upper half is 6, 7, 8, 9 and its median is 7.5, so Q3 is 7.5. The IQR is 7.5 minus 2.5, which is 5. Every step uses a plain median, so you can check the whole calculation by hand.

Other methods exist — some include the median in both halves, others interpolate between positions — and they can give slightly different answers, usually by less than one step between values. If your textbook or spreadsheet gives a Q1 of 3 instead of 2.5 for the same data, it is probably using a different quartile method, not making an error. For school and college work, Tukey hinges is the method most teachers expect.

A worked example: 1 to 9, step by step

Run the default list through the steps. The numbers are 1, 2, 3, 4, 5, 6, 7, 8, 9, already sorted, nine values in total. The median is the fifth value, 5. Split the list around it: the lower half is 1, 2, 3, 4 and the upper half is 6, 7, 8, 9.

Q1 is the median of the lower half. With four values, the median is the average of the middle two: (2 + 3) ÷ 2 = 2.5. Q3 is the median of the upper half: (7 + 8) ÷ 2 = 7.5. The IQR is 7.5 − 2.5 = 5, and the median of the whole list is 5. Those are exactly the numbers this calculator shows for the default input.

Now try a second set: 10, 20, 30, 40, 50. The median is 30. The lower half is 10, 20, whose median is 15, so Q1 is 15. The upper half is 40, 50, whose median is 45, so Q3 is 45. The IQR is 45 − 15 = 30. Notice the IQR is six times larger than in the first example — the numbers really are spread six times further apart.

Where the interquartile range does real work

Box plots are the IQR's natural home. A box plot draws a box from Q1 to Q3 with a line at the median, and whiskers reaching out to the rest of the data. Anyone who can read a box plot can compare two groups at a glance — two classes, two factories, two investment funds — without wading through tables of numbers. The IQR is the width of that box.

Outlier detection is the IQR's most practical job. The standard rule, due to Tukey himself, flags any value below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR as an outlier. For the default list, the fences sit at 2.5 − 7.5 = −5 and 7.5 + 7.5 = 15, so nothing is flagged. For a salary list where Q1 is ₹30,000, Q3 is ₹60,000 and the IQR is ₹30,000, any salary above ₹1,05,000 gets flagged for a closer look.

In exams, the IQR tells a teacher whether the middle of the class is bunched together or spread out. A class averaging 70 with an IQR of 10 has most students near the middle; the same average with an IQR of 40 means the class split into strong and struggling students. The variance measures spread too, but it is pulled around by extreme scores, while the IQR stays focused on the typical student.

IQR vs standard deviation and range

The range — largest minus smallest — is the quickest spread measure: 9 − 1 = 8 for the default list. But it only looks at two numbers, the extremes, and ignores everything in between. One wild value can double the range while barely moving the IQR. The range is a rough check; the IQR is the serious measure.

Standard deviation measures spread around the mean, using every value in the list. For the default list it is 2.58. It is the right tool when your data is roughly bell-shaped and you want a single number that uses all the information. But for skewed data — incomes, house prices, waiting times — the mean is a poor centre, and the standard deviation around it is misleading. The IQR, built on quartiles, does not care about skew.

Use the IQR when you want a robust picture of the typical spread, and use standard deviation when your data is symmetric and you want the classic measure. A standard deviation calculator shows the spread around the mean; this one shows the spread of the middle half. When they disagree sharply — a small IQR with a large standard deviation — that gap itself is telling you the data has outliers. The range calculator gives you the simplest spread of all, the gap between the smallest and largest values.

Common interquartile range mistakes

The first mistake is forgetting to sort the numbers. Quartiles are about position in a sorted list, so an unsorted list gives nonsense. The calculator sorts for you, but if you work by hand, sort first — always. A single number out of place can move Q1 or Q3 to the wrong value entirely.

The second mistake is mixing up quartile methods. Tukey hinges, the exclusive method, the inclusive method and the interpolation method can all give different Q1 and Q3 values for the same data, especially with small lists. None of them is wrong; they are different conventions. Check which one your course or your spreadsheet uses before arguing that an answer is wrong.

The third mistake is reading the IQR as the spread of all the data. It is only the middle 50%. The top and bottom quarters sit outside it, and the full range can be much wider. Saying “the data spans 5” for the default list would be wrong — the data spans 8, from 1 to 9, and the middle half spans 5.

The fourth mistake is comparing IQRs across data sets with very different scales. An IQR of 5 in marks and an IQR of 5 in rupees are not the same kind of spread, because the units differ. Compare IQRs only within one unit and one context, or divide by the median first to get a relative spread.

How to use this interquartile range calculator

Paste or type your numbers into the box, separated by commas, spaces, or one per line — a column copied from a spreadsheet works as it is. The first quartile, third quartile, IQR and median all update live as you type. Check the median first: if it looks wrong, a mistyped number is usually the cause.

Read Q1 and Q3 to see where the middle half of your data sits, and read the IQR for how wide that middle half is. If you need the outlier fences, work them out from the results: the lower fence is Q1 − 1.5 × IQR and the upper fence is Q3 + 1.5 × IQR. Any value outside those fences is worth a second look.

Everything runs in your browser. No account, no upload, no data sent anywhere — your numbers never leave your device. Use it alongside the median calculator linked above whenever a single average feels too smooth: the median says where your data sits, and the IQR says how wide the typical spread is around it.

Frequently Asked Questions

Q1 is 2.5, Q3 is 7.5 and the IQR is 5. The median is 5, so the lower half is 1, 2, 3, 4 with median 2.5, and the upper half is 6, 7, 8, 9 with median 7.5. The IQR is 7.5 minus 2.5, which is 5.

The range is the largest value minus the smallest value, using only the two extremes. The IQR is Q3 minus Q1, the spread of the middle 50% of the data. The range is easily distorted by one outlier, while the IQR ignores the extremes and describes the typical spread.

Sort the data, find the median, then split the list into lower and upper halves, leaving the median out when the count is odd. Q1 is the median of the lower half and Q3 is the median of the upper half. This is the Tukey hinges method, the one most school and college courses teach.

It means the middle 50% of your data is spread widely — the typical values are far apart. A large IQR with a small range would be unusual, but a large IQR usually goes with a wide spread overall. Compare it with the median: if the IQR is bigger than the median itself, the data is very spread out relative to its centre.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.