Median and Mode Calculator

Use this median calculator and mode calculator to find the middle of a numerical data set and its most frequent repeated values. View the numeric sorting process, one-based middle positions and a complete frequency table. Odd and even sample sizes, multiple modes, negative values and no-repeat data are handled explicitly.

Method reviewed by the NumUtility editorial team · Updated October 25, 2026

Find the median and all modes

1–1,000 numbers, each from −1e12 to 1e12. Separate with spaces, commas, semicolons or new lines. Decimal point: dot; scientific notation accepted. No thousands separators, empty comma/semicolon items or ignored invalid values.
Median6Modes (tied)4, 6Count7

Sorting and median steps

Sorted from smallest to largest:

2, 4, 4, 6, 6, 9, 10

Middle position (counting from 1): 4. Median = 6.

Highest frequency: 2. Every value with that count is reported as a mode.

Show frequency table (5 distinct values)
Frequency of each entered numeric value
ValueCount
21
42
62
91
101

Descriptive calculations only. No weights, grouped intervals, missing-value imputation, normality check or confidence intervals. Double-precision arithmetic can round closely spaced values.

How to use this median and mode calculator

Enter 1–1,000 numbers separated by whitespace, commas, semicolons or new lines. Use a dot for decimals and no thousands separators. Signed numbers and scientific notation are accepted within ±1e12. Every item is validated; an invalid token or an empty comma/semicolon field stops the calculation instead of disappearing. The first result is the median, followed by every tied repeated mode and the observation count. Expand the frequency table to audit how often each value appears.

How the calculation works

A median is determined by position after numerical sorting, not by the order in which observations were entered. For the hypothetical list 11, 3, 7, 5, 9, sorting produces 3, 5, 7, 9, 11. Position three is the middle, so the median is 7. The output retains every observation, including repeated values, because removing duplicates would change the ranks and potentially change the answer. The frequency table summarizes repeats without replacing the original sorted list.

With an odd count n, the middle position is (n + 1) / 2 when positions start at one. With an even count, use positions n / 2 and n / 2 + 1, then average those two values. For 2, 4, 8, 10, the middle pair is 4 and 8 and the median is 6. That result does not need to appear in the original data. Numerical sorting also prevents the mistake of placing 10 before 2 as text sorting might do.

A mode concerns frequency rather than middle position. In 2, 4, 4, 6, 6, 9, 10, both 4 and 6 occur twice, while every other value occurs once. The calculator reports both modes, rather than choosing the smaller number or the first repeat encountered. The median of that list is 6, but its coincidence with one mode is not a rule. A middle value and a most frequent value answer different questions about the same observations.

When every observation occurs only once, this interface reports no mode. When several distinct values all repeat equally often, it lists all of them as tied modes under the highest-frequency convention and displays an explanatory note. For 1, 1, 2, 2, both 1 and 2 are reported. Some courses call that situation no distinguished mode. The visible frequency table allows either convention to be understood without hiding the raw counts or inventing a unique winner.

A single observation has that value as its median, but no repeated mode under the stated convention. For 7, 7, 7, the median and unique mode are both 7. Zero and negative values participate normally: sorting −8, −3, −3, 0 gives an even middle pair of −3 and −3. The resulting median is −3 and its mode is also −3. A valid zero is not treated as missing data, and an empty input is not converted into a zero-valued observation.

Repeats are identified after converting valid input tokens to JavaScript numbers. Consequently, 1, 1.0 and 1e0 identify the same numeric value. Decimal inputs that differ beyond double-precision resolution can also become indistinguishable. Do not interpret a frequency count as proof that high-precision laboratory measurements were exactly equal. The tool does not group nearby readings into intervals, apply a rounding tolerance or estimate the peak of a continuous probability density. Those are separate modeling choices.

Median and mode can be useful when the arithmetic mean is not the only relevant summary. Compare the illustrative lists 4, 5, 6 and 4, 5, 60. Their medians both remain 5, while their means differ substantially. That does not make the median universally better: a total budget divided across three equal shares still calls for a mean. Choose the statistic that matches the question, retain units and inspect the data rather than selecting whichever summary sounds more favorable.

This calculator handles raw numerical observations, not weighted records, grouped-class midpoints or text categories. A frequency table copied from another source must be expanded into observations within the limit before it matches this interface. Do not enter a label or a missing-value code as if it were a measurement. Data entry validation protects the arithmetic from malformed tokens, but it cannot establish that the original observations are representative, correctly measured or appropriate for a real-world decision.

Formulas

Odd observation count

median = x[(n + 1) / 2]; x[i] is the sorted value at one-based position i

Even observation count

median = (x[n/2] + x[n/2 + 1]) / 2; positions start at 1

Repeated modes

all values whose frequency equals the maximum frequency, when that maximum exceeds 1

Worked examples

Two modes and an odd median

Enter 9, 2, 4, 4, 6, 6, 10. Sorting gives 2, 4, 4, 6, 6, 9, 10. The fourth value is 6. The two modes are 4 and 6, each occurring twice.

Even count with no repeated values

For 2, 4, 8, 10, the median is (4 + 8) / 2 = 6. Every value occurs once, so the interface reports no mode rather than falsely selecting the median as the mode.

Common uses

Compare centers without hiding extremes

Review the median alongside an arithmetic mean when a few high or low readings shift the total. Keep the original observations and units visible so the reason for choosing one summary can be explained.

Audit repeated values

Use the frequency table to check repeated scores, numerical categories or recorded sizes. Multiple repeated winners are kept rather than selecting a single convenient answer.

Learn odd and even middle positions

Follow one-based sorted positions for coursework and check why an even-count median may not be an observation. Numeric sorting is shown explicitly rather than assumed.

Accuracy and limitations

Every token is validated before results are calculated. Values use JavaScript double precision, and equivalent numeric tokens share one frequency count. Distinct high-precision decimals may round to the same representable number.

No-repeat data is labeled no mode; uniformly repeated distinct values are all tied modes under this interface's convention. This tool does not estimate a continuous distribution's peak or accept weighted/grouped inputs.

Sources and methodology

These primary references explain the numerical methods and units used here. Review the calculation assumptions and limitations alongside the result.

Frequently asked questions

Can there be more than one mode?

Yes. Every repeated value tied for the highest frequency is returned. The frequency table shows why each qualifies.

What if all values repeat equally often?

All distinct values are returned as tied modes when their shared frequency exceeds one. A note explains that some courses instead call this no distinguished mode.

Does the median have to occur in the list?

No. With an even count, the average of the middle pair may be a value that was never entered.

Are invalid entries ignored?

No. Invalid items and empty comma/semicolon fields stop the calculation. Nothing is silently dropped from the list.

Can I enter decimals or negative numbers?

Yes. Use dot decimals, optional signs or scientific notation within the supported range. Commas separate observations, not thousands.

Are the input values stored?

No. The calculation runs in the browser without sending your numerical inputs to NumUtility.

Related calculators

Related guides