Skip to content
CalculatorAtlas

Median Calculator

Tested

Median of a data set.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

The median is the middle value of sorted data, and the mean of the two middle values when n is even. For 4, 8, 15, 16, 23, 42 it is (15 + 16) ÷ 2 = 15.5.

Enter a list of numbers. The calculator returns the median.

Related tools: Mean Median Mode Calculator: Mean, median and mode of a data set. Mean Median Mode Range Calculator: Mean, median, mode and range of a data set. Standard Deviation Calculator: Sample or population standard deviation with variance and mean.

How to use the Median Calculator

  1. Type data set, for example 4, 8, 15, 16, 23, 42.
  2. Press Calculate to see the result, and use Reset to start again.
Inputs of the Median Calculator
InputWhat to enterAllowed values
Data setText, such as 4, 8, 15, 16, 23, 42—

Formula and method

Formula

middle value (mean of the two middle values for even n)

IEEE-754 double precision; shown to at most 6 decimal places.

Computed directly from the sorted or raw values.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Data set = 4, 8, 15, 16, 23, 42.

Results of example 1
ResultValue
Median15.5

Example 2

Inputs: Data set = 7 1 3.

Results of example 2
ResultValue
Median3

The first line is the headline result (median). IEEE-754 double precision; shown to at most 6 decimal places.

Robust to outliers

Changing 42 to 420 leaves the median at 15.5 but sends the mean from 18 to 81. That is why income and house prices are reported as medians.

Finding it

Sort the data, then take the value at position (n + 1) ÷ 2. For odd n it is a data value. At least one value is needed.

Even counts, duplicates and outliers

With six values the median is the mean of the two middle ones: for 4, 8, 15, 16, 23, 42 it is (15 + 16) ÷ 2 = 15.5, a number that is not itself in the data. Duplicates are kept, so a repeated value counts each time it appears.

The median ignores how far the extremes are. Replace 42 with 420 and the median stays 15.5, while the mean jumps from 18 to 81. That is why incomes and house prices are usually reported as medians.

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Data set: left empty shows "Enter data set." beside that field and no result.

Choosing between the Median Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Median Calculator and similar calculators
CalculatorYou enterIt returns
[Mean Median Mode Calculator](/statistics/mean-median-mode-calculator/)data setMean
[Mean Median Mode Range Calculator](/statistics/mean-median-mode-range-calculator/)data setMean
[Standard Deviation Calculator](/statistics/standard-deviation-calculator/)data set and data typePopulation standard deviation (σ)
[Z-Score Calculator](/statistics/z-score-calculator/)value, mean and standard deviationZ-score
[Relative Standard Deviation Calculator](/statistics/relative-standard-deviation-calculator/)data set and data typeRelative standard deviation

Background: descriptive statistics

Population statistics divide by n and sample statistics divide by n − 1 (Bessel's correction), because a sample tends to understate variability. Use the population version when your data is every value in the group, and the sample version when it is a subset.

Defaults differ between tools, and so do quartile conventions, which can give slightly different values for small data sets; this page states the method it uses.

Assumptions and limitations

  • At least one value

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for data set to confirm this.

Frequently asked questions

What is the median of 3, 1, 2?

Sorted, 3, 1, 2 becomes 1, 2, 3, so the median is 2.

Is the median the 50th percentile?

Yes. The median is the 50th percentile: half the values lie below it and half above.

What if there are duplicates?

They count separately.

Do I need to sort the numbers before entering them?

No. Enter the values in any order; the median is defined on the sorted list, and the calculator handles that step.

When should I use the median instead of the mean?

Use it when a few extreme values would drag the mean away from what is typical, such as salaries or property prices.

What does the Median Calculator calculate?

Median of a data set. It returns Median.

What formula does the Median Calculator use?

middle value (mean of the two middle values for even n). Computed directly from the sorted or raw values.

What is an example of a median result?

With data set 4, 8, 15, 16, 23, 42, the median is 15.5.

Sources

  • OpenStax, Introductory Statistics 2e (Rice University): measures of center and spread, correlation and regression
  • NIST/SEMATECH e-Handbook of Statistical Methods (nist.gov), Exploratory Data Analysis chapter

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.