Median Calculator — Find Median, Quartiles & Data Range
Find the median, quartiles and range of a data set.
Last updated · View algorithm, constants and default inputs (JSON)
Numbers (separated by comma, semicolon or space)
About this calculator
The median is the middle value once the data is sorted, which makes it far more resistant to outliers than the mean. Housing prices and incomes are almost always reported as medians for exactly this reason.
Worked example
calculated with the default values below
Numbers (separated by comma, semicolon or space) 12, 7, 3, 19, 25, 8, 15 Median 12 · First quartile 7.5 · Third quartile 17 · Interquartile range 9.5 · Range 22
General background references
Disclaimer
These calculators give general mathematical results. They suit study, planning and estimation — verify anything that feeds a graded submission, a published figure or a financial commitment.
Implementation source
This record describes the implementation used by this page. It is not independent validation. External references, when available, support only the stated formula or definition; estimates and custom rules retain their own assumptions.
Formula and variables
Q(p) = x[⌊k⌋] + (x[⌈k⌉] − x[⌊k⌋])(k − ⌊k⌋), k = (n − 1)p; median = Q(0.5)
- Q(p)
- quantile at probability p
- median
- Q(0.5)
- x
- sorted values
- n
- value count
- p
- probability 0–1
- k
- position index, 0-based
Uses linear interpolation at positions (n−1)p for Q1, median and Q3. Empty fields, non-finite numbers and lists above 10,000 values are rejected.
Frequently asked questions
How are the quartiles calculated?
The values are sorted and quartiles use linear interpolation at positions (n−1)×0.25 and (n−1)×0.75. Other conventions, such as the median-of-halves method, can give different quartiles for the same short list.