Interquartile Range Calculator
Paste a list of numbers and the calculator returns the first quartile (Q1), third quartile (Q3), the interquartile range (IQR = Q3 - Q1), and the Tukey fences that flag statistical outliers (Q1 - 1.5 * IQR and Q3 + 1.5 * IQR). Useful for boxplot data prep, A/B test cleaning and any analysis where outliers would skew the mean.
How to calculate the IQR
-
1
Paste your data
Comma, space or newline-separated numbers: the parser accepts all common formats.
-
2
Pick the quartile method
Exclusive (Tukey), inclusive (percentile), or Moore & McCabe. Results can differ by a few tenths for small samples.
-
3
Read the summary
Min, Q1, median, Q3, max plus IQR, lower and upper outlier fences and a list of flagged outliers.
-
4
Copy the result
Copy the five-number summary in a format ready for a report, a boxplot or a paste into R/Python.
Quartile calculation methods
Different software packages use different quartile definitions. The differences are small for large samples and can be meaningful for n < 20.
| Method | Used by | Formula idea |
|---|---|---|
| Tukey (exclusive) | R default, boxplots | Exclude median from halves when odd n |
| Inclusive (Moore & McCabe) | Many textbooks, Excel | Include median in both halves |
| Percentile (type 7) | NumPy default, pandas | Linear interpolation on rank |
| Method 5 / Weibull | Some stats textbooks | (i - 0.5) / n plotting positions |
The tool defaults to Tukey because it matches R’s quantile(type = 5) and the classic Tukey boxplot.
The IQR in three uses
- Spread: IQR is a robust measure of scatter; unlike standard deviation, it is not pulled by a single extreme value.
- Outliers: A value below
Q1 - 1.5 * IQRor aboveQ3 + 1.5 * IQRis an outlier by the Tukey rule. Extreme outliers use3 * IQR. - Boxplots: The box spans Q1 to Q3, the line inside is the median, the whiskers extend to the last value inside the
1.5 * IQRfences.
Worked example
Dataset: 2, 4, 5, 7, 8, 10, 12, 15, 50
- Sorted: same as input (already sorted).
- Median: 8 (middle value).
- Lower half (exclusive):
2, 4, 5, 7; Q1 = 4.5. - Upper half (exclusive):
10, 12, 15, 50; Q3 = 13.5. - IQR: 13.5 - 4.5 = 9.
- Lower fence: 4.5 - 1.5 * 9 = -9 (no lower outliers).
- Upper fence: 13.5 + 1.5 * 9 = 27 (50 is flagged as an outlier).
Common mistakes
- Confusing IQR with range. Range is
max - minand is very sensitive to outliers; IQR is the middle 50% and is robust. - Mixing up methods silently. If you compute Q1 in Excel and Q3 in R, you might end up with a mismatched pair and a wrong IQR.
- Applying the 1.5 * IQR rule automatically. It is a rule of thumb, not a statistical test. For heavy-tailed distributions (financial returns) the fences are too tight.
Frequently Asked Questions
The IQR is Q3 - Q1, the range covering the middle 50% of a sorted dataset. It is a robust measure of spread that is not influenced by extreme values the way the full range is.
There are at least nine published quartile methods. The differences are negligible for large samples and can disagree by a fraction of a unit for small samples. R, Excel and NumPy each use different defaults.
Tukey’s rule flags any value below Q1 - 1.5 * IQR or above Q3 + 1.5 * IQR as a suspected outlier. It is a heuristic designed for roughly normal data, use it as a starting point, not a proof of error.
Yes. The calculator sorts values and computes quartiles on any real-valued dataset, negative or mixed. It does not impose a lower bound.
Related Tools
Social Security Calculator
Estimate a US Social Security retirement benefit from your PIA and claiming age. Compare monthly and annual amounts at 62, FRA 67 and 70.
BMI Calculator
Calculate body mass index from height and weight. Shows WHO category, healthy-weight range and limitations of BMI.
Age Calculator
Calculate exact age in years, months and days from a birth date, plus total days, hours and the next birthday countdown.
Dog Age Calculator
Convert your dog's age to human years using modern veterinary research. Breed-size aware: small, medium and large dogs age differently.
Fahrenheit to Celsius Converter
Convert Fahrenheit temperatures to Celsius with the exact formula, Kelvin output and common reference points for weather, cooking and health.
Time Zone Converter
Convert a time between any two time zones, with daylight-saving shifts applied automatically.
Tool available in other languages
- Kalkylator för interkvartilavstånd [SV]
- حاسبة المدى الربيعي (IQR) [AR]
- Calculateur d'écart interquartile [FR]
- Kalkulator Rentang Antarkuartil (IQR) [ID]
- Interquartilbereichsrechner [DE]
- 사분위 범위(IQR) 계산기 [KO]
- Interkwartielafstand (IQR) berekenen [NL]
- 四分位範囲(IQR)計算ツール [JA]
- เครื่องคำนวณช่วงระหว่างควอไทล์ (IQR) [TH]
- Kalkulator rozstępu międzykwartylowego [PL]
- Calculadora de Rango Intercuartílico [ES]
- Công cụ tính khoảng tứ phân vị (IQR) [VI]
- Calculadora de intervalo interquartil [PT]
- Calcolatore dell'intervallo interquartile [IT]
- Калькулятор межквартильного размаха (IQR) [RU]
- Çeyrekler Arası Aralık (IQR) Hesaplayıcı [TR]
- 四分位距(IQR)计算器 [ZH]