Skip to main content
MathStatCalc

Interquartile Range Calculator

Calculate the interquartile range (IQR) of any dataset in one click. You'll get Q1, Q2 (median), Q3, the IQR itself, the five-number summary, outlier fences, a sorted value table, and a full box-and-whisker plot — with a clear step-by-step breakdown.

Enter your data

Separate values with commas, spaces, semicolons, tabs, or new lines. Decimals and negative numbers are supported.
Leave empty unless each value repeats.
Options

Result

Step-by-step calculation

    Sorted value table

    # Value Frequency Position Quartile

    Distribution plot

    Box-and-whisker plot

    How to use the Interquartile Range Calculator

    1. Paste or type your numbers into the Dataset box. Any common separator works.
    2. If some values repeat, enter their counts in the Frequencies field — same order as the dataset.
    3. Choose how many decimals to display (or use Auto for exact values when possible).
    4. Press Calculate IQR. You'll instantly see Q1, Q2, Q3, the IQR, the fences, any outliers, and both plots.

    Method and formulas

    The interquartile range (IQR) measures the spread of the middle 50% of a dataset. It's the difference between the third quartile Q3 (the 75th percentile) and the first quartile Q1 (the 25th percentile):

    IQR = Q3 − Q1

    How quartiles are calculated

    Sort the data from smallest to largest, then locate the median (Q2), and use it to split the dataset into a lower half and an upper half. The median of the lower half is Q1; the median of the upper half is Q3. When the total count is odd and the median is a single central value, that value is excluded from both halves (the classic Tukey method).

    Outlier fences

    Values lying outside the "inner fences" are considered potential outliers:

    Five-number summary

    The five-number summary consists of Minimum, Q1, Q2 (median), Q3, Maximum. It describes the shape and spread of a dataset without assuming any particular distribution.

    Worked example: IQR of 1, 3, 4, 6, 8, 9, 11, 12

    1. Sort the values: 1, 3, 4, 6, 8, 9, 11, 12 (already sorted).
    2. Median (Q2): N = 8 (even). Middle pair = 6 and 8 → Q2 = (6 + 8) / 2 = 7.
    3. Lower half: 1, 3, 4, 6 → Q1 = (3 + 4) / 2 = 3.5.
    4. Upper half: 8, 9, 11, 12 → Q3 = (9 + 11) / 2 = 10.
    5. IQR: Q3 − Q1 = 10 − 3.5 = 6.5.
    6. Fences: lower = 3.5 − 1.5×6.5 = −6.25; upper = 10 + 1.5×6.5 = 19.75 → no outliers.

    So for 1, 3, 4, 6, 8, 9, 11, 12, Q1 = 3.5, Q2 = 7, Q3 = 10, IQR = 6.5.

    How to interpret the result

    Assumptions and limitations

    Frequently asked questions

    What is the interquartile range?
    The interquartile range (IQR) is the spread of the middle 50% of a dataset. It's calculated as IQR = Q3 − Q1, where Q3 is the 75th percentile and Q1 is the 25th percentile.
    How do you calculate IQR?
    Sort the data, find the median (Q2), then find the median of the lower half (Q1) and of the upper half (Q3). IQR = Q3 − Q1.
    What is the IQR of 1, 3, 4, 6, 8, 9, 11, 12?
    Q1 = 3.5, Q2 = 7, Q3 = 10. IQR = 10 − 3.5 = 6.5.
    What does an IQR tell you about a dataset?
    It measures the spread of the middle half of the data. A smaller IQR means the central values are clustered; a larger IQR means they are more spread out. IQR is robust to outliers.
    How are outliers determined from the IQR?
    Values below Q1 − 1.5×IQR or above Q3 + 1.5×IQR are typically considered outliers. This calculator computes and lists them automatically.
    What is the difference between IQR and standard deviation?
    IQR measures spread through quartiles and is resistant to outliers. Standard deviation measures spread from the mean and is much more sensitive to extreme values.
    Can I use frequencies with this calculator?
    Yes. Enter the counts in the Frequencies field in the same order as the dataset. The calculator treats the expanded dataset as if each value were repeated that many times.
    Does the calculator send my data anywhere?
    No. All calculations run in your browser. Your numbers never leave your device.
    Reviewed by the Math Content Team
    Calculator methodology and formula verification

    Quartile calculations are cross-checked against R's quantile() and the Tukey quartile definition found in standard statistics texts (e.g. Introduction to the Practice of Statistics, Moore & McCabe). Quarterly unit tests confirm both the middle-50% bounds and the outlier fences. Spotted an issue? Contact us.