Number Sorter
This number sorter puts a pasted list in ascending or descending order by value, so 10 comes after 9, and it names any entry that is not a number instead of dropping it.
Sorted by exact value. Numbers are never converted to floating point, so 9007199254740993 sorts after 9007199254740992. Each entry can have up to 200 characters and an exponent up to 10,000; anything beyond that is reported.
Paste numbers to sort them.
Why use this number sorter
Sorts by value
Ten comes after nine, and 1.25 comes before 1.5, because each entry is read as a number and not as text.
Names what it could not read
A bad entry is listed by its position in the list, and the numbers around it are still sorted.
Keeps your formatting
The output uses your original text for each number, so 007 stays 007 and 3.50 stays 3.50.
What the number sorter does
Paste numbers, choose smallest first or largest first, and the sorted list appears as you type. Entries can be separated by line breaks, spaces, tabs, commas or semicolons. Auto reads any mix of them. Choose one separator, or type your own, when your data needs it.
The sort is by numeric value, not by letters. A text sort puts 10 before 9 because the character 1 comes before 9. The Natural number order option on the alphabetical order tool compares digit groups inside text and does not compare decimals, so use this page when the values are plain numbers.
The options
- OrderSmallest first, or largest first. Equal values keep the order you gave them in both directions.
- SeparatorAuto, line break, comma, space, semicolon, tab or a custom separator of up to 10 characters. Empty items between separators are skipped and counted.
- Remove duplicate valuesKeeps the first of each value, so 1.5 and 1.50 count as the same number and the first spelling stays.
- Output separatorLine break, comma and space, space, or the same separator you pasted. Mixed separators fall back to a line break.
- Negatives and exponentsA minus sign sorts below zero, so -5 comes first. An entry such as 1e3 is read as 1000, and -0 equals 0.
- Entries that are not numbersA word such as abc, or a shape such as 2.5.1, is left out of the result and listed with its position, for example item 2: abc. The position counts non-empty entries, so you can find it in your source.
- A worked examplePaste 10 9 -5 3 1.5 1.25 2 2. Smallest first gives -5, 1.25, 1.5, 2, 2, 3, 9, 10. With Remove duplicate values on, the second 2 is dropped and you get -5, 1.25, 1.5, 2, 3, 9, 10. Largest first gives 10, 9, 3, 2, 2, 1.5, 1.25, -5.
Common Use Cases
Test data
Put a column of expected values in order before you compare it with program output.
Homework
Order a list of integers, decimals or negatives and check your own answer.
Cleaning exports
A stray word in a pasted column is reported by position, so you can find it in the source.
Comparing sets
Sort two lists the same way, then read them side by side or in a diff.
How to sort numbers
Paste
Paste your numbers into the box.
Choose an order
Pick smallest first or largest first.
Remove duplicates if needed
Turn on Remove duplicate values if you want each value once.
Copy
Copy the sorted list or download it as a text file.
Why this page is easy to rely on
No account
Nothing to sign up for, and no limit on how often you sort.
Printed rules
The parsing rules are on the page, so the result is predictable.
Stable order
Equal values stay in the order you gave them.
Tips
- •Thousands separators A comma separates numbers here, so 1,000 is read as 1 and 000 in Auto. Remove the commas first, or set Separator to Line break to see the entry reported.
- •Big numbers Values are compared digit by digit, never as floating point, so 9007199254740993 sorts after 9007199254740992. Entries over 200 characters, or with an exponent beyond 10,000, are reported.
- •Text lists To order words, use the alphabetical order tool. To order lines by how long they are, use sort lines by length.
Sort a list now
Paste a list and sort it in one step.
Need only the numbers from a messy paragraph? Use extract numbers first.
Related tools
Frequently Asked Questions
How do I arrange numbers in ascending order?
Paste the numbers and keep Smallest first selected. For 10 9 -5 3 1.5 1.25 2 2 the result is -5, 1.25, 1.5, 2, 2, 3, 9, 10.
Why does a text sort put 10 before 9?
A text sort compares one character at a time, and 1 comes before 9. This page reads each entry as a number, so 9 comes before 10.
How are decimal commas handled?
They are not. A comma separates numbers, so Auto reads 3,5 as 3 and 5. Write the decimal point as a dot.
What happens to blank lines?
They are skipped, and the status line says how many empty items were skipped.
Is there a limit?
Yes. The text can hold up to 100,000 characters, counted as code points. Past that, nothing is sorted and the page says how long the text is.