KKC Tools
All tools →

IQR Calculator: Interquartile Range, Quartiles and Outliers

Paste any dataset to instantly compute Q1, median, Q3, the interquartile range, Tukey outlier fences, and an interactive box plot with step-by-step arithmetic.

The interquartile range (IQR) equals Q3 − Q1, representing the spread of the middle 50% of your data. For the sample 1, 3, 5, 7, 9, 11, 13, 15, the lower half median Q1 is 4 and the upper half median Q3 is 12, yielding an IQR of 8. Different software algorithms (Excel, R, TI-84) can produce slight variations on small datasets; our calculator compares all four methods side by side.
Diagram Five-Number Summary & Box Plot GuideClick to collapse
1Dataset: Values sorted from lowest to highest2Method: Tukey (Median Excluded)Lower Fence (Q1 − 1.5×IQR)Min (in fence)Q1 (4)25th percentileMedian (8)50th percentileQ3 (12)75th percentileMax (in fence)Upper Fence (Q3 + 1.5×IQR)OutlierIQR = Q3 − Q1 = 8
Examples:
8 numbers parsed
Interquartile Range (IQR)
8
Q1 = 4 • Median = 8 • Q3 = 12
The middle 50% of your data spans 8 (Q1 = 4, Q3 = 12). No values fall outside the 1.5 × IQR outlier fences of [-8.00, 24.00].
Count (n)8
Mean (Average)8.00
Minimum1
Q1 (25%)4
Median (50%)8
Q3 (75%)12
Maximum15
Range14
Five-Number Summary Box Plot (with 1.5 × IQR Fences)
Q1: 4Med: 8Q3: 12Min: 1Max: 15
Step-by-Step Calculation (Tukey (Median Excluded))
  1. Sort data in ascending order: 1, 3, 5, 7, 9, 11, 13, 15
  2. Find median (Q2): For n = 8, the average of the middle two values (7 and 9) gives 8.
  3. Calculate Q1 and Q3: Using Tukey (Median Excluded), Q1 is 4 and Q3 is 12.
  4. Compute Interquartile Range (IQR): IQR = Q3 − Q1 = 12 − 4 = 8.
  5. Calculate Outlier Fences (1.5 × IQR):
    Lower Fence = Q1 − (1.5 × 8) = -8.00
    Upper Fence = Q3 + (1.5 × 8) = 24.00
  • Q1, median, Q3 & IQR
  • Outlier fences
  • Box plot
  • Compare quartile methods

100% free · No sign-up · Runs in your browser, nothing is uploaded

How to Use the IQR Calculator

This free IQR calculator is designed to accept raw data in any standard format. You can paste numbers separated by commas, spaces, tabs, or multiline spreadsheet columns.

  1. Paste your data: Enter your numbers into the input box. The parser automatically strips extraneous characters and alerts you if any invalid tokens are detected.
  2. Select your quartile calculation method: Choose between standard textbook Tukey method (TI-84 style), Excel inclusive (QUARTILE.INC / R Type 7), or Excel exclusive (QUARTILE.EXC / R Type 6).
  3. Review your summary metrics: View the five-number summary (minimum, Q1, median, Q3, maximum), sample mean, total sum, range, and IQR.
  4. Inspect fences and box plot: Check lower and upper Tukey fences to see whether your sample contains mild or extreme outliers, visualized on the horizontal box plot.
  5. Switch to Tab 2 to compare methods: Compare the exact mathematical outputs of all four quartile algorithms side by side on your specific dataset.

What the Interquartile Range Tells You

The interquartile range is the distance between the first quartile (25th percentile) and the third quartile (75th percentile). While the standard range considers only the minimum and maximum values, the IQR focuses exclusively on the central 50% of observations.

Because it ignores the lowest 25% and highest 25% of observations, the IQR is resistant to extreme values (outliers) and skewed distributions. In skewed datasets or real-world measurements with measurement noise, the IQR provides a more robust description of data dispersion than either the range or the standard deviation.

How to Find Q1, Q3 and the IQR Step by Step

To find the IQR manually using the standard Tukey method:

Worked Example: Even Sample Size (n = 8)

Consider the dataset: 1, 3, 5, 7, 9, 11, 13, 15

  • Step 1 (Sort): The numbers are already in order: [1, 3, 5, 7, 9, 11, 13, 15].
  • Step 2 (Find Median Q2): With n = 8, the median is the midpoint of the 4th and 5th values: (7 + 9) ÷ 2 = 8.0.
  • Step 3 (Lower Half & Q1): The lower half consists of [1, 3, 5, 7]. Its median is (3 + 5) ÷ 2 = 4.0. Thus, Q1 = 4.0.
  • Step 4 (Upper Half & Q3): The upper half consists of [9, 11, 13, 15]. Its median is (11 + 13) ÷ 2 = 12.0. Thus, Q3 = 12.0.
  • Step 5 (Compute IQR): IQR = Q3 − Q1 = 12.0 − 4.0 = 8.0.
Worked Example: Small Sample (n = 4)

Consider the dataset: 5, 7, 8, 9

  • Lower Half: [5, 7] → Q1 = (5 + 7) ÷ 2 = 6.0.
  • Upper Half: [8, 9] → Q3 = (8 + 9) ÷ 2 = 8.5.
  • Tukey IQR: 8.5 − 6.0 = 2.5.

Why Calculators Give Different Quartiles

A frequent source of confusion in statistics homework and data analysis is that different calculators and software packages return different values for Q1, Q3, and IQR on the same sample.

In a sample of discrete data points, percentiles rarely land exactly on an existing data index. Statistical systems resolve this using different mathematical conventions:

Comparison of four quartile calculation methods and software implementations
Method NameStandard ImplementationFormula / Rule
Tukey (Median Excluded)TI-83, TI-84, standard US high school textbooksSplits sorted list at median; excludes median when n is odd; computes medians of halves.
Tukey (Median Included)Alternative introductory algebra textbooksIncludes the median in both the lower and upper halves when n is odd.
Inclusive InterpolationMicrosoft Excel QUARTILE.INC, Google Sheets, R Type 7Continuous linear interpolation using rank position p × (n − 1) + 1.
Exclusive InterpolationMicrosoft Excel QUARTILE.EXC, R Type 6, MinitabContinuous linear interpolation using rank position p × (n + 1).

For instance, on the dataset 5, 7, 8, 9, Tukey’s method yields an IQR of 2.5, Excel’s exclusive formula yields 3.25, and Excel’s inclusive formula yields 1.75. Our calculator provides a dedicated comparison tab so you can immediately verify the exact convention expected by your teacher, professor, or client.

Finding Outliers with the 1.5 × IQR Rule

In 1977, statistician John Tukey introduced the 1.5 × IQR rule as an objective criterion for identifying candidate outliers without assuming a normal distribution.

  • Interquartile Range: IQR = Q3 − Q1
  • Lower Inner Fence: Q1 − (1.5 × IQR)
  • Upper Inner Fence: Q3 + (1.5 × IQR)
  • Lower Outer Fence: Q1 − (3.0 × IQR)
  • Upper Outer Fence: Q3 + (3.0 × IQR)

Values that fall between the inner and outer fences are classified as mild outliers. Values that lie beyond the outer fences (more than 3 times the IQR away from the quartiles) are classified as extreme outliers.

How to Read a Box Plot

A box plot (or box-and-whisker plot) provides a visual summary of your dataset’s distribution:

  • The Central Box: Spans from Q1 to Q3. The length of the box represents the IQR (the middle 50% of the sample).
  • The Median Line: A line drawn inside the box at the second quartile (50th percentile). If the line is off-center, the data exhibits skewness.
  • The Whiskers: Whiskers extend from each end of the box to the smallest and largest observations that remain within the 1.5 × IQR inner fences. They do not extend to theoretical fence values, but to actual data points.
  • Outlier Points: Any individual observations falling outside the whiskers are rendered as separate circular points.

IQR vs Range vs Standard Deviation

Each measure of spread provides distinct diagnostic value depending on data characteristics:

  • Range (Max − Min): Simplest to calculate, but sensitive to individual extreme values.
  • Interquartile Range (Q3 − Q1): Robust against extreme outliers and skewed distributions. Pair with the median when analyzing non-normal distributions (e.g., house prices, incomes).
  • Standard Deviation: Incorporates every data point and measures dispersion relative to the mean. Best suited for symmetric, roughly bell-shaped (normal) distributions.

For the standard deviation, variance and standard error of the same data, use the Standard Deviation Calculator. To compare two groups' means, use the T-Test Calculator. For ratios, see the Ratio Calculator.

Working Out the Average (Mean) as Well

While the median represents the middle observation by rank, the arithmetic average (mean) incorporates the magnitude of every observation in your sample.

Comparing the sample mean to the sample median reveals distribution symmetry:

  • Mean ≈ Median: consistent with roughly symmetric data.
  • Mean > Median: a hint of right skew (a few high values pulling the mean up).
  • Mean < Median: a hint of left skew (a few low values pulling the mean down).

This is a rough check, not a rule: check the box plot as well.

Frequently Asked Questions

What is the interquartile range (IQR)?
The interquartile range (IQR) is a measure of statistical dispersion that equals the difference between the 75th percentile (third quartile, Q3) and the 25th percentile (first quartile, Q1): IQR = Q3 − Q1. It describes the spread of the middle 50% of your data values and is resistant to extreme outliers.
How do you calculate the IQR step by step?
To calculate the IQR by hand: (1) Sort your dataset in ascending order from smallest to largest. (2) Find the median (Q2) dividing the dataset into two halves. (3) Find Q1, which is the median of the lower half. (4) Find Q3, which is the median of the upper half. (5) Subtract Q1 from Q3: IQR = Q3 − Q1.
How do you find outliers with the IQR (1.5 × IQR rule)?
Under John Tukey’s rule, calculate the inner fences: Lower Inner Fence = Q1 − 1.5 × IQR and Upper Inner Fence = Q3 + 1.5 × IQR. Any data point falling below the lower fence or above the upper fence is identified as a mild outlier. Points beyond 3.0 × IQR (outer fences) are classified as extreme outliers.
Range vs IQR: what is the difference?
The full range is simply Maximum − Minimum, which depends entirely on the two extreme values in your sample. The interquartile range (Q3 − Q1) measures only the middle 50% of observations. Adding one extreme value can change the range a lot, while the IQR moves only slightly, because the quartiles shift by at most one data position.
Why do different calculators give different quartiles?
There is no single universally mandated algorithm for fractional ranks in discrete samples. Textbook methods (Tukey) divide the observations into two distinct halves. Statistical software packages like Microsoft Excel and R use continuous linear interpolation between points. For small datasets (such as 5, 7, 8, 9), methods can yield different quartiles, but all methods converge as sample sizes increase.
Which method do Excel, Google Sheets, R and a TI-84 use?
A TI-83/TI-84 graphing calculator uses Tukey’s method with the median excluded. Microsoft Excel provides two functions: QUARTILE.INC (which uses rank p(n−1)+1, identical to R Type 7 and Google Sheets) and QUARTILE.EXC (which uses rank p(n+1), identical to R Type 6). This calculator allows you to inspect and compare all of them.
How do I read a box plot, and where do the whiskers end?
In a standard Tukey box plot, the center box spans from Q1 to Q3 with an internal line marking the median. The whiskers extend outward to the smallest and largest actual data values that fall inside the 1.5 × IQR fences. Data points outside those fences are plotted individually as outlier dots.
What changes with an even vs odd number of values?
When n is even, the dataset splits cleanly into two equal halves. When n is odd, the exact center value is the median; in Tukey’s standard method (median excluded), that center value is omitted when finding Q1 and Q3. In some alternative textbook conventions, the median is included in both halves.
How do I work out the average (mean) of a data set?
To work out the arithmetic average (mean), add all numbers together to find their sum, then divide that sum by the total count of observations (n). This calculator reports the sample mean alongside the five-number summary so you can compare the mean to the median to assess skewness.
Can the IQR be zero or negative?
The IQR is zero when Q1 and Q3 land on the same value, which happens when the middle of the data is made of repeated values (for example, in 4, 5, 5, 5, 5, 6 both Q1 and Q3 are 5, so the IQR is 0). The IQR cannot be negative because data is sorted in ascending order, ensuring Q3 is always greater than or equal to Q1.

How This Calculator Works: Formula, Defaults & Sources

Formula

  • Interquartile Range: IQR = Q3 − Q1
  • Tukey Method (TI-84 / textbooks): split sorted array at median; Q1 is median of lower half, Q3 is median of upper half
  • Inclusive Interpolation (Excel QUARTILE.INC / R type 7): rank = p(n − 1) + 1 where p = 0.25 (Q1) and 0.75 (Q3)
  • Exclusive Interpolation (Excel QUARTILE.EXC / R type 6): rank = p(n + 1)
  • Tukey Fences: Lower Inner = Q1 − 1.5 × IQR; Upper Inner = Q3 + 1.5 × IQR
  • Outer Fences: Lower Outer = Q1 − 3.0 × IQR; Upper Outer = Q3 + 3.0 × IQR
  • Mild Outliers: data values between inner and outer fences; Extreme Outliers: beyond outer fences

Default values (you can change them)

  • Example 1 (1..15 Tukey): 1, 3, 5, 7, 9, 11, 13, 15 gives Q1 = 4, Median = 8, Q3 = 12, IQR = 8
  • Example 1 (Excel INC): 1..15 gives Q1 = 4.5, Q3 = 11.5, IQR = 7
  • Example 1 (Excel EXC): 1..15 gives Q1 = 3.5, Q3 = 12.5, IQR = 9
  • Example 2 (5, 7, 8, 9 Tukey): Q1 = 6, Q3 = 8.5, IQR = 2.5

Sources

  • John W. Tukey (1977) — Exploratory Data Analysis — Foundational text establishing five-number summaries, box-and-whisker plots, and the 1.5 × IQR outlier criterion
  • Hyndman & Fan (1996) — Sample Quantiles in Statistical Packages (The American Statistician) — defines nine sample-quantile methods (R types 1–9); type 6 and type 7 match Excel QUARTILE.EXC and QUARTILE.INC

Results are planning estimates, not engineering advice. Confirm quantities with your supplier and follow your plans and local building code. Last updated: November 25, 2026. Spotted a wrong number? Email us or use the contact page.

💡Suggest a Tool