Text tool
Alphabetical Order Tool
Sort any list of words, names, or lines from A to Z or Z to A. Everything happens in this page — your list is never sent anywhere.
Your list
The custom separator is used exactly as typed, so a dot or a pipe is treated as a literal character.
Ready when you are.
Sorted result
Nothing to show yet. Enter a list on the left and it will appear here.
How to sort a list alphabetically
1. Paste your list
One item per line is the usual format, but a comma, a semicolon, a space or a tab works too. Choose whichever your list already uses rather than retyping it.
2. Pick the order
A to Z is the default. Switch to Z to A to reverse it. The list re-sorts as you type, so you can watch the result change.
3. Copy or download
Copy the result to paste straight into a document, or download it as a text file. Either way it leaves your machine only when you choose to share it.
What the options do
Each one changes how the list is read, and none of them change the words themselves.
- Case sensitive — off by default, so apple and Apple sort next to each other. Turning it on treats them as different, and a capital letter sorts ahead of a lower case one when two items are otherwise the same word.
- Remove duplicates — drops repeated items and tells you how many went. A duplicate is judged the same way as the case option: with case sensitivity off, Apple and apple count as the same word. The first occurrence is the one kept.
- Trim spaces around items — on by default, so a stray leading space cannot push one item ahead of another.
- Remove empty items — on by default, so blank lines at the end of a paste do not become blank entries.
- Natural number order — on by default, which is what puts file2 before file10. Turn it off for a strict character comparison, where 10 comes before 2.
- Ignore a leading article — files The Anchors under A. Only a genuine leading word is removed, so Andromeda is left alone.
- Sort by last word — for name lists. It handles both conventions: in Ada Smith the surname is the last word, and in Smith, Ada it is the part before the comma.
How the comparison actually works
Sorting uses your browser’s built-in text comparison rather than a list of letter values, which is why accented words land in the right place. éclair sorts next to eat and egg, not after z, and words sort the way a dictionary orders them rather than by their character codes. That also means the result follows the language settings of your own browser, so a list of names in your language sorts correctly without this page needing to know which language you are using.
Where it cannot help
This tool sorts one flat list. It has no way of knowing that two differently spelled items are the same person, so Smith, Ada and Ada Smith are treated as two separate entries unless you ask it to ignore case and remove duplicates. It also cannot read a table. If your list is in a spreadsheet, sort it in the spreadsheet, which already knows the column you meant.
Questions about sorting alphabetically
How do I put a list in alphabetical order?
Paste your list with one item per line and it sorts A to Z immediately. If your list is separated by commas instead, change Split on to Comma and it will be read that way.
Does it handle numbers in the list?
Yes. With natural order on, which is the default, chapter2 sorts before chapter10 because 2 really is before 10. Turn that option off if you want a strict character comparison, where 10 comes before 2.
Why is my list not sorting the way I expected?
Three things cause this most often. A leading space can affect the order, so leave Trim spaces on. Accents and local letters follow your browser’s language settings, so a list in a language other than English may be ordered by that language’s rules. And if you turned on Ignore a leading article, items beginning with A, An or The are filed under the next word instead.
Is my text stored or sent anywhere?
No. The whole sort happens in this page, on your machine. Nothing is uploaded, nothing is saved, and reloading the page clears it. There is no account to create because there is nothing kept to sign in to.
How do I sort a list of names by surname?
Turn on Sort by last word. It understands both Ada Smith, where the surname is the last word, and Smith, Ada, where it is before the comma, so a list in either style files by family name.
Can I sort a very long list?
Yes. A list of a hundred thousand lines is sorted on the spot without the page becoming unresponsive. If you are pasting from a very long document, the browser may take a moment to bring the text in before sorting starts.
When a list will not sort the way you expect
Sorting is a character comparison, so a character you cannot see can change the order. A non-breaking space, a zero-width space or a soft hyphen inside a name makes it sort as though it began with something else. If a list looks right and sorts wrong, run it through the invisible character cleaner first and sort the cleaned version.
Further reading: Read the full guide: Alphabetical Order Tool
