Alphabetical Order Sorter
Paste a list, a paragraph, or any block of text. Sort the lines A to Z or Z to A in one click. Pick how you want case and duplicates handled, then copy the result or download it as a .txt file.
How to sort a list alphabetically
1. Paste your list
Drop the items you want to sort into the input box. One item per line is the cleanest format and is what most people paste in: a class roster, a grocery list, a name list, song titles, file names, header rows from a spreadsheet, even a quick-and-dirty paragraph. You can also paste a paragraph with line breaks already in it, or a comma-separated list (in which case switch to Sort by words in the sidebar).
2. Pick the sort direction
The default is A to Z (ascending), which is what people usually mean by "alphabetical order". Pick Z to A (descending) if you want the reverse: useful for things like leaderboards, reverse-chronological labels, or any time you want the last alphabetical entry on top.
3. Choose the sort granularity
The sorter has three modes. Lines treats every newline as a separator and is the default. Words splits on whitespace and sorts every word individually (useful for sorting tags, short tokens, or a comma-and-space list pasted as one block). Paragraphs splits on blank lines and keeps multi-line entries together (handy for sorting blog drafts, address blocks, or anything where each "item" is itself several lines).
4. Tune the options
Ignore case is on by default, so apple and Apple are treated as the same letter for ordering. Turn it off and uppercase letters sort before lowercase (because ASCII puts capitals first). Drop duplicates removes repeated entries. Natural sort handles embedded numbers the way humans expect: item-2 comes before item-10 instead of after it. Skip blank lines and Trim spaces clean up the input as it goes through.
5. Copy, download, or keep editing
The sorted result appears in the output box live as you type. Click Copy to grab it for pasting elsewhere, click Download .txt to save it as a file, or just keep editing the input. The output re-sorts every time you change a setting.
When you need an alphabetical order sorter
Sorting a list alphabetically is one of those everyday jobs that comes up across very different workflows. Below are the cases where the sorter pays for itself, with the settings that usually fit.
Class rosters and attendance lists
Teachers, instructors, and group leaders often start with names typed in the order they signed up. Paste the roster in, keep mode on Lines, leave Ignore case on, and you have an A-Z list to print or paste into a gradebook. Turn on Drop duplicates to catch anyone who got typed twice.
Inventory and catalog work
Product names, SKUs, file names, song titles: any catalog you have to scan visually is easier alphabetical. If the SKUs include numbers (PROD-2, PROD-10, PROD-100), turn on Natural sort so they line up the way a person reads them.
Bibliography and reference lists
Academic citations, book references, source URLs: these are routinely required in alphabetical order. Paste the bibliography in with one reference per line, sort, and copy back into the document. Use Paragraph mode if each citation runs onto multiple lines and you want to keep them together.
Tag and keyword lists
Marketers and content writers building tag lists or keyword sets want them alphabetical so they are easy to scan for duplicates and gaps. Paste a comma-separated set, switch to Words mode, and the sorter splits on whitespace and orders every tag.
Code, config, and command-line work
Sorting import statements, environment variables, hostname lists, or any line-oriented config block is cleaner if you let a tool do it instead of doing it by hand. Turn on Drop duplicates and Trim spaces to clean up at the same time.
Natural sort vs alphabetical sort: which to pick
Plain alphabetical sort compares strings character by character. That is what most people want, but it has a quirk: numbers inside a string get sorted by their first digit, not their value. item-10 ends up before item-2, because the character 1 sorts before the character 2. Natural sort handles embedded numbers by reading them as numbers, so item-2 comes before item-10.
Turn natural sort on when your list contains numbers in the middle of strings: file names like chapter1, chapter2, chapter10, version numbers like v1.2, v1.10, v2.0, ticket IDs like WDT-100, WDT-9, WDT-1000, or any system that uses an integer suffix.
Keep natural sort off when the numbers matter as raw text. Pure character sort is also what most spreadsheet apps do by default, so if your list will be pasted into Excel or Google Sheets and you need it to match Excel's sort order, leave natural sort off.
The toggle is in the sidebar under Options. Switch it on, re-sort, and visually compare against the plain-sort version to see which order matches your expectation.
Case sensitivity and duplicate handling explained
How case sensitivity affects sorting
Computers sort using a character code table. In ASCII, all uppercase letters come before all lowercase letters: A is 65, Z is 90, a is 97, z is 122. So a case-sensitive sort of banana, Apple, cherry gives you Apple, banana, cherry (capital A wins). A case-insensitive sort treats them as the same letter and orders by the letter itself, giving Apple, banana, cherry too in this case, but for a list like apple, Banana, cherry a case-sensitive sort puts Banana first while a case-insensitive sort puts apple first.
The default is case-insensitive because that is what most people mean by "alphabetical". If you are sorting a list that will be consumed by a case-sensitive system (like a Unix shell glob or a SQL ORDER BY on a binary collation), turn the toggle off so the sorter matches the system that will read the output.
How duplicates are detected
Duplicate detection uses the same case rule as sorting. With Ignore case on, apple and Apple are duplicates of each other and the first one to appear is kept. With Ignore case off, they are different entries and both stay in the output. Trimming is applied before deduplication, so apple (with spaces) and apple are also treated as duplicates by default.
Sort a paragraph vs sort lines: which mode to use
The mode selector controls what the sorter treats as a single sortable unit. The right mode depends on how your input is structured.
Line mode (default)
Every newline starts a new item. This is what you want for lists pasted from spreadsheets, plain text rosters, command-line output, or any "one item per line" source. Blank lines are skipped if the option is on; otherwise they are sorted as empty strings (which end up at the top in A-Z mode).
Word mode
Every whitespace gap starts a new word. The sorter splits the input on spaces, tabs, and newlines, and sorts every resulting token. Use this for comma-and-space lists you have pasted as a single line, for tag clouds, or for any case where the items are separated by whitespace rather than newlines. If your input has comma separators without spaces, switch first to the column-to-comma converter to normalize it.
Paragraph mode
Every blank line starts a new paragraph. Multi-line entries stay together. This is the right mode for bibliographies where each citation runs onto multiple lines, address blocks, recipe steps, or any case where each item is itself several lines of text separated from the next by a blank line.
Common alphabetical-sort questions answered in one place
A few questions come up almost every time someone reaches for an alphabetizer. Quick answers below; deeper detail is in the FAQ at the bottom of the page.
Are special characters sorted before or after letters?
Most special characters (punctuation, symbols) have lower character codes than letters, so they sort before the letter A in a plain alphabetical sort. !important ends up at the top, "quoted" next, then numbered entries, then letters. If you want the symbols out of the way, strip them first with the remove punctuation tool, then sort.
Does the sorter handle accented characters?
The sorter uses the browser's built-in string comparison, which follows Unicode order. Accented letters (a, e, i, o, u) usually sort next to their base letter but not always in the position you would expect for a given language. If you need a strict per-language collation (Spanish n after n, German umlauts as base-letter equivalents), do a manual pass or use a locale-aware tool downstream.
Can I sort by length or by frequency instead of alphabetically?
Not in this tool. For length-based sort, paste into a spreadsheet and add a LEN() column. For frequency sort (most repeated entries first), the duplicates tool shows counts and lets you order by count.
Related tools
Frequently asked questions
What is the difference between A-Z and Z-A sort?
A-Z (ascending) puts the alphabetically earliest entries on top: Apple, Banana, Cherry. Z-A (descending) reverses that: Cherry, Banana, Apple. The two modes are identical except for the final reversal, so any options you set (case, duplicates, natural sort) apply the same way in both.
Why is item-10 sorted before item-2?
Plain alphabetical sort compares strings character by character. The 1 in item-10 has a lower character code than the 2 in item-2, so item-10 wins. To fix this, turn on Natural sort in the sidebar. Natural sort reads embedded numbers as numbers, so item-2 lands before item-10.
Does the sorter remove duplicates automatically?
Not by default. Duplicates are preserved in the output unless you turn on Drop duplicates in the sidebar. With that toggle on, the sorter keeps the first occurrence of each item and removes the rest. Duplicate detection respects the Ignore case setting.
Does the text leave my browser?
No. The sorter runs entirely in your browser using JavaScript. Your input and the sorted output are never sent to our servers and are not logged. You can verify by opening the page, disconnecting from the internet, and confirming that sorting still works.
How does case-sensitive sort differ from case-insensitive?
Case-sensitive sort treats uppercase and lowercase letters as different characters. In ASCII, uppercase A through Z come before lowercase a through z, so Apple sorts before banana but after Banana. Case-insensitive (the default) treats apple and Apple as identical for ordering, giving you what most people mean by alphabetical order.
Can I sort a comma-separated list without converting it first?
Yes. Paste the comma-separated list into the input box and switch the Sort by selector to Words. The sorter splits on any whitespace and sorts the resulting tokens. If your list is comma-only with no spaces (apple,banana,cherry), convert it first using the column-to-comma converter or paste through a quick find-and-replace.
What happens to blank lines in the input?
Blank lines are skipped by default. The Skip blank lines toggle in the sidebar controls this. With it on, blank lines are removed before sorting and the Blank skipped stat counts them. With it off, blank lines are sorted as empty strings and end up at the top of an A-Z sort.
Is there a limit on how many items I can sort?
There is no hard cap. The sorter handles tens of thousands of lines comfortably in modern browsers. Very large inputs (a few megabytes) may take a fraction of a second to sort and render, but the algorithm itself is fast (the browser's built-in sort is roughly O(n log n)).
More wordcounter.ai tools
Other tools you might find useful.