Math calculator

IQR Calculator

The spread of the middle half — and the one measure a bad value cannot move.

The middle half, and what falls outside it

Paste numbers separated by commas, spaces or new lines.

Q3 71.8 − Q1 60.3

11.5

The middle half of your 12 values spans 11.5. Anything below 43.0 or above 89.0 is outside the usual fence.

IQR

11.5

Q3 − Q1

Lower fence

43.0

Q1 − 1.5 × IQR

Upper fence

89.0

Q3 + 1.5 × IQR

Flagged

2

inside the outer fence

Values outside the fences

31.0 (mild) · 92.0 (mild)

Flagged means worth a look, not wrong. Deleting points because a fence flagged them is how real effects get removed from real data.

Corrupt one value and watch what survives

Multiply your single largest value by this. Nothing else changes.

× 1
Three measures of spread on your data, before and after one value is corrupted.
MeasureOriginalCorruptedChange
Rangemax − min; breakdown point 061.061.0none
Standard deviationsquares every deviation14.614.6none
IQRbreakdown point 25%11.511.5none

Move the slider. The IQR will hold still while the other two do not — that is what "robust" means, stated as a number rather than an adjective.

What this tool shows

Every textbook says the interquartile range is robust. The slider in the tool above lets you corrupt the largest value in your own dataset and watch the range and the standard deviation move while the IQR does not — which is the claim, demonstrated instead of repeated.

  • The interquartile range of your data
  • Inner fences at 1.5 × IQR and outer at 3 ×
  • Exactly which values fall outside each
  • Mild against extreme outliers
  • What happens to the range and SD when one value is corrupted
  • Where the fence rule misleads on skewed data
Robustness, demonstrated Inner and outer fences Lists what is flagged Tukey, cited

A flagged value is one to look at, not one to delete.

Updated 7 September 2026 · Works in any browser, no installation

IQR = Q3 − Q1. It is the width of the middle 50% of your data, and its whole value is what it ignores: nothing that happens in the top or bottom quarter can change it. That is why the standard outlier fences are built from it rather than from the mean.

At a glance

Formula shown
IQR = Q3 − Q1. The conventional inner fences sit at Q1 − 1.5 × IQR and Q3 + 1.5 × IQR; the outer fences at Q1 − 3 × IQR and Q3 + 3 × IQR. Values past the inner fence are called mild outliers, past the outer fence extreme.
Scenario support
Describing spread when the data is skewed or contains errors; drawing box plot whiskers; setting a review threshold for unusually large transactions or response times; comparing variability between two groups without letting one extreme value dominate.
Educational estimate
Planning support from the values you enter — not professional advice.

Why the middle half is the part worth measuring

Spread is easy to measure badly. The two obvious ways both have a specific weakness, and the IQR exists because of them.

The range is the distance between the two most extreme values, which means it is determined entirely by the two least typical numbers you have. A single mistyped figure — a temperature entered in the wrong unit, an extra zero on a price — sets the range by itself, and every other observation becomes irrelevant to it.

The standard deviation uses every value, which sounds strictly better, but it squares each deviation before averaging. Squaring is not neutral: a point ten times further from the mean than another contributes a hundred times as much. Distant points therefore dominate, which is exactly the wrong weighting when the distant points are the suspect ones.

The interquartile range takes the opposite approach and simply refuses to look at the ends. Sort the data, discard the bottom quarter and the top quarter, and measure what is left. Whatever happens outside that middle band — however extreme — cannot change the answer.

You give something up for that. The IQR discards half your data, so on clean, well-behaved measurements it is a less efficient estimate of spread than the standard deviation: it moves around more from sample to sample. The trade is deliberate. You accept a noisier estimate in exchange for one that cannot be captured by a handful of bad values.

Where the 1.5 in the fence rule came from

Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are conventionally flagged. The 1.5 is a choice, not a derivation, and knowing where it came from is the difference between using the rule and obeying it.

John Tukey introduced it in Exploratory Data Analysis in 1977, alongside the box plot itself. The reasoning is calibration against the normal distribution. For normally distributed data the interquartile range is about 1.349 standard deviations, so a fence at 1.5 × IQR beyond each quartile sits roughly 2.7 standard deviations from the centre.

At that distance about 0.7% of normal data falls outside — roughly one observation in 140, split between the two tails. That is the number Tukey was aiming at: rare enough that a flag means something, common enough that the rule finds real problems rather than firing once a decade.

The outer fence at 3 × IQR sits about 4.7 standard deviations out, where normal data essentially never lands. That is why the two are labelled differently: past the inner fence is mild, past the outer fence is extreme, and the second genuinely warrants a different level of suspicion.

None of this makes 1.5 correct in any deeper sense. It is a well-chosen default for roughly-normal data, and it was never claimed to be more.

Robustness, as a number rather than an adjective

“Robust” has a precise definition, and it is worth having because it turns a vague compliment into something you can compare.

The breakdown point of a statistic is the fraction of the data an adversary would have to corrupt before they could push the statistic anywhere they liked. Higher is better, and the ceiling is 50% — past that the corrupted values are the majority and no method can tell which half is real.

The range has a breakdown point of zero. One value out of any number is enough to send it to infinity.

So does the mean, and so does the standard deviation. Both are averages over every observation, so a single value large enough drags either one as far as you want.

The IQR has a breakdown point of 25%. You would have to corrupt a quarter of the observations before Q1 or Q3 moved out from between the values that surround them.

The median reaches 50%, the theoretical maximum, which is why it is the standard example of a resistant statistic.

The slider in the tool above turns this into something you can watch. Multiply one value — one, out of however many you entered — and the range and standard deviation climb without limit while the IQR does not move at all. Not “moves less”: does not move, because the corrupted point is outside the middle half and the IQR never looks there.

What a flagged value has, and has not, been shown to be

This is where the fence rule is most often misused, and the misuse quietly damages real analyses.

A value past the fence has been shown to be far from the middle of this particular dataset. That is the entire claim. It has not been shown to be a mistake, a measurement error, a fraud, or anything else that would justify removing it.

Genuine extremes are common and often the most informative observations you have. The one customer who spends twenty times the median is usually real. So is the one server response that took four seconds, and it is probably the one worth investigating. Deleting them because a fence flagged them removes precisely the signal that mattered.

Worse, the rule flags a fixed share of clean data by construction. Around 0.7% of any normal sample lands outside the fences with nothing wrong at all. In a dataset of ten thousand observations that is about seventy perfectly good values, and removing them makes the sample look tidier while making it less representative.

The defensible sequence is: flag, then look. If a value turns out to be a data-entry error or a unit mix-up, fix or drop it and say so. If it is real, keep it — and if its presence is distorting a mean, that is an argument for reporting the median instead, not for deleting the observation.

IQR against standard deviation: choosing between them

They measure the same idea and are not interchangeable. Which one to report follows from the data, not from preference.

Report the standard deviation when the data is roughly symmetric and clean. It uses every observation, so it is the more efficient estimate, and it is the input almost every further method expects — confidence intervals, t-tests, effect sizes and control limits are all built on it. Pair it with the mean.

Report the IQR when the data is skewed, heavy-tailed, or you do not trust every value. Incomes, house prices, response times, insurance claims and waiting times are all strongly right-skewed, and on those a standard deviation describes the tail more than the typical case. Pair it with the median.

A quick test: compare the mean and the median. If they are close, the distribution is roughly symmetric and the standard deviation is telling you something honest. If the mean sits well above the median, the tail is doing the talking, and the IQR with the median will describe a typical observation far better.

For roughly normal data the two are related by IQR ≈ 1.35 σ, so dividing an IQR by 1.349 gives a standard-deviation-like number that is far harder to corrupt. That quantity has a name — the normalised IQR — and it is one of the standard robust scale estimates.

Reporting both is entirely reasonable, and the gap between them is itself informative: a standard deviation much larger than IQR/1.35 says a few extreme values are carrying it.

Where the fence rule breaks down

Three situations where 1.5 × IQR gives an answer that looks authoritative and is not.

Skewed data. The rule is symmetric, but a right-skewed distribution is not. On income or latency data the upper fence flags a steady stream of ordinary observations simply because the right tail is long, while the lower fence flags nothing at all. The flags are real arithmetic and a poor guide. The standard fix is the adjusted box plot of Hubert and Vandervieren, which shifts the fences using a robust measure of skewness; another is to take logarithms first and apply the ordinary rule to those.

Small samples. With ten or fifteen values the quartiles themselves are unstable, so the fences move noticeably when a single observation is added. Applying an outlier rule at that size mostly measures the noise in your own quartile estimates. Look at the numbers directly instead.

Multiple groups mixed together. If a dataset actually contains two populations — two machines, two sites, two customer segments — the combined IQR describes neither, and the fences will flag members of the smaller group for being ordinary members of the smaller group. Splitting first is the answer, not a wider fence.

One further limit applies to every method here: the fences describe the sample in front of you. A new observation being inside them is not evidence that it is typical of anything wider, and the IQR carries no confidence interval of its own on this page.

Sources and methodology

Where the fence rule and the robustness figures come from.

Method. Quartiles use the type 7 rule, which is what Excel, R, NumPy and Google Sheets return, so the IQR here matches the figure those tools give. The 1.349 relationship quoted between the IQR and the standard deviation is the normal-distribution value 2 × Φ⁻¹(0.75), not an approximation chosen for convenience. The contamination panel recomputes all three measures of spread from scratch on the modified dataset rather than adjusting them incrementally, so what it shows is the actual statistic and not a description of one. That engine is verified on every change against 0 assertions, including the quartile values checked against R’s published output. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

QuartileQ1, Q2 and Q3 by all eleven conventions in common use — Excel, R, Tukey hinges and the TI-84 rule — with a warning when they disagree.
Five Number SummaryMinimum, Q1, median, Q3 and maximum, drawn as a box plot with every one of your observations plotted underneath it — so you can see what the summary threw away.
PercentileThe value at any percentile and the percentile rank of any value, with all nine standard methods — and the round trip that shows the two directions are not inverses.
Standard DeviationSample and population standard deviation, plus variance, mean, median, quartiles, z-scores, outliers, and confidence intervals.
Geometric MeanThe average for things that compound. Growth of +50% then -50% averages to zero arithmetically and to a real 13.4% loss geometrically, which is what actually happened.
Weighted AverageEach value carries the weight you give it, with every item's share of the total shown as a percentage so you can see what is actually driving the answer.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool for describing a dataset. A value outside the fences has been flagged for attention, not shown to be an error — removing data on that basis alone is a decision this tool cannot make for you.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

  • Formula and examples verified on 7 September 2026
  • Self-reviewed — written and checked by the same person, with no independent reviewer
  • Educational estimate only
  • How calculators are verified
What's changed (3 updates)

Published 7 September 2026

  1. Published an interquartile range calculator with the 1.5 and 3 times fences and the values that fall outside each, separating mild from extreme rather than reporting one undifferentiated outlier list.
  2. Added a contamination slider that multiplies the single largest value in the reader's own data and shows the range, standard deviation and IQR side by side as it moves — turning 'the IQR is robust' from an adjective into a breakdown point the reader watches hold at 25% while the other two break at the first bad value.
  3. States where the fence rule misleads: it is symmetric and most real data is not, so on skewed distributions the upper fence flags ordinary observations, and the adjusted boxplot of Hubert and Vandervieren is cited as the fix rather than left out.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.