Number Sorter

Sort a list of numbers from smallest to largest or largest to smallest in one step. This free number sorter pulls every number out of the text you paste, handles decimals and negatives, and runs in your browser, so your figures are never uploaded.

Number SorterPrivate · runs on your device
Input
Words 0Characters 0Lines 0
Sorted numbers

Example: 42, 7, 19, -3 → -3, 7, 19, 42

How to use the number sorter

Sorting numbers should not need a spreadsheet. Paste, choose a direction and copy.

  1. Paste your numbers into the Input box, separated by new lines, spaces, or a comma followed by a space.
  2. Choose the Order: Ascending for smallest first or Descending for largest first.
  3. Choose the Output separator: Comma, New line or Space.
  4. Tick Remove duplicates if each value should appear only once.
  5. Read the result in the Sorted numbers box, then press Copy or Download .txt.

For example, 42, 7, 19, -3 in ascending order becomes -3, 7, 19, 42. The list 10 2 33 -4.5 0.25 in descending order with the New line separator gives 33, 10, 2, 0.25 and -4.5, one per line.

The Output separator decides where the result goes next. Comma suits a formula, an array in code or a tag field, New line suits a spreadsheet column, and Space suits a sentence or a command line. The output is rebuilt from the sorted values every time, so changing the separator or the order never needs a fresh paste.

How numbers are read from your text

Text sorting puts 10 before 2, because the character 1 comes before 2. This tool compares real values instead. It scans the text for numbers, each made of an optional minus sign, digits, an optional decimal part and an optional exponent such as e6, and it ignores everything else. Nothing warns you about skipped text, so check the result has the count you expect.

Each number is converted to a value, so the original formatting is not kept: 7.50 becomes 7.5 and 007 becomes 7. Two awkward habits of the pattern are worth knowing.

You pasteIt is read as
$12.5012.5, the symbol is ignored
3,53.5, a comma between digits is a decimal comma
1,0001, not one thousand
42,7,1942.7 and 19
2024-01-152024, -1 and -15
.55

So put each number on its own line, or put a space after every comma, and strip thousands separators first. Whole numbers beyond about 9 quadrillion lose precision, so 12345678901234567890 comes out as 12345678901234567000. Duplicates are matched by value, so 7 and 7.0 count as the same number.

Because the tool looks for numbers anywhere in the text, it is forgiving about units and labels. A list such as 12 kg, 3 kg, 45 kg sorts as 3, 12, 45, with the unit dropped. That convenience cuts both ways: digits inside words are picked up too, so item7 contributes a 7, and a line such as Room 4B contributes a 4. Keep the pasted text to numbers when you need every item accounted for, and compare the count of results with the count of items you pasted.

When to use it and what to use instead

Sorting is often the first step before a calculation. Once a list is in order, the smallest and largest values sit at the two ends and the middle entry is the median. Take six test scores, 72, 85, 85, 91, 60, 78. Ascending order gives 60, 72, 78, 85, 85, 91, and ticking Remove duplicates drops the second 85. With six values there is no single middle entry, so the median is the mean of the two central ones, 78 and 85, which is 81.5. If you want those figures worked out for you, paste the same list into the average calculator, which also gives the mean, mode, range and quartiles.

  • Students and teachers. Order a data set before finding the median, or rank test scores.
  • Finance and admin. Arrange invoice amounts or balances pasted from an email.
  • Developers and analysts. Inspect IDs or log values without opening a spreadsheet.
  • Sports and games. Rank times, scores or lottery numbers.

It is the wrong tool for dates, times and version numbers. A version such as 1.10 is read as 1.1 and sorts before 1.9, so sort version strings with the alphabetical order tool and its natural number order. To remove thousands separators, use the find and replace tool. To practise with random figures, try the random number generator.

Quick answers

Frequently asked questions

The questions people ask most, answered in plain words.

How do I sort numbers from least to greatest online?

Paste the numbers into the Input box, one per line or with a space after each comma, and leave Order on Ascending. The list is sorted from smallest to largest at once. Choose Descending for greatest to least, then copy the result or download it.

Does the number sorter handle negative numbers and decimals?

Yes. Negatives such as -3, decimals such as 0.25 and exponent forms such as 1e6 are read as real values and land in the correct place. The output shows the value, not your original formatting, so 7.50 comes back as 7.5.

Why does a spreadsheet sort 10 before 2?

The column is being treated as text, so the comparison looks at the first character and 1 comes before 2. This tool compares numeric values, so 2 comes before 10. In a spreadsheet, convert the cells to numbers to get the same behaviour.

Can I sort numbers that use commas as thousands separators?

Not directly. The tool reads a comma between digits as a decimal comma, so 1,000 becomes 1 and 2,500 becomes 2.5. Remove the thousands separators first with the find and replace tool, or type each number without them, then sort as usual.

Is there a limit on how many numbers I can sort?

There is no fixed limit. The sorting runs in your browser and copes with tens of thousands of values. Numbers beyond about 9 quadrillion lose precision, and a very long result is easier to take with Download .txt than with Copy.