Format Code Now
/

Number Sorter

TX-07

Paste numbers separated by spaces, commas, semicolons, pipes or line breaks and sort them smallest first or largest first. Each number keeps its exact original text.

Runs in your browser. Nothing is uploaded.

Numbers (separated by spaces, commas, semicolons, pipes or line breaks)

Sorted numbers

How to use it

  1. Paste your numbers into the input box in any mix of separators.
  2. Choose Smallest first or Largest first.
  3. Tick Remove duplicates if equal values should appear once, and Skip items that are not numbers if the list has stray words.
  4. Pick how the sorted list is separated, then read it in the output box.
  5. Copy the result or download it as a text file.

Exact values, original text

Numbers are compared digit by digit as written, without turning them into floating point numbers. That keeps long IDs in order: 12345678901234567890 sorts before 12345678901234567891, which a sort that first converts them to ordinary floating point numbers would treat as equal. 2.50 and 2.5 count as the same value. Each number is printed in the text you typed, so 007 stays 007 and +5 keeps its plus sign.

Separators and what counts as a number

Numbers can be split by spaces, line breaks, commas, semicolons or pipes. Because a comma always splits, 1,000 is read as 1 and 000, so remove thousands separators first. Signs, decimal points and exponents such as 1e3 are understood. Dates, currency symbols and a decimal comma such as 2,5 are not. Without the Skip option, an item that is not a number gives an error that names it.

Ties and duplicates

The sort is stable: values that are equal keep the order they had in your list. With Remove duplicates ticked, the first of each group of equal values is kept, so 2.50 survives and a later 2.5 is dropped. Without it, every item stays in the output.

Error messages and what to do

MessageWhat it meansFix
"abc" is not a number.An item in the list is not a number.Remove it, or tick Skip items that are not numbers.
No numbers found.Skip items that are not numbers was ticked, but nothing in the text is a number.Check the input, or untick the option to see which item fails.
The exponent in "1e99999999999" is too large. The limit is 1000000000.The exponent is bigger than the page will compare.Use a smaller exponent or write the number out in full.

Questions people ask

How do I sort numbers in descending order?

Choose Largest first in the Order menu and the output lists the biggest number first. Paste your list with any mix of spaces, commas and line breaks.

Does it sort numbers or text?

Numbers. 10 comes after 9, which a plain text sort would reverse. Each item is compared by its value, and the text of each item is kept exactly as you typed it.

How do I remove duplicates from a list of numbers?

Tick Remove duplicates. Items with the same value count as one, even when written differently, so 2.5 and 2.50 are duplicates. The first one in your list is the one kept.

Can it sort very large numbers without rounding?

Yes. Values are compared from their digits, so numbers with 20, 50 or more digits stay in the right order. It does not convert them to ordinary floating point numbers.

How does it handle negative numbers and decimals?

Negatives sort below zero, and -10 comes before -2. Decimals are compared by value, so 2.5 sorts between 2 and 3. Exponents such as 1e3 are read as 1000.

Why was 1,000 split into two numbers?

Commas separate items, so 1,000 becomes 1 and 000. Remove the thousands commas before pasting, or use spaces or line breaks to separate your numbers.

About this tool

Splits the text on spaces, line breaks, commas, semicolons and pipes, so a comma always separates two numbers and 1,000 is read as 1 and 000. Values are compared exactly as written, without converting to floating point, so 12345678901234567890 and 12345678901234567891 stay in the right order and 2.50 equals 2.5. Signs, decimals and exponents (1e3) are understood. Each number is printed with its original text, for example 007 stays 007. The sort is stable, so equal values keep their input order. Dates, currency symbols, thousands separators and locale decimal commas are not understood; an item that is not a number gives an error unless you tick Skip.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.