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.

  • 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. That is why café lands next to cafe, and Émile lands with the other E names instead of at the end of the list.

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 Natural 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 when Case sensitive is on. 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 order.

Frequently asked questions

Is my list uploaded to sort it?
No. Your browser sorts it in this tab. The page sends nothing 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. Set 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 turn off Remove blank lines. It is on by default, because a list pasted from a spreadsheet often has gaps in it.
Can I sort in reverse?
Yes, in two ways. Turn on Descending to sort Z to A. Or pick Reverse the current order to turn your list upside down without sorting it.
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 free.
Browse all text tools