Toolphy

Alphabetizer — Sort Lines Alphabetically

Paste your lines, choose A→Z or Z→A, and get a perfectly sorted list instantly — with optional case folding, article skipping, duplicate removal and whitespace cleanup, all in your browser.

Sorting options

Leading articles ignored in this language: a, an, the.

Input lines
0
Output lines
0
Duplicates removed
0

How to Sort a List Alphabetically

Sorting a list by hand is slow and easy to get wrong; an alphabetizer does it in a single pass, free of charge and without sending your data anywhere. The worked example below uses a short five-item list: banana, Apple, the cherry, apple, Zebra.

  1. Paste one item per line. Put each entry on its own line in the input box, because line breaks — not commas or semicolons — define where one item ends and the next begins. A line such as "red apples, green apples" is treated as a single item, so split combined entries first if you want them sorted separately.

  2. Pick the direction. Click Sort A → Z for ascending order or Sort Z → A for descending order. The list is re-ordered immediately; there is no separate calculate step, and you can switch direction as often as you like without retyping anything.

  3. Choose how to treat case and articles. Tick Ignore case so that "Apple" and "apple" are treated as the same word and sort together, rather than placing every capitalised word before every lowercase word. Tick Ignore leading articles to sort "The Cherry" under C instead of T, which is what book indexes and reference lists do.

  4. Clean up the list. Turn on Remove duplicate lines to keep only the first occurrence of each entry, Trim leading and trailing spaces to ignore stray indentation copied from other tools, and Remove empty lines to drop the blank rows that extra line breaks create.

  5. Copy the sorted result. Press the copy button to place the ordered list on your clipboard, then paste it into a document, a spreadsheet cell or a code editor. With the defaults applied, the example above becomes: apple, Apple, banana, the cherry, Zebra.

What Does It Mean to Alphabetize a List?

To alphabetize a list is to arrange its entries in the order defined by the alphabet of a given language, so that a reader can find a name quickly and check whether something is present without scanning the whole list. At the simplest level this means comparing the first character of each entry, then the second, and so on until they differ. The difficulty is that "first character" is not as objective as it sounds: the same letters do not occupy the same positions in every language, and computers store letters as numbers that do not correspond to human reading order. Two competing orders exist. The first is code-point order, the raw numeric order of characters in Unicode, in which all uppercase letters come before all lowercase letters and accented characters are bundled far away from their unaccented forms. The second is collation order, the culturally correct order defined by the rules of a language. A case-sensitive code-point sort puts "Zebra" before "apple", which almost never matches what a person expects. A collation sort puts "apple" before "Zebra", and in Swedish it places "Å" at the very end of the alphabet rather than next to "A". This tool uses the browser's built-in collation engine, so the result follows the rules of the selected language. That is why case-insensitive sorting, accented characters and language-specific letters all behave the way a native reader expects, and why the same list can legitimately sort differently in English, French and Spanish.

Common Applications

1. Bibliographies and reference lists. A study with 38 cited sources must list them A → Z by author surname. Sorting a paste of author lines removes the risk of a misplaced entry and makes a printed reference list verifiable at a glance.

2. CRM and spreadsheet exports. Export 250 customer or contact names to CSV, paste the name column, and sort it to spot duplicates and to prepare a mail-merge order that feels intentional rather than random.

3. Guest and invitation lists. A wedding with 120 invited guests needs a tidy door list. Sorting alphabetically by surname lets staff find a name in seconds while a queue forms behind them.

4. Product, SKU and inventory lists. A wholesaler tracking 60 product codes can sort them alphabetically to reconcile a stock count against a catalogue and to find missing or misspelled identifiers.

5. Glossaries, indexes and code identifiers. A glossary of 45 technical terms, a back-of-book index, or a list of function names benefits from a stable alphabetical order that readers and developers can scan quickly.

In each case the list is small enough to sort by hand yet large enough that manual sorting invites mistakes — the exact gap a client-side alphabetizer closes.

Locale-Aware Sorting: Why the Same Letters Change Places

Alphabetical order is not universal. Each language defines its own collation rules, and those rules decide where accented and special letters belong. In English, "Å" is usually treated as a variant of "A" and sits between "A" and "B". In Swedish, "Å", "Ä" and "Ö" are separate letters that come after "Z". German sorts "ö" close to "o", while Danish puts "Æ" and "Ø" at the end of its alphabet. Punctuation and spaces are handled differently too: some rules ignore hyphens and apostrophes, others treat them as characters that sort before letters.

Because a hard-coded A-to-Z order would silently produce wrong results outside English, this tool delegates the comparison to the browser's International Components for Unicode (ICU) collation, selected by the language of the page you are reading. The practical consequence is that "café" and "cafe" are grouped sensibly, "Ångström" lands where a Swedish reader expects it, and Spanish "ch" and "ll" follow modern Spanish conventions. If you need a strictly mechanical order for programming rather than reading, disable case-insensitive mode and remember that raw code-point order may differ from what a reader considers correct.

Common Alphabetizing Mistakes to Avoid

Most bad alphabetical lists fail for one of five predictable reasons. First, leading articles are left in place: "The Art of War", "A Tale of Two Cities" and "An Essay" end up scattered under T and A instead of being filed under Art, Tale and Essay. Second, case is mixed without folding, so uppercase words clump at the top because code-point order ranks capitals first. Third, duplicates survive: the same name appears twice, once as "Smith" and once as "smith". Fourth, hidden whitespace or non-breaking spaces copied from a web page shift entries by an invisible character. Fifth, numbers are compared as text, so "item 10" sorts before "item 2".

This tool addresses each in turn with its four cleanup options: ignore case, ignore leading articles, remove duplicates and trim whitespace. A reliable habit is to trim, remove duplicates and remove empty lines first, then sort, because deduplicating after sorting can leave whitespace-differing twins adjacent but separate. Naming conventions matter as much as the sort itself: decide once whether you file by surname or full name and keep it consistent across the whole list.

Alphabetical Sort vs Natural Sort

An ordinary string sort compares text character by character, which is ideal for names but wrong for numbered labels. Given the three labels "file1", "file2" and "file10", a plain alphabetical sort returns file1, file10, file2, because the character "1" in "10" is compared before the "2" in "2". Anyone reading a file listing, a chapter list or a version log finds this absurd.

Natural sort solves the problem by recognising runs of digits and comparing their numeric value instead of their characters, so the same three labels become file1, file2, file10. The same logic orders chapter headings, release versions such as 1.9 and 1.10, and any list that mixes words with numbers. Enable the natural sort option whenever your entries contain trailing or leading numbers; leave it off for pure names, where the numeric rule never triggers anyway. Note that natural sort affects only how digit sequences are compared — it does not change how letters or accents are ordered.

Frequently Asked Questions - FAQ

Is my list sent to a server?

No. The entire sort runs locally in your browser with plain JavaScript. Your list never leaves your device, which makes the tool safe for client names, addresses and other confidential data.

What does ignoring leading articles do?

When this option is on, common articles at the start of an entry are skipped for sorting purposes only. "The Cherry" is filed under C, and the full text is still shown in the output. The article list follows the language of the page: a, an, the in English; le, la, les, un, une and similar forms in French; el, la, los, las, un and una in Spanish.

Does case matter when sorting?

By default the case-insensitive option is on, so "Apple" and "apple" sort together as though the word were written the same way. Turn it off to get a strict, case-sensitive order in which all uppercase entries are ranked ahead of lowercase ones, exactly as computers store them.

How are accents and special letters handled?

Sorting uses the browser's language-aware collation engine, so accented letters are compared the way readers of that language expect. Spanish, French and English lists therefore sort correctly, and a Swedish list places Å, Ä and Ö after Z rather than treating them as plain A and O.

What is the difference between alphabetical and natural sort?

Alphabetical sort compares characters, so "item10" comes before "item2". Natural sort compares number sequences by value, so "item2" correctly comes before "item10". Use natural sort when your entries end in numbers, such as file names, chapter numbers or versions.

Last updated: