How to put a list in alphabetical order
- Type or paste your list into the box on the left, one item per line. A column copied from a spreadsheet pastes the same way. If your items are separated by commas, choose Lines and commas under Split items by.
- The sorted list appears on the right straight away, A to Z. Choose Z to A, Shortest first, Longest first or Reverse the list under Order for other orders.
- Tick the options you need: last names, titles without “The”, capitals first, or removing repeated items.
- Press Copy to paste the result elsewhere, or Download .txt to save it. Choose Numbered, Bullets, Comma-separated or Semicolon-separated under Show the result as to change how it is laid out.
- Copied a list from a web page with its HTML, such as
<li>Paris</li>? Tick Remove HTML tags and only the text is sorted.
The rules of alphabetical order
Two words are compared one letter at a time, and the first letter that differs decides which comes first: “apple” comes before “apricot” because p comes before r. When one word is the start of the other, the shorter one comes first, so “car” comes before “card” and “card” before “cardboard”.
Spaces count, and they come before any letter. That means “New York” comes before “Newark”, because after “New” the space beats the letter a. This is called word-by-word order, and it is what most phone books and book indexes use.
Capital letters do not change the order: “apple”, “Apple” and “APPLE” all file under a. Accented letters file with their plain letter, so “éclair” sorts among the words starting with e; only when two words are otherwise the same does the plain one come first, which puts “resume” before “résumé”. The sorting follows the Unicode collation rules for English that your browser has built in, rather than the computer codes of the letters, which would wrongly put every capital before every small letter.
Numbers in a list
Items that start with digits come before items that start with letters. Inside an item, Numbers in number order compares each run of digits by its value, so “Chapter 2” comes before “Chapter 10” and “Room 9B” before “Room 12A”. This is often called natural sort order. Untick the box to compare digit by digit instead, which is how many file managers and older programs sort: there, “10” comes before “2” because the first digit 1 is smaller than 2.
Sorting names by last name
Class lists, guest lists and reference lists are usually in order of last name. With Sort by the last word ticked, each line is filed under its last word and then by the words before it, so “Grace Hopper”, “Ada Lovelace” and “Alan Turing” come out in that order, and two people called Smith are put in order of their first names. The names themselves are not changed.
Names with a suffix or a two-word surname need a little help: “Martin Luther King Jr.” would be filed under Jr., and “Ludwig van Beethoven” under Beethoven. For a strict list, write such names last name first, such as “King, Martin Luther”, and leave the box unticked. Letter-by-letter sorting also puts every name starting with Mac before every name starting with Mc, so MacDonald comes before Mayer, and McDonald after it; some libraries and phone books file Mc as if it were spelled Mac, which you would need to arrange by hand.
Titles that start with The, A or An
Libraries, bookshops and music stores file titles by their first important word, so “The Great Gatsby” goes under G and “A Tale of Two Cities” under T. Tick Ignore The, A and An at the start to sort that way. Only a leading article followed by another word is skipped, so a title that is just “The” or a word such as “Another” is not changed.
Alphabetizing in Word, Excel and Google Sheets
- Microsoft Word: select the list, then on the Home tab press Sort (the A to Z button in the Paragraph group) and choose Ascending.
- Excel: click a cell in the column, then on the Data tab press Sort A to Z. To keep rows together, select all the columns first.
- Google Sheets: select the range, then choose Data, Sort range, and pick A to Z.
Pasting the list here is often quicker for a one-off job, works the same on a phone, and adds options those programs don’t have, such as sorting by last name, skipping “The” and removing repeats in one go.
When an alphabetical list helps
- Reference lists and bibliographies: APA, MLA and Chicago reference lists are in alphabetical order by the first author’s last name.
- Class rosters, guest lists and seating plans: sort by last name so anyone can find a name quickly.
- Glossaries, indexes and word lists: spelling lists, vocabulary and keywords are easier to scan A to Z.
- Inventories and shopping lists: sort, remove repeats and paste the clean list back into a spreadsheet.
- Code and settings: keep imports, dependencies or configuration keys in a stable order that is easy to review.
To put a list in a random order instead, use the list randomizer. To count the words or characters in the result, try the word counter, and to change capital letters, the case converter.
Tips
- Check for near-repeats. The count above the box says how many items are repeated, ignoring capital letters, so “Apple” and “apple” are caught before you tick Remove repeats.
- Keep one item per line. Names written last name first, such as “King, Martin Luther”, stay whole when Split items by is left at One item per line.
- Number the final list. Choose Numbered under Show the result as to paste a ready-made ranked or numbered list into a document.
- Share the settings. Copy link opens the same list with the same options, which helps when several people keep one list in the same order.
Your list stays on your device
The list is sorted in your browser and is never uploaded to this website or anyone else. It is saved on this device, with your settings, so it is still there next time; clear the box to remove it.
Frequently asked questions
How do I put a list in alphabetical order?
Paste the list into the box, one item per line, and it is sorted A to Z straight away. Choose Z to A, shortest first or longest first under Order, then copy the result or download it as a text file.
How do I alphabetize names by last name?
Tick “Sort by the last word”. Each line is then filed under its last word, so “Ada Lovelace” sorts under L and “Alan Turing” under T, while the names are shown just as you typed them. People with the same last name are sorted by their first name.
Why does Item 2 come before Item 10?
With “Numbers in number order” ticked, runs of digits are compared by their value, so 2 comes before 10, the way people expect. Untick it to compare digit by digit, which puts 10 before 2 because 1 comes before 2.
Do capital letters change the order?
No. “apple” and “Apple” sort together, and words that differ only in capitals keep the order you typed them in. Tick “Capitals first” if you want “Apple” always placed before “apple”.
Can I ignore “The” at the start of titles?
Yes. Tick “Ignore The, A and An at the start” and titles are filed by the next word, as libraries and record shops do, so “The Beatles” sorts under B. The titles still show their full names.
Is my list uploaded?
No. Sorting happens in your browser and the list is never sent anywhere. It is saved on this device so it is still there next time, and a shared link keeps the list after the # sign, which browsers never send to a server.