Skip to content
PercentPoint

Quartile and IQR Calculator

Paste a list of numbers to get the first quartile, median and third quartile, the interquartile range (IQR), the 1.5 × IQR outlier fences and any potential outliers, with the full five-number summary and a box plot drawn to scale.

For planning only. Your school, syllabus or accountant has the final word. First published · Last reviewed by PercentPoint.

How to use the quartile calculator

  1. Enter the data. Type or paste the values, separated by commas, spaces or line breaks. The order doesn’t matter; the calculator sorts them. You need at least two values.
  2. Read the IQR. The large figure is the interquartile range, Q3 − Q1, the spread of the middle half of the data.
  3. Check the summary and the box plot. The cards list Q1, the median, Q3, the minimum and maximum, the outlier fences and any values outside them. The box plot under the inputs shows the same numbers as a picture.

The calculator opens on the daytime statistics class from OpenStax’s Introductory Statistics 2e (Example 2.14): 20 test scores with a five-number summary of 32, 56, 74.5, 82.5 and 99, and an IQR of 26.5.

What quartiles are

Quartiles split ordered data into four parts with about the same number of values in each. The textbook defines them in terms of the median:

  • Q1, the first quartile, is the median of the lower half of the data. About a quarter of the values fall below it. It is the same as the 25th percentile.
  • Q2 is the median itself, the 50th percentile.
  • Q3, the third quartile, is the median of the upper half. About three quarters of the values fall below it.

When the number of values is odd, the median belongs to neither half. The textbook’s 13 home prices (Example 2.13) have a median of $488,800, the seventh value. Q1 is the median of the six values below it, (230,500 + 387,000) ÷ 2 = $308,750, and Q3 is the median of the six above it, (639,000 + 659,000) ÷ 2 = $649,000.

Because the quartiles depend only on the order of the values, they are not pulled around by a single extreme value the way the mean is. The home prices include one at $5,500,000; it changes the mean a lot but leaves Q1 and Q3 untouched.

The IQR and the 1.5 × IQR rule for outliers

The interquartile range is the distance between the quartiles:

IQR = Q3 − Q1

It measures how spread out the middle 50% of the data is. The textbook then uses it to flag unusual values. A value is a potential outlier if it is more than 1.5 × IQR below Q1 or more than 1.5 × IQR above Q3:

lower fence = Q1 − 1.5 × IQR,   upper fence = Q3 + 1.5 × IQR

For the home prices, IQR = 649,000 − 308,750 = 340,250, and 1.5 × IQR = 510,375. The fences are −201,625 and 1,159,375. No price is below the lower fence, but $5,500,000 is far above the upper one, so it is a potential outlier. The $1,095,000 home, high as it is, is inside the fence.

The word “potential” matters. The textbook notes that outliers call for investigation: they may be data-entry errors, a different kind of case, or the most interesting values in the set. The rule finds them; it doesn’t say to delete them.

Comparing two groups

Example 2.14 compares a day class and a night class taking the same statistics test. Try both with the example buttons:

MeasureDay classNight class
Minimum3225.5
Q15678
Median74.581
Q382.589
Maximum9998
IQR26.511

The day class has the larger IQR, so its middle scores are more spread out. Its fences, 16.25 and 122.25, contain every score, so it has no outliers. The night class is tighter in the middle; its lower fence is 78 − 1.5 × 11 = 61.5, which makes the scores of 45 and 25.5 potential outliers. Its median is also higher. Side-by-side box plots make both differences visible at a glance.

Reading the box plot

A box plot, or box-and-whisker plot, draws the five-number summary on a number line (section 2.4). The box runs from Q1 to Q3, so its length is the IQR, and a line inside it marks the median. The whiskers extend to the smallest and largest values that are not outliers, and any potential outliers are drawn as separate open circles.

The textbook’s 40 student heights (Example 2.23) have Q1 = 64.5, a median of 66 and Q3 = 70 inches, with a minimum of 59 and a maximum of 77. The four quarters span 5.5, 1.5, 4 and 7 inches. Each holds about a quarter of the students, so a short section means the values there are packed closely, and a long one means they are spread out.

A median closer to Q1 than to Q3, or a longer upper whisker, suggests the data are skewed to the right: a tail of larger values.

Why spreadsheets can disagree

There is more than one accepted way to compute quartiles. This calculator uses the median-of-halves method from the textbook. Excel’s QUARTILE.INC and QUARTILE.EXC, and many graphing calculators, interpolate between values, so for small data sets their Q1 and Q3 can differ slightly from the figures here. For the day class, QUARTILE.INC gives Q1 = 56 and Q3 = 81.75 instead of 82.5. Differences shrink as the data set grows.

When your course or report specifies a method, use that one, and state it alongside your results. For a percentile other than the 25th or 75th, the percentile calculator offers the textbook and both Excel methods side by side.

Step by step with an even count

The day class has 20 scores. Sorted, the lower half is 32, 32, 45, 55.5, 56, 56, 59, 68, 70, 72 and the upper half is 77, 78, 79, 80, 81, 84, 84.5, 90, 90, 99.

  1. Median: with 20 values it sits between the 10th and 11th, so it is (72 + 77) ÷ 2 = 74.5. With an even count, each half gets exactly 10 values.
  2. Q1: the median of the lower 10, the average of its 5th and 6th values, (56 + 56) ÷ 2 = 56.
  3. Q3: the median of the upper 10, (81 + 84) ÷ 2 = 82.5.
  4. IQR and fences: 82.5 − 56 = 26.5; 1.5 × 26.5 = 39.75; fences 16.25 and 122.25.

Every score lies between the fences, so the whiskers run all the way to the minimum, 32, and the maximum, 99.

IQR or standard deviation?

Both measure spread. The standard deviation uses every value and pairs naturally with the mean, so it suits roughly symmetric data without extreme values. The IQR uses only the middle half and pairs with the median, so it is the better fit for skewed data such as home prices, incomes or response times, where a few very large values would inflate the standard deviation. Reporting the median and IQR together is common practice for that kind of data. The standard deviation calculator covers the other side.

Sources & assumptions

How this calculator gets its numbers. Full method: our methodology.

  • Q1 and Q3 are the medians of the lower and upper halves; when the count is odd, the overall median is left out of both halves.
  • IQR = Q3 − Q1; values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are flagged as potential outliers.
  • Box-plot whiskers reach the most extreme values inside the fences; outliers are drawn as open circles.

Sources

  1. OpenStax (Rice University), Introductory Statistics 2e, 2.3 Measures of the Location of the Data. Quartiles, IQR and the 1.5 × IQR rule (Example 2.13: home prices; Example 2.14: day and night classes); kth percentile index (k/100)(n + 1) (Example 2.16: 70th → 64, 83rd → 71.5); percentile rank (x + 0.5y)/n × 100 (Example 2.18: 58 → 64th).
  2. OpenStax (Rice University), Introductory Statistics 2e, 2.4 Box Plots. Building a box plot from the five-number summary; Example 2.23 (40 heights: Q1 64.5, median 66, Q3 70).

Last reviewed . Excel’s QUARTILE.INC and QUARTILE.EXC interpolate and can give slightly different quartiles.

Frequently asked questions

How do I find Q1 and Q3?

Sort the data and find the median. Q1 is the median of the values below it, and Q3 is the median of the values above it. With an odd count, leave the median out of both halves.

What is the interquartile range?

IQR = Q3 − Q1, the range of the middle half of the data. It is less affected by extreme values than the full range.

How do I find outliers with the IQR?

Compute Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Values outside those fences are potential outliers worth checking.

What is the five-number summary?

The minimum, Q1, median, Q3 and maximum. Together they describe the center, the spread and the extremes, and they are what a box plot draws.

Is Q1 the same as the 25th percentile?

Yes in meaning, though different calculation methods can give slightly different numbers for small data sets.

Why does my calculator give a different Q3?

Some tools interpolate between values instead of taking the median of each half. Both are accepted conventions; for the day class, Excel’s QUARTILE.INC gives 81.75 where this method gives 82.5.