Line Sorter
Put any list in order: alphabetical, by length, by leading number, reversed or shuffled at random.
Sorting a list
- Paste one item per line: names, URLs, keywords, file names or numbers all behave the same way.
- Pick a sort order. A to Z and Z to A are alphabetical, shortest and longest sort by line length, the number options sort by the number at the start of a line, and shuffle puts the lines in random order.
- Use the checkboxes to ignore capitalisation, sort numbers properly, remove duplicates or drop empty lines. The result is updated immediately.
- Copy the result or download it. If you chose shuffle and want another order, press Shuffle again.
How to sort a list alphabetically online
Paste the list, leave the order on A to Z and the sorted version is ready. It is useful when you are tidying a bibliography, a list of names, a glossary, tags, a to-do list or a column of data that has not been sorted yet. Switch to Z to A for the reverse.
By default the sort ignores capitalisation, so “banana” sits between “apple” and “cherry” even when it starts with a capital B. Strict computer sorting puts all capital letters before all lowercase letters, which almost never matches what people expect, so untick Ignore case only if you really want that behaviour. Accented letters are sorted using the rules of your browser’s language, so “école” lands next to “ecole” rather than at the end of the list.
Sorting numbers: why 10 comes before 2 in some tools
If a list is sorted as plain text, “10” comes before “2” because the character “1” sorts before “2”. It is correct for a computer and wrong for a person. That is why Natural number order is on by default: it compares the numbers inside text by their value, so “item 2” comes before “item 10” and “file9” before “file10”.
There are also two number-only orders, low to high and high to low. They sort by the number at the start of each line, including decimals and negative numbers. Lines that do not start with a number are put at the end so they do not get lost.
| Input | Alphabetical (natural) | Numbers, low to high |
|---|---|---|
| 10 apples 2 pears 33 plums 1 fig | 1 fig 2 pears 10 apples 33 plums | 1 fig 2 pears 10 apples 33 plums |
Sort lines by length, or reverse and shuffle them
Shortest first and longest first put lines in order of character count. This is handy for finding the longest title in a list that has to fit a limit, spotting very short entries that look like mistakes, or arranging text lines from short to long for design.
Reverse current order flips the list without any sorting. If the last line should be the first, it does that with no other changes, which is useful for logs and timelines that are in the wrong direction.
Shuffle randomly puts the lines in random order. It is a quick way to pick a random name from a list, decide who presents first, create a randomised quiz or reorder a playlist. The shuffle uses a standard fair method, so every order is equally likely. It is fine for everyday use, but do not rely on it for anything where security or money is involved.
Sort and remove duplicates in one step
Sorting and deduplicating usually go together. Duplicates end up next to each other after sorting, which makes them easy to see, and the Remove duplicates option removes them in the same pass. This gives you a clean, ordered, unique list of keywords, emails or names from several combined sources.
If you only want to know what is repeated, or you need to keep the original order, use the remove duplicate lines tool, which has dedicated modes for that.
Real-world uses
- Alphabetising a reference list, glossary or index.
- Sorting a list of URLs or domains before auditing a site.
- Putting keyword research exports in order before removing close variants.
- Ordering version numbers or numbered files so they run naturally.
- Randomising a list of names for raffles, teams or speaking order.
- Putting CSS properties or config keys in order so differences are easier to spot with the text compare tool.
Sorting questions
How do I sort a list of names alphabetically?
Paste the names with one per line and keep the A to Z order. The sorted list appears immediately, and you can copy it or download it.
Why is my number list sorted incorrectly, like 1, 10, 2?
That happens in strict text sorting. Keep Natural number order ticked, or use the number sort orders, so that numbers are compared by value instead.
Does sorting ignore uppercase and lowercase?
Yes by default. Untick Ignore case if you prefer capital letters to be sorted separately from lowercase ones.
Can I sort by line length?
Yes. Choose shortest first or longest first. Lines of equal length keep their original relative order.
How do I randomise the order of a list?
Choose Shuffle randomly, and press Shuffle again for a new order each time.
What happens to blank lines?
They are removed by default so they do not clump at the top of the list. Untick Remove empty lines to keep them.
More ways to work with a list
Sorted lists often have duplicates sitting side by side, so remove duplicate lines is a natural next step. Add line numbers to make a ranked list, flip the order with the text reverser, or compare two sorted lists in text compare to see what differs.