StatGardenREF. DESK
Calculators/Maths/Sort Numbers Calculator
Maths

Sort Numbers Calculator

Puts a list of numbers in order from smallest to largest, or largest to smallest.

Published 1 September 2026

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

FormulaSorts the entered values by numeric value

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.

TermMeaning
Ascending orderOrdered from smallest to largest.
Descending orderOrdered from largest to smallest.

The inputs explained

FieldWhat 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.

Example lists of six numbers
Numbers enteredSmallest to largestLargest to smallest
5, 2, 9, 1, 7, 31, 2, 3, 5, 7, 99, 7, 5, 3, 2, 1
-4, 8, -1, 0, 6, -4-4, -4, -1, 0, 6, 88, 6, 0, -1, -4, -4
2.5, 1.1, 3.75, 0.20.2, 1.1, 2.5, 3.753.75, 2.5, 1.1, 0.2
10, 10, 5, 20, 55, 5, 10, 10, 2020, 10, 10, 5, 5
Negative numbers sort correctly below zero, decimals sort by their true value rather than as text, and duplicate values such as the repeated 5 and 10 are kept and placed together.

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.