Number Sorter
Paste a list of numbers — one per line, or separated by commas, semicolons or spaces — and sort them in true numeric order, ascending or descending. Remove duplicates if you want each value once, and copy the result separated by new lines, commas or spaces. Free, no sign-up, and nothing is uploaded.
Sort order
Output separator
How to Use the Number Sorter
- Paste your numbers. Separate them with new lines, commas, semicolons or spaces, in any mix. Negative numbers and decimals are fine.
- Choose the order. Ascending runs from small to large; Descending runs from large to small.
- Set the output. Pick New line, Comma or Space as the separator for the sorted list, and tick Remove duplicates if each value should appear once.
- Click Sort Numbers and copy. The sorted list appears with cards for how many numbers it holds and its minimum and maximum.
Numeric Order Versus Alphabetical Order
Sorting numbers as if they were words gives the wrong answer, because text is compared one character at a time. In alphabetical order 100 comes before 2.5, since the character 1 sorts before 2, and 10 comes before 9. This tool converts every entry to a real number first, so 2.5 comes before 9, 9 before 10, and 10 before 100. If you sort a list of numbers with a line sorter and the order looks odd, this is why.
A Worked Example
Take this mixed list, which uses spaces and a semicolon, with repeated values:
Input
10 9 100 1 2.5 -3 -3 10; 8
| Settings | Numbers | Output (comma separator) |
|---|---|---|
| Ascending | 9 | -3, -3, 1, 2.5, 8, 9, 10, 10, 100 |
| Ascending, remove duplicates | 7 | -3, 1, 2.5, 8, 9, 10, 100 |
| Descending, remove duplicates | 7 | 100, 10, 9, 8, 2.5, 1, -3 |
In each case the Minimum card reads −3 and the Maximum card reads 100. The Numbers card counts what is in the output, so it falls from 9 to 7 when duplicates are removed. Two values count as the same if they are numerically equal, so 5, 5.0 and 5.00 collapse into one 5.
What Is Read as a Number
- Entries are split at whitespace, commas and semicolons. A number written with thousands commas and no spaces inside it, such as 1,000 or 12,345,678, stays whole. Any other comma separates, so 3,14 is read as 3 and 14, and 5,100 with no space is read as the single number 5100: put a space after the comma to keep two numbers apart.
- A semicolon switches the comma to a decimal mark. If the text contains any semicolon, only whitespace and semicolons separate entries and 2,5; 3,5 is read as 2.5 and 3.5. Without a semicolon, use a decimal point.
- Entries that are not numbers are skipped and listed. $5 and abc are left out of the sorted list, and a line under it names them (up to the first 20) so nothing disappears silently.
- Scientific and hexadecimal notation are accepted. 1e3 is read as 1000 and 0x10 as 16.
- Precision is limited. Numbers with more than about 15 significant digits lose their last digits.
Which Tool Do You Need?
| If you want… | Use |
|---|---|
| Numbers sorted by value | This page |
| Numbers found inside a paragraph first, with a sum and average | Number Extractor |
| Words, names or lines sorted A to Z, by length, or reversed | Sort Lines Alphabetically |
| Library of Congress or Dewey call numbers in shelf order | Call Number Sorter |
| Reference entries in alphabetical order for a style | Bibliography Alphabetizer |
| Random numbers in a range | Random Number Generator |
Frequently Asked Questions
- How do I sort numbers from smallest to largest?
- Paste the numbers, leave the order on Ascending and click Sort Numbers. The list comes back from the smallest value to the largest. Choose Descending for the reverse.
- Why does sorting numbers alphabetically give a wrong order?
- Alphabetical sorting compares characters, so 100 sorts before 20 because 1 comes before 2. A numeric sort compares values, which is what this tool does.
- Can it sort negative numbers and decimals?
- Yes. Negative numbers sort below zero in the right order, and decimals sort by value, so −3 comes before 1 and 2.5 comes before 8.
- How do I remove duplicate numbers from a list?
- Tick Remove duplicates before you sort. Values that are numerically equal are collapsed to one, so 5 and 5.0 count as the same number. Leave it unticked to keep every occurrence.
- Why did some of my entries disappear?
- Anything that is not a valid number, such as a currency symbol attached to a value or a word, is left out of the sorted list. A line under the output lists the skipped entries so you can fix them and sort again.
- Can I sort numbers that are in a sentence?
- Not directly. Extract them with the Number Extractor first, then paste the result here. This tool expects each number to stand on its own.
- Are my numbers sent to a server?
- No. Sorting happens in your browser and nothing is uploaded.