Sort Lines
Put any list in order in a second: names, words, products, tags or file names. Sort alphabetically, in reverse, by length or by the last word (handy for surnames), with numbers sorted the natural way, or shuffle the list randomly.
How to Sort Lines of Text
Quick answer: paste one item per line, choose A → Z, Z → A or Shuffle and what to sort by; the sorted list appears straight away.
-
1
Paste your list
One item per line.
-
2
Choose the order
A–Z, Z–A or shuffle.
-
3
Choose what to sort by
Whole line, length or last word.
-
4
Copy or download
Use the sorted list anywhere.
What You Get
Sorting Made Simple
Sorting a list by hand is slow and easy to get wrong, and spreadsheets are overkill for a quick list of names or words. Paste your list with one item on each line and it is sorted instantly. The sorting understands accented letters and different alphabets, so "Émile" sits with the other E names instead of at the end.
Sorting Options Explained
A → Z and Z → A sort alphabetically. Length sorts from the shortest line to the longest, useful for finding short codes or long titles. Last word sorts by the final word on each line, perfect for lists of full names sorted by surname.
Natural number order sorts "Item 2" before "Item 10", the way people expect, instead of the computer order where 10 comes first. Case-sensitive keeps capitals and small letters apart. Shuffle mixes the lines randomly, which is handy for quiz questions, team orders and draws.
Work With Your Lists
Remove repeated entries with Remove Duplicate Lines, number the final list with the Numbered List Maker, or add bullets with the Bulleted List Maker. Press Use as input to carry the sorted list straight into the next step.
Example
You have a list of 40 guests written as "first name last name". Choose A → Z and Last word, and the list is sorted by surname in a second: Adams, Brown, Chen, and so on, ready to print as a seating list.
Who Sorts Lines?
Teachers alphabetising class lists, event organisers sorting guest lists, writers ordering glossaries and indexes, developers sorting imports, dependencies and configuration keys, shop owners organising product lists, and anyone tidying a list of tags, keywords or file names. Shuffling is popular for quizzes, presentations, raffles and choosing the order of speakers or teams fairly.
Tips for Sorting
Remove empty lines and extra spaces first so they do not end up at the top of the sorted list. To sort and remove repeats, run Remove Duplicate Lines after sorting. For names written as "Surname, First name", sort by whole line; for "First name Surname", sort by last word. Each shuffle gives a new random order, so press a setting again to reshuffle.
Good to Know
Alphabetical sorting uses the rules of your browser's language, so accented letters sit next to their plain versions and different alphabets are ordered correctly. Without case-sensitive sorting, capital and small letters are treated as equal; with it, capitals come first when two lines are otherwise the same. Lines that are exactly equal keep their original order relative to each other. Sorting by length counts characters, including spaces, and lines of the same length are then ordered alphabetically, so the result is always predictable.
The tool handles very long lists, including tens of thousands of lines, in well under a second.
Private, Free and Instant
The tool is free and sorts lists with hundreds of thousands of lines. There is no sign-up, no limit and no watermark. The conversion runs entirely inside your browser, so your text is never uploaded, stored or shared, which makes the tool safe for emails, contracts, student work and anything confidential. It works the same on Windows, Mac, Linux, Chromebooks, iPhone and Android, and the result updates instantly as you type or paste. You can also open a text file from your device and download the converted text as a new .txt file.
Sorting Lines of Text: Alphabetical, Numeric and Reverse
Sorting lines puts a list in order so you can find items, spot duplicates and compare lists.
Sort types
- Alphabetical: A to Z, and Z to A for reverse.
- Numeric: treats numbers as numbers, so 10 comes after 9 rather than after 1.
- By length: shortest or longest first.
Tips
Decide whether upper and lower case should be treated the same. Remove blank lines and repeats first with remove duplicate lines.
Frequently Asked Questions
Questions about sorting lines