Sort Lines
Sort any list of lines alphabetically or in other orders, with language-aware sorting for accented letters.
About Sort Lines
Sort Lines puts a list into order, one line per item. Beyond plain A to Z and Z to A, it offers natural order for names that contain numbers, shortest-first order, a simple reversal of the current order, and a random shuffle. Sorting follows language rules rather than raw character codes, so accented letters sit next to their plain forms instead of after Z.
It helps when you tidy a glossary, a list of file names, a reading list, a set of country or product names, or when you need to draw names in a fair random order.
When to use it
- File or chapter names such as
file2andfile10come out in the wrong order in other tools. - You want a word list sorted by length, for example to find the shortest options for a headline.
- You need to flip a list that is currently newest-first.
- You want to shuffle participants or questions into a random order.
Worked example
Paste these lines: file10.txt, file2.txt, File1.txt, école, zebra, Apple, an empty line, and file1.txt.
- A → Z gives
Apple,école,File1.txt,file1.txt,file10.txt,file2.txt,zebra. - Natural gives
Apple,école,File1.txt,file1.txt,file2.txt,file10.txt,zebra. - Shortest first gives
Apple,école,zebra, then the four file names.
In each case the empty line is removed and the note reads “7 lines sorted”.
Good to know
- With Case-sensitive off, upper and lower case and accents are treated as equal. Lines that tie keep their original order, which is why
File1.txtstays ahead offile1.txt. - With Case-sensitive on, lower case sorts just before upper case of the same letter:
a,A,b,B. - Number-aware comparison is used only by Natural. Z → A uses plain alphabetical order, so
file2comes beforefile10there. - Shortest first breaks ties alphabetically.
- Reverse and Random shuffle also respect “Remove empty lines”. The shuffle uses your browser’s secure random generator.
- Duplicates are kept. Use Remove Duplicate Lines first if you want each item only once.
How to use Sort Lines
- Paste your lines.
- Choose the order and options.
- Select Sort lines and copy the result.
Privacy: how it works
Everything happens in your browser. Your text is not sent to any server.
Frequently asked questions
What is natural sorting?
It compares numbers by value, so "file2" comes before "file10" instead of after it.
How random is the shuffle?
It uses a cryptographically secure random generator with an unbiased Fisher-Yates shuffle.