1001Ferramentas
📊 Calculators

Median Quartiles IQR Calculator

Computes median, first quartile Q1, third quartile Q3 and interquartile range IQR of a list of numerical values.

Quartiles and interquartile range (IQR)

Sort the data, then cut it into four equal parts at Q1 = P25, Q2 = median = P50 and Q3 = P75. The interquartile range, IQR = Q3 − Q1, measures how wide the middle 50% is. Run 1,3,5,7,9,11,13,15 through it and you get Q1 = 4, Q2 = 8, Q3 = 12, so IQR = 8. Tukey (1977) gave us the five-number summary (min, Q1, Q2, Q3, max), which is what the boxplot draws. His rule treats a value as an outlier if it falls below Q1 − 1.5·IQR or rises above Q3 + 1.5·IQR; for extreme outliers the multiplier becomes 3·IQR.

Applications

You'll see them in boxplots during exploratory analysis, in SRE latency reports with P50/P95/P99 SLAs, in salary surveys, and across robust statistics, where the IQR shrugs off outliers in a way the standard deviation can't. They're handy in quality control too, and in any skewed distribution where the mean and standard deviation paint a misleading picture.

FAQ

Why use IQR instead of range? The range (max − min) is at the mercy of the extremes. Because the IQR throws out the bottom 25% and top 25%, one stray outlier won't budge it.

Why do Excel, R and NumPy give different quartiles? Hyndman & Fan (1996) cataloged at least nine ways to define a quantile. With small n those methods pull apart; as n grows they settle on the same answer.

Is the 1.5·IQR rule a hard cutoff? No, it's just a rule of thumb. On a normal distribution it tags about 0.7% of points as outliers. Look at whatever it flags before you throw anything out.

Related Tools