Median and Quartile Calculator

This median and quartile calculator finds Q1, the median, Q3 and the interquartile range for any data set. It also gives the five-number summary, outlier fences and a box plot.

Checks on your data

  • Different textbooks and software compute quartiles differently, so Q1 and Q3 can differ slightly. Use the method your course or tool specifies.
  • 2 possible outliers (7, 15) lie beyond 1.5 × IQR from the quartiles. Check for typing errors, then see how much the result changes without them. See the box plot →
  • The data are strongly left-skewed (skewness -1.29). The mean and standard deviation can mislead here; the median and IQR describe skewed data better. Measure skewness →

Results

First quartile Q1
36
Median Q2
40.5
Third quartile Q3
43
Interquartile range IQR
7
Minimum
7
Maximum
49
Range
42
Lower fence Q1 − 1.5·IQR
25.5
Upper fence Q3 + 1.5·IQR
53.5
Outliers
7, 15
Quartile deviation (Q3 − Q1)/2
3.5
Quartile coefficient (Q3 − Q1)/(Q3 + Q1)
0.0886076
Count n
10
Box plot (whiskers stop at the last value inside the fences)
1020304050Q1 36Q3 43median 40.5
Histogram of the data
0247 – 15.4: 2215.4 – 23.8: 023.8 – 32.2: 032.2 – 40.6: 3340.6 – 49: 55715.423.832.240.649
Five-number summary
StatisticValue
Minimum7
Q136
Median40.5
Q343
Maximum49
Show step-by-step solution
  1. Sorted data: 7, 15, 36, 39, 40, 41, 42, 43, 47, 49.
  2. Method: median of halves (exclude the median).
  3. Q1 = 36, median Q2 = 40.5, Q3 = 43.
  4. IQR = Q3 − Q1 = 43 − 36 = 7.
  5. Fences: 36 − 1.5 × 7 = 25.5 and 43 + 1.5 × 7 = 53.5. 2 value(s) fall outside.
Q125th percentile
Q2Median
Q375th percentile
IQRQ3 − Q1

What Is Median and Quartile?

Quartiles split sorted data into four groups with equal counts. Q1 is the 25th percentile, the median Q2 is the 50th and Q3 is the 75th. The interquartile range IQR = Q3 − Q1 measures the spread of the middle half of the data.

Textbooks and software compute quartiles in slightly different ways, so you can choose the exclusive or inclusive median-of-halves method, or the interpolation methods used by Excel (QUARTILE.INC and QUARTILE.EXC) and NumPy. The calculator also finds the 1.5 × IQR outlier fences, the range, the quartile deviation and the quartile coefficient.

The article below covers the formulas, variables, a worked example with outliers and answers to common questions about why different tools give different quartiles.

How to Use the Median and Quartile Calculator

  1. Paste or type your data separated by commas, spaces or new lines.
  2. Pick the quartile method your course or software uses.
  3. Read Q1, the median, Q3, IQR and the outlier fences.
  4. Check the box plot for outliers and skew.

Median and Quartile Formula

Interquartile range

IQR=Q3−Q1IQR=Q_3-Q_1

Outlier fences

Lower=Q1−1.5 IQR,Upper=Q3+1.5 IQR\text{Lower}=Q_1-1.5\,IQR,\quad \text{Upper}=Q_3+1.5\,IQR

Interpolated quartile (Excel INC)

x(h),;h=1+p(n−1)x_{(h)},; h=1+p(n-1)

Median and Quartile Variables Explained

SymbolMeaningNotes
Q1First quartile25th percentile
Q2Median50th percentile
Q3Third quartile75th percentile
IQRInterquartile rangeQ3 − Q1
FencesOutlier boundariesQ1 − 1.5 IQR and Q3 + 1.5 IQR

Median and Quartile Worked Example

Take 7, 15, 36, 39, 40, 41, 42, 43, 47, 49 (n = 10). The median is (40 + 41) ÷ 2 = 40.5. The lower half is 7, 15, 36, 39, 40, so Q1 = 36. The upper half is 41, 42, 43, 47, 49, so Q3 = 43. IQR = 43 − 36 = 7. The fences are 36 − 10.5 = 25.5 and 43 + 10.5 = 53.5, so 7 and 15 are outliers.

With the example values loaded in the calculator above, the steps are:

  1. Sorted data: 7, 15, 36, 39, 40, 41, 42, 43, 47, 49.
  2. Method: median of halves (exclude the median).
  3. Q1 = 36, median Q2 = 40.5, Q3 = 43.
  4. IQR = Q3 − Q1 = 43 − 36 = 7.
  5. Fences: 36 − 1.5 × 7 = 25.5 and 43 + 1.5 × 7 = 53.5. 2 value(s) fall outside.

Result: First quartile Q1 = 36; Median Q2 = 40.5; Third quartile Q3 = 43; Interquartile range IQR = 7.

Where Median and Quartile Is Used

Box plots

Getting the five numbers needed to draw one.

Outlier detection

Flagging values outside the 1.5 × IQR fences.

Skewed data

Describing spread with the median and IQR instead of the mean and SD.

Exam questions

Checking quartile answers with the method your course uses.

Common Median and Quartile Mistakes to Avoid

  • Always sort the data first.
  • State the method when you report quartiles.
  • The IQR is resistant to outliers, unlike the range and standard deviation.

Median and Quartile Terms and Definitions

Quartile
One of three cut points that divide sorted data into four equal-count groups.
Five-number summary
Minimum, Q1, median, Q3 and maximum.
Fence
The 1.5 × IQR boundary beyond which values are flagged as outliers.

Median and Quartile FAQs

How do you find Q1 and Q3?

Sort the data, find the median, then take the median of the lower half (Q1) and of the upper half (Q3).

Why do different tools give different quartiles?

There are several accepted definitions that treat the middle value and interpolation differently.

What is the IQR used for?

It measures the spread of the middle 50% of the data and defines the outlier fences.

How do I find outliers with the IQR?

Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are flagged as outliers.

Related calculators

Last updated 2026-11-09. See our disclaimer.