Alphabetical Sorter
Sort the lines of any list alphabetically, A-Z or Z-A.
How to Use the Alphabetical Sorter
Paste a list with one item per line, then click "Sort A-Z" or "Sort Z-A." With "Ignore case" checked (the default), sorting treats uppercase and lowercase letters the same, uncheck it for strict case-sensitive sorting where all uppercase letters sort before any lowercase ones. Use "Copy Text" to grab the sorted list to your clipboard.
Worked Example
The default list loaded in the box is banana, apple, cherry, date, in that order. Clicking "Sort A-Z" produces apple, banana, cherry, date. Clicking "Sort Z-A" instead produces date, cherry, banana, apple, the exact reverse. Both results match what's shown in the "Total Lines" counter (4) since sorting only reorders lines, it never adds or removes any.
How the Sort Works
The tool splits your text into lines, then compares every pair of lines using standard string comparison, essentially checking which line would come first in a dictionary. With "Ignore case" checked, both lines are temporarily lowercased before comparing, so "Apple" and "apple" are treated identically and end up next to each other based purely on spelling. With it unchecked, comparison uses each character's raw code point, and since every uppercase letter (A-Z) has a lower code than every lowercase letter (a-z) in standard character encoding, a case-sensitive sort pushes all-uppercase or capitalized entries ahead of lowercase ones as a group, regardless of what letter they start with. Sort Z-A works by running the same A-Z comparison and then simply reversing the final order.
Common Mistakes and Things to Know
The most common surprise is with numbers. This tool sorts everything as text, so "10", "2", and "9" sort as "10", "2", "9", because character-by-character comparison checks the first character ("1" vs "2" vs "9") before ever looking at a second digit. If you need true numeric order, this text sorter isn't the right tool, a spreadsheet program's number-aware sort would be more appropriate.
Another surprise is what happens to blank lines and lines with leading spaces. An empty line, and a line that starts with a space, both sort ahead of ordinary text in an A-Z sort, since whitespace characters have lower character codes than any letter. If your sorted list has unexpected blank lines at the top, this is why, and running the list through Remove Extra Spaces first can help normalize it.
Also remember that sorting doesn't deduplicate. If your original list had the same entry twice, both copies survive the sort and simply end up next to each other, since they compare as equal. Pair this tool with Remove Duplicate Lines if you want a clean, sorted, non-repeating list, either sort first and dedupe second, or the other way around, the end result is the same either way.
Real-World Use Cases
Organizing lists: alphabetizing a reading list, bibliography, glossary, contact list, or any other list-style content for easier scanning and lookup.
Preparing data for review: sorting a raw list export (like a CSV column pasted as plain text) alphabetically before visually scanning it for duplicates, typos, or formatting errors.
Content and SEO work: sorting a keyword list, tag list, or category list alphabetically for a cleaner, more organized presentation, often paired with this site's Remove Duplicate Lines and Keyword Extractor tools.
Word games and puzzles: generating a sorted word list for anagram solving, crossword construction, or vocabulary study, where having entries in alphabetical order makes cross-referencing much faster.
Frequently Asked Questions
How does "Ignore case" affect sorting?
With it checked, "apple" and "Apple" sort next to each other based on spelling alone. Unchecked, sorting is case-sensitive, and since uppercase letters have lower character codes than lowercase ones, every capitalized word would sort before any lowercase word.
Does this tool sort numbers correctly, or treat them as text?
Numbers are sorted as text by character, so "10" sorts before "9" alphabetically (comparing "1" vs "9" as characters). For a purely numeric list where true numeric order matters, this text-based sort isn't the right tool.
Can I sort a list of full names by last name instead of first name?
This tool sorts each line exactly as typed from left to right, so a list of "First Last" names sorts by first name by default. To sort by last name, rearrange each line to "Last, First" or "Last First" format before pasting it in, then the sort will naturally group entries by last name since that's now the first thing on each line.
Will sorting remove duplicate or blank lines?
No, this tool only reorders lines, it doesn't remove anything. Duplicate lines will end up next to each other after sorting (since identical text sorts to the same position), and blank lines are sorted too, typically ending up at the very top of an A-Z sort since an empty line has no characters to compare and sorts before any non-empty one. Use this site's Remove Duplicate Lines tool first if you also want duplicates cleaned up.
Is this the same kind of sorting a spreadsheet program uses?
It's similar but not identical. Spreadsheet programs like Excel and Google Sheets often apply locale-aware sorting that handles accented letters, numbers, and mixed content in a more human-intuitive way (sometimes called "natural sort"). This tool uses JavaScript's standard character-code-based string comparison, which is fast and predictable but purely mechanical, it won't automatically detect that a column contains numbers and sort them numerically, or group accented letters next to their unaccented equivalents the way some spreadsheet locale settings do.
Where do lines starting with numbers or punctuation end up in the sorted list?
It depends on the specific character. Common punctuation marks and digits generally sort ahead of letters in standard character-code order, so a list mixing entries like "#tag", "3rd item", and "Apple" will typically place the symbol-led and number-led entries near the top of an A-Z sort, ahead of the alphabetic ones. Exact placement depends on each character's specific code point, so if precise ordering of mixed symbol/number/letter content matters, it's worth spot-checking the result against your expectations.