Alphabetical Order Tool
Paste any list and sort it A-Z, Z-A, naturally (item2 before item10), by length, or shuffle — all in your browser.
Paste a list above and choose a sort order.
Every line is blank — nothing to sort.
Sorting a list without opening a spreadsheet
Alphabetizing a list by hand is slow and error-prone the moment it grows past a dozen items — a spreadsheet's sort button works, but pasting into one just to reorder a few lines is overkill. This tool takes whatever you paste, one item per line, and reorders it instantly: alphabetically forwards or backwards, numerically-aware ("natural" order), by line length, shuffled at random, or simply reversed — all inside the browser tab, with nothing uploaded.
How each sort order works
- A → Z / Z → A compares lines using
localeCompare, which orders accented letters and non-Latin scripts the way a human reader expects rather than by raw character code. - Natural order reads runs of digits as numbers instead of comparing them character by character, so
item2sorts beforeitem10— plain alphabetical order gets this backwards. - By length sorts shortest line first, with ties broken alphabetically so the order stays stable and predictable.
- Random shuffle uses a Fisher-Yates shuffle, giving every line an equal chance to land in any position — useful for randomizing raffle entries or a name-picking order.
- Reverse current order simply flips whatever order the lines are pasted in, without re-sorting them — handy for undoing a previous reverse or reading a log bottom-up.
Example — natural vs. plain order. Input: file1, file2, file10, file20. Plain A → Z gives file1, file10, file2, file20 because "1" sorts before "2" as a character. Natural order gives the expected file1, file2, file10, file20.
Example — title sort. Input: The Great Gatsby, A Tale of Two Cities, An American Tragedy, Moby Dick. With "Ignore leading a / an / the" on, the list sorts as a librarian would file it: An American Tragedy, The Great Gatsby, Moby Dick, A Tale of Two Cities — grouped by Gatsby, American, Moby and Tale.
Case sensitivity and why it matters
With Case-sensitive off, "apple", "Apple" and "APPLE" compare as equal, which is what most people expect from an alphabetize tool. Turning it on switches to strict comparison, which is useful when a list mixes constants like API_KEY and api_key and you need them to land in a predictable, distinct order rather than being treated as duplicates for sorting purposes.
| Use case | Recommended sort order |
|---|---|
| Names or a word list | A → Z, case-insensitive |
| File names like img2.png, img10.png | Natural order |
| Book, movie or song titles | A → Z + Ignore leading a/an/the |
| Picking a random order for a raffle | Random shuffle |
| Flipping an already-sorted list | Reverse current order |
Practical notes
Blank lines are removed before sorting by default (toggle this off to keep them), and duplicate lines are always preserved — this tool reorders, it does not deduplicate. Your last pasted list and chosen options are remembered in this browser's local storage so they're there next time you return; nothing is ever sent to a server.
Sources & further reading
- Unicode Technical Standard #10 — the Unicode Collation Algorithm behind language-aware alphabetical order
- MDN Web Docs: Intl.Collator — locale-aware string comparison, case sensitivity and numeric (natural) sorting
- W3C Internationalization — guidance on sorting and comparing text across languages and scripts
Frequently asked questions
What is natural sort order, and how is it different from plain alphabetical order?
Plain alphabetical sorting compares text character by character, so "item10" comes before "item2" because the character "1" is smaller than "2". Natural order instead reads consecutive digits as one number, so item2 correctly sorts before item10. For the list item1, item2, item10, item20, plain A → Z gives item1, item10, item2, item20, while Natural order gives item1, item2, item10, item20. This makes Natural order the right choice for file names, chapter numbers, versions, and any list mixing text with numbers.
How does "Ignore leading a / an / the" sort book and movie titles?
Libraries and media catalogs traditionally sort titles by their first meaningful word, ignoring a leading "A", "An" or "The" used only for display. Turn the option on and the comparison key drops that leading article — your original title is never changed, only how it is ordered. For example "The Great Gatsby", "A Tale of Two Cities", "An American Tragedy" and "Moby Dick" sort as An American Tragedy, The Great Gatsby, Moby Dick, A Tale of Two Cities — grouped by Gatsby, American, Moby and Tale rather than by A, An and The.
Does case sensitivity change the sort order?
With Case-sensitive off (the default) this alphabetize tool compares letters ignoring upper and lower case, so "apple", "Apple" and "APPLE" are treated as equal and stay in the order they appear for tie-breaking. Turn Case-sensitive on to use strict, locale-aware comparison, which in most languages sorts a lowercase letter and its uppercase form next to each other rather than grouping all-uppercase words separately. Either way sorting uses localeCompare, so accented letters and non-Latin scripts sort in a linguistically sensible order rather than by raw character codes.
Is my list uploaded anywhere, and is there a size limit?
No. Every sort runs entirely in your browser with plain JavaScript — nothing you paste is uploaded, logged, or sent to a server. Your last list and chosen options are optionally kept in this browser's local storage only, so they're still there next time you open the tool; clearing your browser data removes them. There's no hard line limit, but extremely large pastes (tens of thousands of lines) may feel sluggish since sorting happens on your own device.
What happens to blank lines and duplicate entries?
"Remove blank lines" is on by default and filters out any line that is empty or contains only spaces before sorting, so they don't cluster at the top or bottom of your result. Turn it off to keep every blank line exactly where it falls. Duplicate entries are never merged or removed — if "apple" appears three times in your list, it appears three times in the sorted result, in its correct alphabetical position.