TapCub is live — analytics, insights and live chat, free on one platform
Glossary

Interquartile range (IQR): how to find it, with an example

The interquartile range is the spread of the middle 50% of your data, Q3 minus Q1. How to find it step by step, why tools disagree, how to flag outliers with 1.5 × IQR and when to use it instead of the standard deviation.

Su He Reviewed by Lin Zhou Also called IQR Last updated Nov 5, 2026 Glossary

Quick answer

The interquartile range (IQR) is the difference between the third quartile (75th percentile) and the first quartile (25th percentile) of a data set. It measures the spread of the middle 50% of values and is resistant to outliers.

Formula: IQR = Q3 − Q1

What is the interquartile range?

The interquartile range (IQR) is the spread of the middle half of your data: the distance between the first quartile (Q1, the 25th percentile) and the third quartile (Q3, the 75th percentile).

IQR = Q3 − Q1

Because it ignores the lowest 25% and the highest 25% of values, the IQR barely reacts to a handful of extreme values. That makes it the standard measure of spread for skewed data such as session duration, order value or page load time, where a few huge values would distort the range or the standard deviation.

How to find the interquartile range

  1. Sort the values from smallest to largest.
  2. Find the median (Q2). It splits the data into a lower half and an upper half.
  3. Find Q1, the middle of the lower half, and Q3, the middle of the upper half.
  4. Subtract: IQR = Q3 − Q1.

Worked example: session durations

Twelve sessions on a pricing page lasted (in seconds, sample data):

12, 18, 25, 31, 40, 44, 52, 61, 75, 90, 140, 610

The median is the average of the 6th and 7th values: (44 + 52) ÷ 2 = 48 seconds. With the method most spreadsheets and Python use by default (linear interpolation, Excel QUARTILE.INC):

  • Q1 = 29.5 seconds
  • Q3 = 78.75 seconds
  • IQR = 78.75 − 29.5 = 49.25 seconds

Compare that with the mean and standard deviation of the same data: mean 99.8 seconds, standard deviation 164.5 seconds. One 610-second session (a tab left open) more than doubles the mean, while the median and IQR describe what a typical visit looked like.

Remove the 610-second session and recompute: the mean falls from 99.8 to 53.5 seconds (−46%), the median from 48 to 44, and the IQR from 49.25 to 40. The IQR moves, but far less than the mean.

Why different tools give different quartiles

There is more than one accepted way to compute quartiles, and they disagree on small samples. Hyndman and Fan (1996) list nine. On the twelve sessions above:

MethodWhere you see itQ1Q3IQR
Linear interpolation (inclusive)Excel QUARTILE.INC, Google Sheets QUARTILE, NumPy and R defaults29.578.7549.25
Median of halves (Tukey's hinges)Many textbooks and calculators2882.554.5
ExclusiveExcel QUARTILE.EXC, some statistics packages26.586.2559.75

None of these is wrong. With large data sets the differences shrink to almost nothing. With small samples, state which method you used, and use the same one when you compare periods.

Using the IQR to flag outliers

Tukey's rule marks a value as a potential outlier if it falls outside:

lower fence = Q1 − 1.5 × IQR
upper fence = Q3 + 1.5 × IQR

In the example, the upper fence is 78.75 + 1.5 × 49.25 = 152.6 seconds. The 610-second session is flagged; the 140-second session is not. The lower fence is negative, so nothing is flagged at the bottom.

A flagged value is a question, not an automatic deletion. A 610-second session might be an idle tab, or a real buyer comparing plans. Check the session before you drop it; see outliers in data and winsorization for ways to limit their influence without throwing them away.

IQR vs range vs standard deviation

MeasureUsesSensitive to extremes?Best for
Range (max − min)Two most extreme valuesVeryQuick sanity check
Standard deviationEvery value, squared distancesYesRoughly symmetric data
Interquartile rangeMiddle 50%LittleSkewed data, outlier screening

The IQR pairs naturally with the median, the same way the standard deviation pairs with the mean. A box plot draws exactly these numbers: the box runs from Q1 to Q3, the line in the middle is the median, and the whiskers reach to the fences.

Where it shows up in analytics

  • Time on page and session duration, which always have long right tails.
  • Page performance. Web performance teams report the 75th percentile (Q3) rather than the mean; Google's Core Web Vitals thresholds are assessed at P75. See percentile.
  • Order values and revenue per user, to describe the typical customer without the few largest accounts.

In TapCub, the distribution report shows how a metric spreads across users or sessions in buckets, and performance cards switch between P75, P95, median and average, so you can read the middle of the distribution instead of an average pulled by a few slow pages. The descriptive statistics page lists the other summaries worth reporting alongside the IQR.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Su He

Data Analyst

Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

How do you find the interquartile range?

Sort the data, find the median, then find Q1 (middle of the lower half) and Q3 (middle of the upper half). The IQR is Q3 minus Q1.

What does a large interquartile range mean?

The middle half of your values is spread out: typical visits, orders or load times vary a lot. A small IQR means most values sit close to the median.

Why does Excel give a different IQR than my calculator?

They use different quartile methods. Excel QUARTILE.INC interpolates between values; many calculators take the median of each half. On small samples the results differ; on large ones they converge.

How is the IQR used to find outliers?

Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are flagged as potential outliers (Tukey’s fences). Check them before removing anything.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics