Alphabetize a List

Paste a list with one item per line and get it back sorted A → Z or Z → A, with numbers in natural order.

How to use

  1. Paste your list into the Input box, one item per line.
  2. Choose A → Z or Z → A. The sorted list appears in Output right away.
  3. Press Copy to copy the sorted list.

Examples

InputOutput
banana Apple cherryApple banana cherry
chapter 10 chapter 9 chapter 1chapter 1 chapter 9 chapter 10
red green bluered green blue

About this tool

How the sorting works

Each line is one item. Blank lines are dropped, and the rest are sorted with your browser's language-aware collation rather than by raw character codes. Three things follow from that:

  • Case is ignored. apple, Apple and APPLE sort together, so a capitalized word doesn't jump ahead of everything in lowercase the way it does in a plain code-point sort.
  • Accents sort with their base letter. Émile lands between Edgar and Frank, not after Z.
  • Numbers sort by value. item 2 comes before item 10, which is what people expect from file names, chapter lists and version numbers. A plain text sort would give item 1, item 10, item 2.

Z → A sorts the same way and then reverses the list.

Things to tidy first

  • Put one item per line. If your list is separated by commas, replace the commas with line breaks before pasting.
  • The whole line is the sort key, so The Beatles sorts under T. Move a leading article to the end (Beatles, The) if you want library-style order.
  • Duplicates are kept. Remove repeated lines separately if you need a list of unique items.

Chinese and Japanese lists

Lines in Chinese or Japanese are compared with whatever collation your browser provides for its language, and those rules differ: a Traditional Chinese setting usually orders by stroke count, a Simplified Chinese one by pinyin, and kanji have no single reading the computer can rely on. Use this tool mainly for Latin-script lists, and check the result if exact CJK order matters.

Common uses

Bibliographies and reference lists, glossaries, guest lists, vocabulary lists, CSS properties or import statements in code, and any list you'd like to scan quickly.

Frequently asked questions

Does the alphabetizer ignore uppercase and lowercase?

Yes. Capital and small letters are treated as the same letter, so "apple" and "Banana" sort as a, b regardless of case.

How are numbers sorted?

By their value, so "item 2" comes before "item 10". This is often called natural sort order.

Can I sort a comma-separated list?

Put each item on its own line first. The tool sorts lines, so a single line of comma-separated words is treated as one item.

What happens to blank lines?

Empty lines and lines containing only spaces are removed from the result.