Skip to main content
Math

Interquartile Range Calculator: Q1, Q3, IQR, and Outliers

An interquartile range calculator should do more than subtract two hidden quartiles. Paste your data set and this tool sorts the values, shows Q1, the median, Q3, IQR, and the 1.5 x IQR outlier fences. The important choice is visible: the default uses the common classroom median-of-halves method, and you can switch to an inclusive-halves or interpolated percentile method when your textbook, spreadsheet, or statistics package expects it.

Paste at least four numbers. The default matches many classroom IQR examples; switch methods if your textbook or software uses inclusive or interpolated quartiles.

Paste numbers from homework, a spreadsheet column, or a small sample. Fractions like 3/4 are accepted.
IQR answers can differ by method. Use the method your class, spreadsheet, or statistics package expects.
IQR 3.5
Q1 3.5
Median 6
Q3 7
Show calculation details
1.5 x IQR fences -1.75 to 12.25
Outliers None by 1.5 x IQR
Sorted data 2, 3, 4, 5, 6, 7, 7, 7, 9
Method Median of halves (exclude center)
Values used 9 values

How to check the math

Interquartile range

Find the first quartile and third quartile using the selected method, then subtract Q1 from Q3.

IQR = Q3 - Q1
Median of halves quartiles

Sort the data, split it around the median, then take the median of each half. The default excludes the center value when n is odd; the inclusive method reuses it in both halves.

Q1 = median(lower half); Q3 = median(upper half)
Interpolated percentile quartile

For p = 0.25 or p = 0.75, locate the fractional rank h in the sorted data and linearly interpolate between neighboring values.

h = 1 + (n - 1) * p
Outlier fences

Values outside the inner fences are flagged as possible outliers; the calculator reports them without removing them.

Lower fence = Q1 - 1.5 x IQR; Upper fence = Q3 + 1.5 x IQR
Methodology

How the answer is computed

The calculator first parses the numbers you paste, accepts commas, spaces, semicolons, tabs, line breaks, and simple fractions, then sorts the values from smallest to largest. The selected quartile method determines Q1 and Q3. The default method excludes the overall median from the two halves when the data count is odd. The inclusive method includes that median in both halves. The interpolated method uses the type-7 percentile formula commonly associated with software quantiles. After Q1 and Q3 are known, IQR is Q3 - Q1. The calculator then computes inner outlier fences at Q1 - 1.5 x IQR and Q3 + 1.5 x IQR and lists any values outside those fences without deleting them from the data.

Worked examples

See the math step by step

PAA-style homework data set

DataForSEO People Also Ask example captured 2026-06-08

Data set: 4, 7, 7, 3, 5, 2, 6, 7, 9. Sort it to get 2, 3, 4, 5, 6, 7, 7, 7, 9. With the default exclude-center method, the median is 6, the lower half is 2, 3, 4, 5, and the upper half is 7, 7, 7, 9. Q1 is (3 + 4) / 2 = 3.5; Q3 is (7 + 7) / 2 = 7; IQR is 7 - 3.5 = 3.5.

Same data, different quartile method

Calculator Campus method-comparison vector

For 1, 2, 3, 4, 5, 6, 7, 8, the exclude-center median-of-halves method gives Q1 2.5, Q3 6.5, and IQR 4. The interpolated type-7 method gives Q1 2.75, Q3 6.25, and IQR 3.5. Neither is a typo; they are different quartile definitions.

Outlier fence check

Calculator Campus formula vector

For 10, 12, 13, 14, 15, 16, 17, 18, 100, the default method gives Q1 12.5, Q3 17.5, and IQR 5. The inner fences are 12.5 - 7.5 = 5 and 17.5 + 7.5 = 25. The value 100 is above the upper fence, so the calculator flags it as a possible outlier.

When to use this calculator

Use this calculator when you are making a box plot, checking homework, summarizing a skewed data set, or screening for possible outliers before a report. IQR is useful when the middle spread matters more than the full min-to-max range, because one unusually high or low value does not dominate the result. If you need to match Excel, R, or a class handout exactly, pick the quartile method first and then compare the sorted values shown in the result.

Why IQR calculators disagree

Different tools use different definitions of Q1 and Q3. Many classroom examples split the sorted data into lower and upper halves and then take each half median. Some textbooks exclude the center value when the data count is odd; others include it in both halves. Software often uses interpolated percentiles. That is why two correct calculators can return different Q1, Q3, and IQR values for the same small data set. The safest workflow is to choose the method first, then check the sorted data and quartiles before submitting an answer.

How to read the outlier fences

The 1.5 x IQR fences are screening boundaries, not a deletion rule. A value below Q1 - 1.5 x IQR or above Q3 + 1.5 x IQR is far from the middle half of the data and deserves review. It might be a typo, a rare event, or a real observation from a skewed distribution. The calculator lists those values so you can investigate them before deciding whether to keep, correct, or explain them.

What to check before using the result

Start with the sorted-data preview. If a number looks missing, duplicated, or entered with the wrong sign, fix the input before trusting the quartiles. Next, confirm the quartile method. Homework pages usually expect the method taught in class; spreadsheet or statistics workflows may expect an interpolated percentile. Finally, remember that IQR summarizes only the middle half of the data. It is stable around extremes, but it does not describe the full range or every shape detail.

Assumptions

What we assume

  • The data set contains at least four numeric values.
  • The selected quartile method is the method the user intends to match.
  • Repeated values are kept exactly as entered and affect the quartiles normally.
  • Outlier fences use the inner 1.5 x IQR rule, not the outer 3 x IQR rule.
  • Flagged outliers are shown for review and are not automatically removed from the data set.
Limitations

What this skips

  • Does not calculate grouped-data quartiles from class intervals or frequency tables.
  • Does not decide whether a flagged outlier is an error; that requires context about the data source.
  • Does not compute weighted percentiles or survey-weighted quartiles.
  • Does not estimate confidence intervals for quartiles or IQR.
  • Does not replace the exact quartile convention required by a teacher, publisher, or software package.
Common mistakes

What people miss

  • Using an Excel-style percentile answer when the assignment expects median-of-halves quartiles.
  • Forgetting to sort the data before finding Q1 and Q3.
  • Dropping duplicate values because they look repetitive; duplicates are real data unless they are entry mistakes.
  • Removing an outlier before calculating IQR even though the question asked for the original data set.
  • Reporting Q3 - median instead of Q3 - Q1.
References

References

  1. NIST/SEMATECH e-Handbook - What are outliers in the data?

    NIST/SEMATECH e-Handbook · accessed 2026-06-08

  2. R stats manual - Sample Quantiles

    R Core Team · accessed 2026-06-08

  3. Khan Academy - Interquartile range (IQR)

    Khan Academy · accessed 2026-06-08

  4. CalculatorSoup - Quartile Calculator

    CalculatorSoup · accessed 2026-06-08

  5. Social Science Statistics - Interquartile Range Calculator

    Social Science Statistics · accessed 2026-06-08

Frequently asked questions

How do you calculate the interquartile range?
Sort the data, find Q1 and Q3 with the required quartile method, then subtract: IQR = Q3 - Q1. This calculator shows the sorted data and the method used so you can verify the steps.
How do you find Q1 and Q3?
In the default classroom method, Q1 is the median of the lower half and Q3 is the median of the upper half. If the data count is odd, the default excludes the overall median from those halves; the inclusive method includes it.
Why does my spreadsheet give a different IQR?
Spreadsheet and statistics software often use interpolated percentiles instead of a hand-split median-of-halves method. Switch this calculator to the interpolated percentile method when you need to compare with that style of output.
Can I use IQR to find outliers?
Yes, as a screening rule. Compute Q1 and Q3, find IQR, then use fences at Q1 - 1.5 x IQR and Q3 + 1.5 x IQR. Values outside those fences are possible outliers that should be reviewed, not automatically deleted.