Alphabetic Order Tool

Paste a list, one item per line, and watch the items fall into A to Z order as you type. Choose the filing rule an index or library catalog uses, file The Hague under H, put Chapter 2 ahead of Chapter 10, and switch to the Swedish, Norwegian, Spanish or German alphabet when the list holds local letters.

Blank lines and spaces around each item are dropped. Sorting runs in your browser, so the list never leaves this page.

Sorted items show here

Type a list, or press Load sample to fill the box with twelve city names.

Items
0
Moved
0
Duplicates removed
0
Letters used
0
Order
Filing rule
Capital letters

Word by word or letter by letter

Two lists of the same names, both in alphabetic order, both correct, and still different. The split comes from one question: does a space count?

The four New cities from Load sample, under each rule
PositionWord by wordLetter by letter
1New DelhiNewark
2New YorkNewcastle
3NewarkNew Delhi
4NewcastleNew York

Library catalogs and phone directories file word by word. Dictionaries file letter by letter, because a dictionary reader looks up a spelling, not a phrase. The Chicago Manual of Style describes both systems for book indexes. Pick one rule per list and stick with the choice. A glossary where half the entries follow each rule reads as broken, even when every pair looks fine on its own.

Why a script puts Zebra ahead of apple

Computers store each character as a number. Capital A through Z sit at 65 to 90 and small a through z at 97 to 122, so every capital outranks every small letter. Sort by those raw numbers and the list comes out like this:

Banana
Zebra
apple
cherry

JavaScript's plain array.sort(), Python's sorted() on strings, and the Unix sort command under LC_ALL=C all compare raw code points. Pick Code point under Capital letters to predict their output before your script runs. The mode also shows a second side effect: Ålesund and Århus fall to the bottom of the sample, below every plain letter, since Å sits at 197.

Capitals first is the gentler option. Apple and apple stay next to each other, with the capitalized one first, and both still file before banana.

The Hague files under H

Catalogers drop a leading article before filing a title, so The Great Gatsby sits under G. Library records encode the rule directly: the MARC title field carries a count of non-filing characters, 4 for "The ". With Skip a leading The, A or An on, the tool sorts on the words after the article and keeps the full title in the output.

The option covers English articles only. Los Angeles, El Paso and Le Havre stay under L and E. Switch the option off for lists where the article is part of what people search for, such as band names in a record shop.

Chapter 2 before Chapter 10

Compared one character at a time, "Chapter 10" beats "Chapter 2" because 1 comes before 2. Natural number order reads each run of digits as a whole number instead.

Same five items, numbers read two ways
Natural order onNatural order off
Chapter 1Chapter 1
Chapter 2Chapter 10
Chapter 10Chapter 2
img2.pngimg12.png
img12.pngimg2.png

Decimals break the trick. In 1.25 and 1.5, the digits after the point form separate runs, 25 and 5, so 1.5 lands first. For prices, scores or measurements, the numeric list sorter reads the full value.

Å, Ñ and letters past Z

The English alphabet folds accented letters into the base letter. Zürich files with Z, São Paulo with S, and Ålesund opens the sample list under A. Other languages give some of those letters their own slot:

Choose the alphabet your readers use, not the one the item names come from. A Swedish author index files Ålesund after Z, while an English atlas index files Ålesund under A. The letter strip under the result follows the alphabet you pick, so Swedish shows Å, Ä and Ö as extra tiles.

Reading the grouped view

Grouped by letter puts a heading over each first letter, the layout of a glossary or a back-of-book index. The strip under the result marks letters with entries in dark tiles and empty letters in pale ones. Click a dark tile to jump to its group. Copy result copies whichever view is open, headings included.

Headings come from the sort key, not the raw text. With articles skipped, The Hague sits under H. Digits group under #. In Code point mode a letter heading appears twice when capitals and small letters split apart, a quick visual reason to keep the mode for code and not for readers.

Where this tool stops

Alphabetic order questions

Filing rules, odd results, and what the tool skips.

Why does New York come before Newark?

Word by word filing is on. Under this rule a space sorts ahead of every letter, so New followed by a space beats Newa. Switch Filing rule to Letter by letter and Newark moves first.

How do I put a comma-separated list in alphabetical order?

Set Items split by to Commas and paste the list. The result keeps commas between items, with one space after each. Spaces works the same way for a list of single words.

Why do capitalized words sort before lowercase ones?

Capital letters is set to Code point. Code point mode compares raw character codes, where every capital comes before every small letter. Pick Ignore to sort apple, Banana and cherry as a reader expects.

Does Remove duplicates treat Apple and apple as the same?

With Capital letters on Ignore, yes, and the first spelling in your list is the one kept. With Capitals first or Code point, Apple and apple count as two separate items.

Where do numbers and symbols go?

Items starting with a digit come before A and group under # in the grouped view. Punctuation at the start of an item is skipped while Ignore punctuation is on, so "Hello" files under H.

Is my list uploaded anywhere?

No. Sorting uses the collation rules built into your browser. Nothing is sent to Toolexe, and a refresh clears the box.