Logo

MonoCalc

/

IQR Calculator

Math
Enter numbers separated by commas, spaces, or newlines

About This Tool

📊 IQR Calculator – Measure Spread with the Interquartile Range

The Interquartile Range (IQR) is one of the most robust measures of statistical spread. Unlike the standard deviation or variance, it is resistant to extreme values, making it the preferred summary statistic for skewed distributions, exam scores, salary data, and any dataset where outliers could distort the picture.

What Is the IQR?

The IQR equals the difference between the third quartile (Q3) and the first quartile (Q1):

IQR = Q3 − Q1

Q1 (the 25th percentile) marks the point below which 25% of observations fall. Q3 (the 75th percentile) marks the point below which 75% of observations fall. The IQR therefore captures the middle 50% of the data, stripping away the influence of both the lowest and highest quarters.

Three Input Modes

Raw Dataset Mode

Paste or type your values — separated by commas, spaces, or newlines — and the tool sorts them, computes Q1, median, Q3, and IQR, identifies outliers, and draws an interactive box-and-whisker plot. Minimum 3 values required.

Frequency Table Mode

When observations repeat, enter each unique value once alongside its count. The tool expands the table to a full dataset internally, so calculations are exact rather than estimated. Ideal for classroom statistics problems with repeated observations.

Grouped Class-Interval Mode

For data summarised in frequency distribution tables, enter each class interval with its frequency (e.g., 10–20: 6). Quartiles are estimated using the standard interpolation formula:

Qp = L + ((p·N − CF_prev) / f) × h

where L is the lower class boundary, N is the total frequency, CF_prev is the cumulative frequency before the quartile class, f is the class frequency, and h is the class width.

Outlier Detection with IQR Fences

John Tukey's classic fence rule uses the IQR to flag unusual observations:

Fence TypeLower BoundUpper Bound
Inner (mild outliers)Q1 − 1.5 × IQRQ3 + 1.5 × IQR
Outer (extreme outliers)Q1 − 3 × IQRQ3 + 3 × IQR

The fence multiplier defaults to 1.5 but can be changed. Values beyond the inner fences are mild outliers; values beyond the outer fences are extreme outliers.

Why IQR, not standard deviation?
Standard deviation amplifies the contribution of outliers because it squares deviations. The IQR ignores the outer quarters entirely, making it a more informative spread measure for salary distributions, real-estate prices, test scores, and other right-skewed data.

Quartile Method Comparison

Different software packages compute Q1 and Q3 differently. This tool supports three widely used conventions:

  • Tukey Hinges — Splits sorted data around the median and takes the median of each half. Used by R's boxplot() and the classic five-number summary.
  • Inclusive (QUARTILE.INC) — Linearly interpolates across all n values using 0-based indexing (Hyndman-Fan Type 7). Matches Excel, Python's numpy.percentile, and most textbooks.
  • Exclusive (QUARTILE.EXC) — Scales positions by(n+1), avoiding anchoring at the minimum and maximum. Matches Excel's QUARTILE.EXC.

The Method Comparison panel shows Q1, Q2, Q3, and IQR for all three conventions side by side so you can see exactly how the choice affects your results — particularly for small samples.

Box-and-Whisker Plot

The interactive box plot visualises the five-number summary: minimum whisker, Q1 box edge, median line, Q3 box edge, and maximum whisker. Mild outliers appear as filled circles; extreme outliers asdiamond markers. When Compare Mode is active, two box plots are drawn side by side for instant visual comparison of spread and centre.

Example: Exam Scores

Data: 45, 52, 58, 60, 63, 65, 68, 70, 72, 75, 80, 88, 95
Method: Tukey Hinges
─────────────────────────────
Q1   = 60
Q2   = 68
Q3   = 75
IQR  = 15
Lower fence (1.5×IQR) = 37.5
Upper fence (1.5×IQR) = 97.5
Outliers: none

Practical Use Cases

  • Education — Summarise test or assignment scores to identify students who may need support (below Q1) or extension (above Q3).
  • Finance — Analyse salary, revenue, or expense distributions without letting extreme values dominate the summary.
  • Research — Report spread in skewed or non-normal datasets where standard deviation is misleading.
  • Quality control — Flag process measurements that fall outside the expected mid-50% range.

All calculations run entirely in your browser — no data is sent to any server.

Frequently Asked Questions

Is the IQR Calculator free?

Yes, IQR Calculator is totally free :)

Can I use the IQR Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use IQR Calculator?

Yes, any data related to IQR Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

What is the Interquartile Range (IQR) and why is it useful?

The IQR is the distance between the first quartile (Q1, 25th percentile) and the third quartile (Q3, 75th percentile): IQR = Q3 − Q1. It measures the spread of the middle 50% of a dataset and is resistant to outliers, making it more reliable than the range for skewed or non-normal data. It is widely used in box plots, outlier detection, and descriptive statistics.

How does this IQR calculator work?

Enter your data as a comma-, space-, or newline-separated list (Raw mode), or switch to Frequency Table mode for repeated values, or Grouped Intervals mode for class-interval data. Select a quartile method, set optional precision and fence multiplier, then click Calculate. The tool returns Q1, median, Q3, IQR, outlier fences, identified outliers, and a box-and-whisker plot.

What is the difference between Tukey, Inclusive, and Exclusive quartile methods?

Tukey hinges split the sorted data around the median and take the median of each half — the classical box-plot convention. Inclusive (Excel QUARTILE.INC) uses 0-indexed linear interpolation across all n values and matches most statistics textbooks. Exclusive (Excel QUARTILE.EXC) scales by (n+1) to avoid anchoring at the extremes. For large datasets the three methods converge; differences appear mainly in small samples.

How are outliers detected using the IQR?

Outlier fences extend from the quartiles by a multiple of the IQR. Mild outliers lie beyond Q1 − 1.5×IQR or Q3 + 1.5×IQR (inner fences). Extreme outliers lie beyond Q1 − 3×IQR or Q3 + 3×IQR (outer fences). You can adjust the fence multiplier (default 1.5) to use a stricter or more permissive threshold.

How does grouped class-interval mode work?

Grouped mode estimates quartiles from a frequency distribution table using linear interpolation: Qp = L + ((p·N − CF_prev) / f) × h, where L is the lower class boundary, N is the total frequency, CF_prev is the cumulative frequency before the quartile class, f is the class frequency, and h is the class width. This is the standard textbook formula for grouped data.

Can I compare two datasets side by side?

Yes. Enable Compare Mode to enter a second dataset. The tool displays Q1, median, Q3, and IQR for both datasets in parallel stat cards and draws side-by-side box plots so you can visually compare the spread, centre, and any outliers between the two groups.