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 Sort by to Words in the sidebar and the output stays comma-separated, or set Split input on to Comma or Semicolon under Separators).
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; if the text contains commas, it splits on the commas instead and keeps the result comma-separated (useful for sorting tags, short tokens, or a comma-separated 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. Ignore leading a / an / the sorts titles such as The Hobbit under H, and Sort by last name orders each item by its last word, so Ada Lovelace sorts under L. Both change only the order; the items keep their original text. Remove HTML tags and Remove punctuation and brackets clean lists pasted from a web page or a document before they are sorted.
5. Pick separators and numbering
Under Separators, Split input on chooses what separates items: new line, comma, semicolon, space, or a custom string (type \t for a tab). The default, Auto, follows the Sort by mode. Join output with chooses how the sorted items are joined, so you can paste a comma list and get one item per line back, or the other way round. Number the output adds numbers, letters, Roman numerals, or bullets in front of each sorted item.
6. 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 the commas, orders every tag, and gives you back a comma-separated list.
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. Spreadsheet apps such as Excel and Google Sheets do not use natural sort for text by default, so if your list needs to line up with a spreadsheet's own sort, 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. If the input contains commas, Words mode splits on the commas (and newlines) instead, trims each item, and joins the sorted result with a comma and a space, so apple, cherry, banana and apple,cherry,banana both come out as apple, banana, cherry. Multi-word items such as New York stay together. Use this for tag lists, keyword sets, or any list pasted as a single line. To turn a comma list into one item per line instead, use replace comma with new line.
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, turn on Remove punctuation and brackets in the sidebar, or strip them first with the remove punctuation tool, then sort.
Does the sorter handle accented characters?
With Ignore case on (the default), the sorter uses your browser's language-aware comparison, so accented letters (é, ñ, ü) sort next to their base letter: école lands among the other e words. With Ignore case off, it compares raw character codes, the same way a case-sensitive system does, so capitals come first and accented letters land after z. If you need a strict per-language collation (Spanish ñ as its own letter after n, for example), 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, but there are tools for both. To order single words from shortest to longest, use sort words by length. To order whole lines by length (or numerically), use sort text. To see which words repeat most often, the word frequency counter ranks every word 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, and Banana sorts before apple. 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. When the text contains commas, Words mode splits on the commas, trims each item, and returns the sorted list joined with a comma and a space. That works with or without spaces after the commas (apple,banana,cherry too), and multi-word items stay together. You can also set Split input on to Comma or Semicolon under Separators, and pick Join output with New line to get one item per line back. To convert a comma list without sorting it, use the replace comma with new line tool.
Can I sort names by last name or ignore "The" in titles?
Yes. Turn on Sort by last name to order each item by its last word, so Ada Lovelace sorts under L and first names break ties. Turn on Ignore leading a / an / the to sort titles such as The Hobbit under H. Both options change only the order: each item keeps its original text in the output.
Can I number the sorted list?
Yes. Use Number the output in the sidebar to put numbers (1. 2. 3.), letters (a. b. c.), Roman numerals (I. II. III.), or bullets in front of each sorted item. Markers are added after sorting and do not change the order.
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.