Format Code Now
/
TextAlphabetical Order Tool Next: Calculate String Length ›

Alphabetical Order Tool

TX-46

Paste a list with one item per line and put it in alphabetical order, A to Z or Z to A. Options can trim spaces, drop empty lines, remove duplicates and change case before the sort.

Runs in your browser. Nothing is uploaded.

List, one item per line

Alphabetical order

How to use it

  1. Paste your list into the box, one item per line.
  2. Leave Ignore upper and lower case on, or turn it off if capitals should sort apart from lowercase.
  3. Tick any clean-up you want: trim spaces, remove empty lines, remove duplicate lines, or change the case first.
  4. Press A to Z or Z to A, then copy the result or download it as a text file.

How the order is decided

Lines are compared with your browser's Intl.Collator, which follows the language settings of your device. In most English settings an accented letter such as the E in Éclair sorts next to plain E instead of after Z, which is what a dictionary does and not what a plain byte-by-byte sort does. With Ignore case turned off, a lowercase word comes before the same word in capitals, so apple is listed before Apple. Because the rules come from the browser, another person's browser can order a few unusual characters differently.

What runs before the sort

The clean-up options run in a fixed order: change case, trim spaces, remove empty lines, then remove duplicates, and only then the sort. Remove duplicates keeps the first copy of each line, and with Ignore case on it treats Apple and apple as one line. Title Case capitalizes the first letter of each word and lowercases the rest, so a name such as McDonald becomes Mcdonald. Natural order reads runs of digits as numbers, which puts file2 before file10.

Whole lines, not the words inside them

This page sorts the lines of a list and leaves the words inside each line alone. To put the words of a paragraph in alphabetical order, use the Sort Words tool. To sort by length or reverse the line order, use the Sort Lines tool. Numbers in a list are sorted as text here unless you tick Natural order, so for a column of plain numbers the Number Sorter gives the correct numeric order.

Error messages and what to do

MessageWhat it meansFix
Paste the lines to put in alphabetical order.The input box is empty or holds only spaces and line breaks.Paste or type the list you want to sort, one item per line.

Questions people ask

How do I put a list in alphabetical order online?

Paste the list with one item per line and press A to Z. The tool sorts whole lines using your browser's language rules, so accented letters sit next to their plain letters. Press Z to A for the reverse order, then copy or download the result.

How do I alphabetize a list and remove duplicates at once?

Tick Remove duplicate lines and press A to Z. The first copy of each line is kept. With Ignore upper and lower case on, Apple and apple count as the same line. You can also remove empty lines with the option beside it.

Why does file10 sort before file2?

Alphabetical sorting compares one character at a time, so the 1 in file10 comes before the 2 in file2. Tick Natural order to read digit runs as whole numbers, and file2 will come before file10.

Does alphabetical order ignore capital letters?

Here it does by default, because Ignore upper and lower case is switched on. Switch it off and lowercase words sort before the same word in capitals, so apple is listed before Apple.

How are accented letters like é sorted?

They follow your browser's collation rules for your language setting. In most English settings é sorts with e, not after z. The result can differ from a plain byte-order sort and from another person's browser.

Can I sort the words in a sentence instead of lines?

Not on this page, which keeps each line whole. Use the Sort Words tool to put the words of a block of text in alphabetical order, with options to join them by space, new line or comma.

About this tool

Sorts the lines of your list with your browser's Intl.Collator, so the order follows your language settings: accented letters sit beside their plain letters, and the result can differ from a plain byte-order sort and from another person's browser. The clean-up options run before the sort, in this order: change case, trim, remove empty lines, remove duplicates. With Ignore case off, a lowercase word comes before the same word in capitals. Remove duplicates keeps the first copy of each line, and with Ignore case on it treats Apple and apple as one line. Natural order reads digit runs as numbers. Title Case capitalizes the first letter of each word and lowercases the rest, which changes names such as McDonald. Lines are sorted whole; the words inside a line are not reordered. The sort runs in your browser and nothing is uploaded.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.