Sort a List of Numbers Into Numerical Order
Spreadsheets and text editors sort text alphabetically, which puts 10 before 2 because "1" comes before "2" as a character. This tool sorts by value instead, so a pasted column of numbers comes back in the order you actually meant. It runs entirely in your browser.
How do I enter my numbers?
One number per line. Blank lines are ignored and spaces around a number are trimmed, so
you can paste a column straight out of a spreadsheet without cleaning it up first.
Commas and spaces within a line are not treated as separators — a line
reading 5, 3, 10, 1 is one entry, not four. If your numbers are
comma-separated on a single line, put each on its own line first.
Are my numbers reformatted?
No. Each line is printed back exactly as you typed it, only in a different order. A value
written 007 sorts in the position of 7 but still displays as
007, and a very long number such as an ID keeps every digit rather than
being rounded — which matters, because JavaScript loses precision on integers
beyond about 16 digits, and this tool never rewrites the text.
What number formats are understood?
Plain integers and decimals, negative numbers, a leading +, scientific
notation such as 1e3 (one thousand), hexadecimal such as 0x10
(sixteen), and Infinity. Values are compared by what they mean, so
1e3 correctly sorts after 50 even though it looks shorter.
What if a line is not a number?
It is kept, not discarded — nothing you paste is thrown away. A line that cannot be
read as a number has no position on the number line, so it cannot be compared with
anything and simply stays roughly where you put it while the real numbers sort around
it. Currency symbols and percent signs make a line non-numeric, so $5 and
5% will not sort; strip the symbols first if you need those in order.
Related tools
To sort words rather than numbers, use Sort Words Alphabetically. To strip repeated entries from a list before sorting, try the Duplicate Line Remover, and to write a figure out in words afterwards, see the Number to Words Converter.
Last reviewed: August 2026