How to Sort Text Lines Online (A-Z, Numbers and More)

How to Sort Text Lines Online (A-Z, Numbers and More)

November 2, 2026

A list of names pasted from three different emails never comes in a useful order. Neither does a glossary you built over a year, or a column of invoice numbers copied out of a PDF. You can sort it by hand, or you can paste it into a tool and be done in ten seconds.

The free Toolysite Text Sorter treats every line as one item and rearranges them: A to Z, Z to A, numeric, by length, reversed or shuffled. I ran a handful of small lists through every mode on 2 November 2026 and wrote down what came out, because a few results surprised me.

How to sort a list in the Text Sorter

  1. Open the Text Sorter and paste your list into the Input box, one item per line. You can also use the "Open .txt file" button.
  2. Pick an order from the Sort menu. The options are A to Z, Z to A, Numeric (low to high), Numeric (high to low), Length (short to long), Length (long to short), Reverse order and Shuffle randomly.
  3. Tick "Ignore case" or "Drop empty lines" if you need them.
  4. The Result box fills in as you go. Press Copy, or use Download .txt.

There is no Sort button to hunt for. Changing the menu changes the result straight away, which makes it easy to flip between orders and compare.

What the tests showed

Here is the list I used for the alphabetical tests, one item per line, including one blank line:

banana
Apple
cherry
apple
Banana

Éclair
zebra
SettingsResult, top to bottom
A to Z, nothing ticked(blank), apple, Apple, banana, Banana, cherry, Éclair, zebra
A to Z, Ignore case(blank), Apple, apple, banana, Banana, cherry, Éclair, zebra
A to Z, Ignore case + Drop empty linesApple, apple, banana, Banana, cherry, Éclair, zebra

Three things stand out. First, the empty line floats to the top unless you drop it, so if your result starts with a mysterious gap, that is why. Second, the accented "Éclair" landed between "cherry" and "zebra", where a person would expect it, rather than being thrown to the very end the way a plain character-code sort would do. Third, "Ignore case" did not change the main order at all in this list. It only changed which of the tied pair, "apple" and "Apple", came first: with the box ticked they stayed in the order I typed them, without it the lowercase one went first. If you were expecting capitals to jump ahead of lowercase letters in the default mode, they do not.

Sorting numbers, and the 9 versus 10 problem

The classic complaint about sorting lists in text editors is that "10" comes before "9", because the first character is compared first. I tested this directly, and the result is better than I expected.

InputModeResult
item 10, item 9, item 1, item 2A to Zitem 1, item 2, item 9, item 10
item 10, item 9, item 1, item 2Z to Aitem 10, item 9, item 2, item 1
v1.10, v1.2, v1.9A to Zv1.2, v1.9, v1.10
10, 9, 100, 2, 1.5, -3, 007Numeric (low to high)-3, 1.5, 2, 007, 9, 10, 100
10, 9, 100, 2Numeric (high to low)100, 10, 9, 2

So even plain A to Z understood the numbers inside "item 10". This is usually called natural sorting: digits inside text are compared as numbers, not character by character. That is handy for product codes, chapter names and file names, but it also means a version list like v1.10 comes after v1.9, which is what people usually want and not what a strict dictionary would do. Negative numbers, decimals and a leading-zero value like 007 all sorted by their value in numeric mode.

Mixed lines are where numeric mode needs a little care. I fed it "item 10, item 9, 12 apples, 3 pears, fig". In numeric mode, lines that start with a number are sorted by that leading number (3 pears, then 12 apples), and the lines with no leading number stay together after them in their original relative order. That is sensible, but "item 10" and "item 9" did not get sorted among themselves. For a list like that, use A to Z instead.

Sort by length, reverse or shuffle

Length mode sorts by the number of characters. With "pear, fig, banana, kiwi, plum" the short-to-long result was fig, pear, kiwi, plum, banana. Notice that pear, kiwi and plum all have four letters and came out in the order I typed them, so ties are not scrambled. Long to short gave banana, pear, kiwi, plum, fig. I use this one to find the longest line in a pasted list, for example the longest product title before it gets cut off in a search result.

Reverse order simply flips the list: one, three, two, four became four, two, three, one. It does not sort anything. It is useful when a log or a changelog was pasted newest-last and you want newest-first.

Shuffle is genuinely random. Two runs on the same six letters gave e, d, c, f, a, b the first time and a, e, b, f, d, c the second. Good for picking a speaking order or mixing quiz questions.

Tips and limits

  • Trailing spaces count. In a small test, "apple", "Apple" and "apple " (with a space at the end) came out as apple, Apple, "apple ". The invisible space pushed that line to the end. If your list looks slightly out of order for no reason, run it through the Whitespace Cleaner first.
  • Sorting does not remove duplicates. If the same name appears three times, it will appear three times next to each other. Use Remove Duplicate Lines afterwards, or read our guide on removing duplicate lines without losing order.
  • Windows line endings are fine. A test list with CRLF line breaks sorted correctly.
  • One item per line. A comma-separated list is a single line to the tool, so it comes back unchanged. Put each item on its own row first.
  • Capital letters are your call. If you want one consistent style afterwards, the Case Converter will do it.

These tests used short lists in one browser, so treat the examples as what the tool did on that day rather than a promise about every language and every edge case. For non-English alphabets, check a few lines of your own list before relying on the order.

Frequently asked questions

How do I sort lines alphabetically online?

Paste the lines into the Input box, leave the Sort menu on A to Z, and copy the Result. Tick Drop empty lines if blank rows are in the way.

Does Ignore case change the order?

In our test it only decided which of two matching words came first, such as apple and Apple. The other words stayed where they were.

Does it sort numbers in the correct numerical order?

Yes. In our tests both A to Z and the numeric modes placed 9 before 10, including in text like "item 9" and "v1.9".

Can I sort a list by line length?

Yes. Choose Length (short to long) or Length (long to short). Lines with equal length keep the order you typed.

Can I get the sorted list as a file?

Yes, use the Download .txt button under the Result box, or press Copy and paste it where you need it.

If your list also needs tidying first, try the Whitespace Cleaner, then sort, then check the first and last few lines by eye. It takes ten seconds.