What this calculator does
Sorting a handful of numbers by hand is easy to get wrong once the list gets past six or seven values, especially with negative numbers, decimals or duplicates mixed in. This tool takes a pasted list and puts it in order from smallest to largest, and largest to smallest, without changing any of the values themselves.
It is a plain sorting utility rather than a statistics calculator: it does not compute an average, a median or a spread, it only reorders the numbers you give it. For summary statistics on the same list, a dedicated statistics calculator is the better tool.
The formula
Every number in the list is compared against every other and arranged in ascending order, then the same list reversed gives the descending order. Duplicate values are kept and simply placed next to each other.
| Term | Meaning |
|---|---|
| Ascending order | Ordered from smallest to largest. |
| Descending order | Ordered from largest to smallest. |
The inputs explained
| Field | What to enter |
|---|---|
| Numbers (comma or space separated) | Paste or type the numbers separated by commas, spaces or new lines. Negative numbers and decimals are both fine. |
When to use it
Checking a homework or worksheet answer
Pasting in a list of numbers and comparing the result against a hand-sorted answer is a quick way to check ordering exercises.
Sorting a small dataset before analysis
Some manual statistics methods, such as finding the median or quartiles, need the data sorted first; this gives that ordered list without opening a spreadsheet.
Putting scores or measurements in rank order
A quick list of results, times or measurements can be ranked from best to worst or smallest to largest in one step.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How a small list sorts smallest to largest
A few example lists showing the sorted result for different mixes of values.
| Numbers entered | Smallest to largest | Largest to smallest |
|---|---|---|
| 5, 2, 9, 1, 7, 3 | 1, 2, 3, 5, 7, 9 | 9, 7, 5, 3, 2, 1 |
| -4, 8, -1, 0, 6, -4 | -4, -4, -1, 0, 6, 8 | 8, 6, 0, -1, -4, -4 |
| 2.5, 1.1, 3.75, 0.2 | 0.2, 1.1, 2.5, 3.75 | 3.75, 2.5, 1.1, 0.2 |
| 10, 10, 5, 20, 5 | 5, 5, 10, 10, 20 | 20, 10, 10, 5, 5 |
Questions
Does the order of the numbers I type in matter?
No. The calculator re-sorts the list regardless of the order it was entered in, so numbers can be pasted in any order.
Can I sort negative numbers and decimals together?
Yes. The list is sorted by true numeric value, so negative numbers, decimals and whole numbers all sort correctly relative to each other.
What happens to duplicate numbers?
Duplicates are kept in the output and placed next to each other in the sorted order; nothing is removed.
What separators can I use between numbers?
Commas, spaces, semicolons and line breaks are all recognised, so a list can be pasted from most sources without reformatting it first.
For a fuller statistical summary of the same list, including the mean and median, see the descriptive statistics calculator.