Line Sorter
Sort lines alphabetically, by length, reverse order, or shuffle randomly.
Sort Order
Sort lines of text in one click
This line sorter puts a list of lines in order. You can sort alphabetically (A to Z or Z to A), by length, reverse the order or shuffle the lines at random. It can also remove empty lines and duplicates at the same time.
How to use it
- Paste your list into Input Lines, one item per line.
- Choose a Sort Order.
- Tick the options you want: Case-insensitive, Remove empty lines or Remove duplicates.
- Click Sort Lines, then click Copy to copy the result.
Sort modes
| Mode | What it does |
|---|---|
| A → Z | Alphabetical order, using your browser's locale rules |
| Z → A | Reverse alphabetical order |
| Shortest First | Lines with fewer characters come first |
| Longest First | Lines with more characters come first |
| Reverse Order | Flips the list, so the last line becomes the first |
| Random Shuffle | Mixes the lines with a Fisher–Yates shuffle |
How it works
The text is split into lines at each line break. If you chose to remove empty lines, lines that are blank or only contain spaces are dropped first. Then the lines are sorted. Duplicates are removed last, and the first copy of each line is kept. With Case-insensitive on (the default), "Apple" and "apple" sort together and count as the same line for duplicates.
After sorting, three counters show the number of input lines, output lines and removed lines.
Tips
- Lines with the same length keep their original order in Shortest First and Longest First.
- Spaces at the start or end of a line count as characters and affect sorting.
- Run Random Shuffle again to get a different order.
Frequently asked questions
How do I sort lines alphabetically?
Paste your list, pick A → Z and click Sort Lines. Leave Case-insensitive on if you want capital and small letters treated the same.
Can it remove duplicate lines?
Yes. Tick Remove duplicates before you sort. Only the first copy of each line is kept, and the removed count is shown below the result.
Is my text uploaded?
No. Sorting runs in your browser. Your list is not sent to a server.
Related Text Tools
Browse all tools from the same category.
Word Counter
Words, characters, sentences, and paragraphs
Open toolText Case Converter
Upper, lower, title, and sentence case
Open toolShowing 1-2 of 27