zerouploads

Sort Lines of Text

Put a list in order: A to Z, by length, by number or shuffled. Drop the blank lines and the repeats while you are there.

  • Preview
  • Unlimited
  • No signup
  • Private
  • Works offline

Put a list of lines in order

one item per line

9 lines inspaces ignored

Sorted

amsterdam Berlin Berlin copenhagen Dublin Edinburgh file10.txt file2.txt

8 lines outascending

How to sort
What to ignore and what to drop
9 in · 8 out · 1 blank removed

How it works

  1. 01

    Paste the list

    One item per line. The tool drops blank lines unless you tell it to keep them.

  2. 02

    Pick an order

    A to Z, numbers in order, by length, reversed or shuffled.

  3. 03

    Copy it back

    Copy the sorted list, or save it as a .txt file.

How the sorting works

The order comes from your browser's own language rules, not from a plain A to Z list of letters. That is why café lands next to cafe. Émile lands with the E names too, rather than at the end with the odd characters.

Plain A to Z reads a number one character at a time, so file10 comes before file2. Natural order reads a run of digits as one number, so file2 comes first. Pick it whenever your lines end in a number.

By length puts the shortest line first. Two lines of the same length fall back to A to Z, so the same list always comes out the same way.

Orders
A to Z, natural with numbers in order, by length, reversed, and shuffled.
Cleaning
Drop blank lines, drop repeats, and ignore the spaces at either end.
Language
Your browser's own rules, so accented letters sort where a reader expects them.
Output
Copy the list, or save it as a plain .txt file.

Blank lines, repeats and spaces

The tool drops blank lines by default, because a list pasted out of a spreadsheet is full of them. Turn that off and it keeps them and sorts them with everything else.

Removing repeats keeps the first of each line and drops the rest. Case matters only if you say so. Leave it off and Apple and apple count as the same line. The tool ignores the spaces at the start and end of a line when it compares, and keeps them in what you copy back.

Shuffle puts the lines in a random order and holds that order while you type. Press Shuffle again for a new one.

Frequently asked questions

Is my list uploaded to sort it?
No. Your browser sorts it in this tab. Nothing is sent anywhere, so there is nothing to delete afterwards and no daily limit.
Why does file10 come before file2?
Plain A to Z reads a number one character at a time, and 1 comes before 2. Switch the order to natural and a run of digits counts as one number.
Does it treat Apple and apple as the same line?
By default, yes. Turn on case sensitive and they become two different lines, both when sorting and when removing repeats.
Are my blank lines kept?
Only if you ask. The tool drops them by default, because a list pasted from a spreadsheet usually has a gap after every block.
Can I sort in reverse?
Yes, in two ways. Turn on descending to sort Z to A. Or pick reverse to turn the list you pasted upside down without sorting it at all.
How long a list can I paste?
There is no fixed cap. The work happens in the page, so the limit is the memory your browser has spare.
Browse all text tools