Skip to content

Text Alphabetizer - Sort Lists A-Z or Z-A Online

Text alphabetizer that sorts lines, comma lists, or words A-Z or Z-A. Natural number order, optional duplicate removal, one-click copy.

By Updated Runs in your browser

Text Alphabetizer guide

Paste a list, pick one per line, comma-separated, or space-separated, and get it in alphabetical order instantly. Sorting ignores case and puts item 2 before item 10, the way a person would.

Three ways to split your text

The first choice is what counts as one item. One item per line is the default and fits most real lists: names copied from a spreadsheet column, a grocery list, a bibliography, a set of URLs. Each line is one item, however many words it holds, so Mary Ann Smith stays together.

Comma-separated mode splits on commas and trims the spaces around each piece. Use it for tags, keywords, CSV-style rows, and lists pasted from emails like red, green, blue. The output comes back in the same shape, joined with a comma and a space.

Space-separated mode treats every word as its own item. It is useful for sorting a jumble of single words, like a vocabulary list or a set of hashtags, but it will break multi-word names apart. If an item contains a space, use line or comma mode instead.

How the sort actually works

Under the hood the tool uses the browser's localeCompare with numeric comparison turned on and case differences ignored. Two things follow from that, and both are what people expect but basic sorters get wrong.

Case does not matter. A plain computer sort compares character codes, and every capital letter has a lower code than every lowercase letter. That is why a naive sort gives Apple, Banana, apple, cherry. This tool gives apple, Apple, Banana, cherry.

Numbers sort by value. A character sort reads item 10 as i-t-e-m-space-1 and puts it ahead of item 2. Natural sorting reads the digits as a number, so the order is item 2, then item 10. This matters for file names, chapter lists, product SKUs, and anything numbered past 9.

Worked example

Paste these six lines: item 10, Banana, item 2, apple, Apple, cherry. Sorted A-Z, the result is apple, Apple, Banana, cherry, item 2, item 10. The two apples land side by side, and the numbered items come last in true number order.

Now tick remove duplicates. Apple is dropped because the comparison is case-insensitive and apple already appeared. You get five items: apple, Banana, cherry, item 2, item 10. Switch to Z-A and the same five come back as item 10, item 2, cherry, Banana, apple.

Where people use it

Teachers alphabetize class rosters and spelling lists. Writers sort glossaries, indexes, and reference lists. Developers sort import lines, config keys, and dependency lists so diffs stay clean. Marketers tidy keyword and tag lists before pasting them into a CMS or ad platform.

A few style guides have their own rules. APA reference lists sort by author surname, and library filing rules often ignore a leading The or A. This tool sorts on the text exactly as written, so if you want Smith, John ordering, paste the names surname-first.

Mistakes that scramble a sorted list

Picking the wrong mode. If your list is one per line but you choose space mode, Mary Ann Smith turns into three separate items. Check the separator before you copy the result.

Hidden whitespace and invisible characters. A line that starts with a space or a non-breaking space can sort in an unexpected place, and two items that look identical may not be treated as duplicates. Run messy pasted text through the whitespace cleaner first.

Assuming duplicate removal is exact. It ignores case, so if Apple and apple really are different things in your data (a brand versus a fruit), leave the option off.

What it deliberately does not do

It does not guess at structure. A line reading Smith, John is sorted by its first letter, S, and a line reading John Smith is sorted by J. If you need last-name order, put the surname first before you paste. The same applies to titles that start with The or A: they sort under T and A, because that is what the text says.

It does not change your items. Capitalization, spelling, and inner spacing come out exactly as they went in. Only the order changes, plus the dropped duplicates if you ask for that. That makes it safe to run on names, codes, and IDs where a changed character would be a real error.

How we calculate: sources

Frequently asked questions

How do I alphabetize a list?

Paste the list, choose how items are separated (new lines, commas, or spaces), pick A-Z or Z-A, and the sorted list appears. Hit copy to take it back to your document.

Can I sort in reverse alphabetical order?

Yes. Choose Z-A. It uses the same rules as A-Z, just reversed.

Does capitalization affect the order?

No. Sorting is case-insensitive, so apple, Apple, and APPLE sit together instead of every capitalized word jumping to the top.

How are numbers sorted?

Naturally. Chapter 2 comes before Chapter 10. A plain character sort would put 10 first because 1 comes before 2.

Can it remove duplicates while sorting?

Yes. Tick remove duplicates and repeated items are dropped. The check ignores case, so Apple and apple count as the same item and only the first one is kept.

Can I alphabetize a comma-separated list?

Yes. Choose comma-separated mode. Items are split on commas, trimmed, sorted, and joined back with a comma and a space.

Is my list uploaded?

Everything runs in your browser. Nothing you enter is uploaded to a server or stored by us.

Can I alphabetize a list in Google Docs or Word?

Word has Sort under Home > Paragraph. Google Docs needs an add-on. Pasting here, sorting, and pasting back is usually faster for a one-off list.

Does it sort accented letters correctly?

Yes. localeCompare places accented letters next to their base letter, so éclair sorts among the e words instead of after z.