Interquartile Range Calculator — IQR, Quartiles & Box Plot Values

Interquartile Range Calculator for calculating Q1 Q3 and IQR to measure the middle 50 percent spread of a dataset
Calculate the interquartile range of a dataset quickly with this free Interquartile Range Calculator. Enter your numerical data to find the first quartile (Q1), third quartile (Q3), and IQR, which represents the spread of the middle 50% of observations. The calculator is useful for understanding data variability, comparing distributions, identifying potential outliers, and creating box plots. Ideal for students, teachers, researchers, statisticians, analysts, and anyone who needs a quick way to measure the spread of numerical data.
📦
IQR Calculator
Interquartile Range · Q1 · Q2 · Q3 · Outlier Fences
Free Tool
Enter Dataset
Values Paste from Excel, one value per line or comma-separated
Paste a column directly from Excel — newlines, commas, and tabs all accepted.
📦IQR Calculator

Enter your dataset and click Calculate to see results.

📖

How to Use the IQR Calculator

Calculate the interquartile range, all four quartiles, outlier fences, and detected outliers from any numeric dataset. Paste directly from an Excel column — no reformatting required. Results include all values needed to construct or verify a box plot.

1

Paste your dataset

Enter numeric values by pasting an Excel column into the dataset field, or type values separated by commas or newlines. Any sample size from 4 values upward works correctly. Decimals and negative numbers are both supported. The calculator sorts values internally before computing quartiles.

2

Calculate quartiles and fences

Click Calculate to see Q1 (25th percentile), Q2 (median / 50th percentile), Q3 (75th percentile), IQR, lower fence, and upper fence. Values beyond the fences are outliers by the standard 1.5×IQR rule. Results match Excel's QUARTILE.INC function exactly, making them directly comparable to Excel output.

3

Use results for box plots and outlier review

All five values needed for a box plot — min, Q1, median, Q3, max — are shown alongside the IQR and fences. The tool lists each flagged outlier individually so you can investigate before deciding whether to keep, correct, or exclude it.

💡
IQR is the right spread measure when your data has outliers

Outliers pull standard deviation toward them because the calculation uses the mean. IQR uses only the 25th and 75th percentiles — neither of which is affected by values in the tails. This makes IQR the better spread measure whenever you report the median instead of the mean. Median and IQR always go together; mean and standard deviation go together. Mixing them (median with SD, or mean with IQR) is statistically inconsistent.

💡

IQR Formula, Quartile Calculation, Outlier Fences, and Box Plots

How Q1, Q2, and Q3 are computed, the IQR formula, outlier fence construction, box plot anatomy, the Excel QUARTILE.INC formula, and why IQR is more robust than range or standard deviation for skewed data.

The IQR formula

The interquartile range is the difference between the 75th and 25th percentiles. It captures the spread of the middle 50% of the dataset — the region most representative of typical values. Because the bottom 25% and top 25% of values are excluded, extreme values in either tail have no effect on IQR.

IQR and Outlier Fences
IQR = Q3 − Q1 Lower fence = Q1 − (1.5 × IQR) Upper fence = Q3 + (1.5 × IQR)
Values outside these fences are mild outliers · Use 3×IQR for extreme outlier detection · Excel: =QUARTILE.INC(range,3)−QUARTILE.INC(range,1)

How quartiles are calculated

Q1 is the median of the lower half of the sorted dataset, Q2 is the overall median, and Q3 is the median of the upper half. Several different calculation methods exist — Excel's QUARTILE.INC uses linear interpolation between adjacent values when the target percentile falls between two positions. This calculator uses the same interpolation method, ensuring results match Excel exactly. For small datasets, different methods can produce visibly different quartile values, which is why matching the method to your software is important.

Test scores

Sorted: 55, 60, 65, 70, 72, 78, 85, 90. n=8. Q1=63.75, Q3=79.75.

IQR=16 · Lower fence=39.75 · Upper fence=103.75
Response times with outlier

Data: 120, 130, 125, 118, 122, 5. The 5ms reading is suspect.

IQR flags 5ms as below lower fence — likely a recording error
Sales figures

Monthly sales: 1200, 1500, 1700, 2000, 2100, 2400. No outliers.

Q1=1600 · Q3=2050 · IQR=450 · All values within fences
Heights (cm)

Q1=165, Q3=180, IQR=15. Fences: 142.5 to 202.5.

Values outside this range are statistical outliers for the group

Box plot anatomy — what each element represents

Box plots draw a rectangle from Q1 to Q3, with width equal to the IQR. Inside the box, a vertical line marks the median (Q2). Whiskers extend from the box edges to the most extreme non-outlier values within 1.5×IQR of Q1 and Q3. Individual points beyond the whiskers are plotted as separate dots — those are the flagged outliers. The asymmetry of the box (median closer to Q1 or Q3) reveals skewness at a glance without any formula.

Excel box plot and QUARTILE.INC formula

Excel's Box and Whisker chart (available from Excel 2016 onward) computes and plots all quartile values automatically from raw data. To compute IQR manually, use =QUARTILE.INC(range,3)−QUARTILE.INC(range,1). The lower fence is =QUARTILE.INC(range,1)−1.5*(QUARTILE.INC(range,3)−QUARTILE.INC(range,1)). These formulas match this calculator's output exactly.

IQR vs range vs standard deviation for spread

Range (max minus min) is the simplest spread measure but is entirely determined by the two most extreme values in the dataset. Adding one outlier can double the range without changing anything else. Standard deviation uses every value in the computation and is sensitive to outliers because it uses the mean. IQR is the most robust of the three — it is immune to values in the top and bottom 25% of the distribution. For skewed data, heavily tailed distributions, or any dataset where outliers are present, IQR gives a more representative picture of typical spread than either range or SD.

Frequently Asked Questions

Common questions about interquartile range, quartile calculation methods, outlier fences, and box plot construction.

Formula and calculation

Applications and Excel