Life Calculator
MAKE THE FORMULA CLEAR

Median, quartiles and percentiles

Paste a set of numbers to find its median, quartiles or a chosen percentile using linear interpolation.

Start with your own numbers

Editable example

An example is filled in. Replace it with your own data to calculate.

Paste numbers in one unit, then choose a position: 50 for the median, 25 for Q1 or 75 for Q3. Commas separate values, not thousands; enter 1000 rather than 1,000.

For example, 10, 20, 40, 80. Separate 1–200 values with commas, semicolons, spaces or new lines. Keep repeated values, negatives and zero; no sorting is needed. Use one unit.
Enter 0–100: 50 for the median or 25 for Q1. Positions 0 and 100 give the minimum and maximum. Do not enter a rank or an exam score.

Results update when inputs are complete. A plan is kept only when you save it. Inputs and results are not uploaded.

Saved plans →

Saved in this browser. Before changing devices, export a backup from My tools.

Example result

Value at the chosen percentile

30

The answer is a data value at the chosen position, not a rank or score percentage. Linear interpolation can produce a number absent from your list. Different quartile definitions can give different answers. Display uses up to 12 significant digits; your original inputs are kept.

Chosen position (%)50
First quartile Q1 (25%)17.5
Median Q2 (50%)30
Third quartile Q3 (75%)50
Interquartile range IQR32.5
Number of data points4 records
Minimum value10
Maximum value80

Worked steps

  1. 10, 20, 40, 80
  2. h = 1 + (4 − 1) × 50 ÷ 100 = 2.5
  3. Q(50%) ≈ 30

Sort the values and find h=1+(n−1)×p/100. Interpolate between neighboring positions using R’s default type 7. Q1, Q2 and Q3 use 25%, 50% and 75%; IQR=Q3−Q1. Keep repeated values, negatives and zero, in the same unit. Quartiles have multiple definitions. This is not the median-of-halves method. A percentile value is not percentile rank, an exam score or the exact share above a threshold. Interpolation may return a value absent from your data. Missing values and outliers are not silently removed; no unseen population is inferred.

Method and scope

Sort the values and find h=1+(n−1)×p/100. Interpolate between neighboring positions using R’s default type 7. Q1, Q2 and Q3 use 25%, 50% and 75%; IQR=Q3−Q1. Keep repeated values, negatives and zero, in the same unit.

Quartiles have multiple definitions. This is not the median-of-halves method. A percentile value is not percentile rank, an exam score or the exact share above a threshold. Interpolation may return a value absent from your data. Missing values and outliers are not silently removed; no unseen population is inferred.

References:Official R documentation: sample quantiles and type 7 interpolation

What this helps you do

Sort a set of observations conceptually to find its middle and dividing values. The median is the 50% position; Q1 and Q3 are 25% and 75%. This page also supports a custom percentile so you do not need separate calculators.

What to enter

Paste 1–200 numbers measured in the same unit, keeping repeated values. Commas, semicolons, spaces or new lines separate observations. Consecutive commas indicate a missing value that must be corrected. Commas are not thousands separators: enter 1000, not 1,000. The position is 0–100, default 50.

How it is calculated

For n sorted values and position p%, use h=1+(n−1)×p/100. A fractional h is linearly interpolated between the neighboring observations. This is R’s default type 7 definition, not a unique definition shared by all textbooks.

Worked example

Synthetic example: for 10, 20, 40, 80, the 25% position is 1.75. Move 75% of the way from 10 to 20 to get 17.5. The median is 30, Q3 is 50, and IQR is 50−17.5=32.5.

Understanding the answer

The main answer is the data value at your chosen percentile. Q1, median, Q3 and IQR summarize the distribution. IQR is Q3 minus Q1, not a mean or each observation’s gap. Interpolated answers need not appear in the original list.

Scope and limitations

Quartile definitions differ; a textbook that splits the list into halves may give another answer. This page is not percentile rank, the percentage of people you beat, or the exact proportion meeting a threshold. Save the original inputs and position for later use. Use standard deviation for spread or weighted mean for supplied weights. No missing values or outliers are automatically removed, and no unseen population is inferred.

Keep it handy for next time

Add Median, quartiles and percentiles to your home screen

This icon opens this tool. Confirm installation in your browser.

  1. iPhone: Open in Safari, tap Share → Add to Home Screen, then confirm.
  2. Android: Open in Chrome and choose Install app or Add to Home screen from the menu.
  3. In an in-app browser such as LINE or Facebook, use its menu to open the page in Safari or Chrome first.

Browser options vary. A shortcut does not provide cross-device synchronization, and an installed app may have separate storage. Export a backup from My tools first. The first load requires a connection.

Checking offline data.