Number Sorter | Sort & Statistics
Sort a list of numbers in ascending or descending order. Find min, max, sum, and average.
What Is the Number Sorter | Sort & Statistics?
This number sorter sorts any list of numbers ascending or descending and immediately computes 13 descriptive statistics, mean, median, mode, standard deviation, variance, quartiles (Q1, Q3), IQR, range, sum, min, and max. It also generates a five-number summary (box plot data) for quick distribution analysis.
- ›13 statistics at once: a full descriptive statistical profile in one click.
- ›Five-number summary: min, Q1, median, Q3, max, the data needed for a box plot.
- ›Remove duplicates option: deduplicate the sorted output while keeping statistics based on the original data.
- ›Mode detection: finds all modes (up to 3 shown), handles both unimodal and multimodal datasets.
- ›Flexible input: paste numbers separated by commas, spaces, semicolons, pipes, tabs, or newlines.
- ›Up to 10,000 numbers: handles large datasets quickly.
Formula
| Statistic | Formula | Meaning |
|---|---|---|
| Mean (μ) | Σxᵢ / n | Arithmetic average, balancing point of the dataset |
| Median | Middle value when sorted | Robust central tendency, unaffected by outliers |
| Mode | Most frequent value(s) | Peak of the frequency distribution |
| Std Dev (σ) | √(Σ(xᵢ−μ)²/n) | Average distance from the mean (population std dev) |
| Variance (σ²) | Σ(xᵢ−μ)²/n | Mean squared deviation from the mean |
| Q1 | 25th percentile | Lower quartile, median of the lower half |
| Q3 | 75th percentile | Upper quartile, median of the upper half |
| IQR | Q3 − Q1 | Interquartile range, spread of the middle 50% |
How to Use
- 1Paste or type your numbers into the text area. Any separator works: commas, spaces, semicolons, or newlines.
- 2Choose Ascending or Descending sort order.
- 3Optionally check "Remove duplicates" to deduplicate the output.
- 4Click "Sort Numbers" to generate the sorted list and all statistics.
- 5Click Copy to copy the sorted list to your clipboard.
- 6Review the statistics grid and five-number summary below the sorted output.
- 7Click Clear to reset everything and start with new data.
Example Calculation
Example dataset
Population vs sample standard deviation
Understanding Number Sorter | Sort & Statistics
Why Sort Numbers?
Sorting is one of the most fundamental operations in data analysis. A sorted list makes it trivial to find the minimum, maximum, and median, values that would otherwise require a full pass through the data. Sorting also reveals patterns: clustering, gaps, outliers, and the overall shape of the distribution become immediately visible. In many algorithms (binary search, merge, deduplication), data must be sorted first as a preprocessing step.
Mean, Median, Mode, Which to Use?
These three measures of central tendency describe the "typical" value in different ways, and the right choice depends on the data and context:
- ›Mean: best for symmetric distributions without outliers. Affected by extreme values.
- ›Median: best when the data is skewed or has outliers. Income data is a classic example, a few billionaires skew the mean but not the median.
- ›Mode: best for categorical data or when the most common value matters (shoe sizes, survey responses).
- ›Bimodal distributions (two peaks): neither mean nor median captures the pattern, both modes matter.
For income statistics, governments report median household income rather than mean, because the mean is pulled upward by a small number of very high earners, giving a misleading picture of typical earnings. Always check if the mean and median are close; large differences indicate a skewed distribution.
Standard Deviation and the 68-95-99.7 Rule
Standard deviation (σ) measures the average spread of values around the mean. For normally distributed data, the empirical rule states: 68% of values fall within 1σ of the mean, 95% within 2σ, and 99.7% within 3σ. A value more than 3σ from the mean is unusual enough to investigate as a potential outlier or data error.
- ›Small σ: data clustered tightly around the mean (consistent, predictable).
- ›Large σ: data spread widely (high variability).
- ›σ = 0: all values are identical.
- ›Coefficient of variation (CV) = σ/μ: normalises σ to compare spread across datasets with different means.
Quartiles, IQR, and Outlier Detection
Quartiles divide the sorted data into four equal quarters. Q1 (25th percentile) and Q3 (75th percentile) define the interquartile range IQR = Q3 − Q1, which describes the spread of the middle 50% of the data. The IQR is more robust to outliers than standard deviation and is the basis of the box plot, a standard visualization in statistics.
Tukey's fence method for outlier detection: values below Q1 − 1.5×IQR or above Q3 + 1.5×IQR are potential outliers (mild fences); below Q1 − 3×IQR or above Q3 + 3×IQR are extreme outliers. This method is used by default in most statistical software box plots.
Frequently Asked Questions
What separators can I use when entering numbers?
This sorter accepts numbers separated by any combination of:
- ›Commas: 1, 2, 3, 4, 5
- ›Spaces: 1 2 3 4 5
- ›Newlines (one per line)
- ›Semicolons: 1;2;3;4;5
- ›Pipe characters: 1|2|3|4|5
- ›Tabs (from spreadsheet paste)
You can paste directly from Excel, Google Sheets, or a CSV file and the parser will handle the mixed separators correctly. Blank lines and extra whitespace are ignored.
What is the difference between mean and median?
Mean is the arithmetic average: sum of all values divided by count. Median is the middle value when sorted, half the values are above it, half below.
The outlier (100) dramatically inflates the mean but doesn't affect the median. This is why median is preferred for skewed data like income, housing prices, and reaction times.
What are quartiles and how are they calculated?
Quartiles divide sorted data into four equal parts:
- ›Q1 (25th percentile): 25% of values are below this point
- ›Q2 (50th percentile) = Median: 50% below
- ›Q3 (75th percentile): 75% of values are below this point
- ›IQR = Q3 − Q1: the range containing the middle 50% of values
This calculator uses linear interpolation between adjacent values for non-integer quartile positions, the same method used by most statistical software (R's type 7, Excel's QUARTILE.INC).
What is the IQR and how is it used to detect outliers?
The Interquartile Range (IQR = Q3 − Q1) measures the spread of the middle 50% of the data. It is robust to outliers because it ignores the top and bottom 25%.
Tukey's outlier rule: any value below Q1 − 1.5×IQR or above Q3 + 1.5×IQR is flagged as a potential outlier. For example, if Q1=10, Q3=20, IQR=10: values below 10−15=−5 or above 20+15=35 are outliers.
What is the five-number summary?
The five-number summary consists of: Minimum, Q1, Median, Q3, Maximum. These five values completely describe the distribution and are the data points used to draw a box plot (box-and-whisker chart).
- ›Min and Max: the extremes of the data range
- ›Q1 and Q3: the edges of the box (the middle 50%)
- ›Median: the line inside the box
- ›Whiskers: usually extend to min/max (or 1.5×IQR from Q1/Q3)
What is standard deviation and how do I interpret it?
Standard deviation (σ) measures how spread out values are around the mean. A small σ means values cluster close to the mean; a large σ means they are widely dispersed.
For roughly bell-shaped (normal) distributions, the empirical 68-95-99.7 rule applies: about 68% of values lie within 1σ of the mean, 95% within 2σ, and 99.7% within 3σ. Values beyond 3σ are rare enough (~0.3%) to be considered potential outliers or measurement errors.
Can this sorter handle decimal numbers and negative numbers?
Yes, full support for:
- ›Decimal numbers: 3.14, −2.71, 0.001
- ›Negative numbers: −100, −0.5, −999
- ›Scientific notation: 1e6 = 1,000,000 (recognized as a valid number)
- ›Very large and very small values within JavaScript number precision (up to ~15 significant digits)
Invalid entries (letters, empty fields, non-numeric text) are detected and listed in the error message so you can find and fix them before sorting.