Putting a list in alphabetical order is one of those small jobs that comes up all the time — a class register, a guest list, keywords, product names, a bibliography. Here are the fastest ways to do it wherever your list lives, and the two surprises that catch people out: numbers and duplicates.
1. Online, in a few seconds
If the list is in an email, a document or a chat, the quickest way is a text sorter:
- Copy the list so that each item is on its own line.
- Paste it into the free Text Sorter.
- Choose Alphabetical (A → Z) — or Z → A, by length, reverse or shuffle.
- Tick Remove duplicate lines if the list has repeats.
- Click Copy result and paste it back.
The sorting follows natural language rules, so “apple”, “Banana” and “cherry” come out in the order people expect, and it happens in your browser — useful for private lists such as customer emails.
2. In Excel
For a column of data:
- Click any cell in the column.
- Go to Data → Sort A to Z (or Sort Z to A).
- If other columns belong to the same rows, Excel asks whether to expand the selection — choose yes, or the rows will be scrambled.
With a formula (Microsoft 365 and Excel 2021+):
=SORT(A2:A100)
=SORT(UNIQUE(A2:A100))The second version sorts and removes duplicates in one step. The result “spills” into the cells below and updates when the source changes.
3. In Google Sheets
- Select the column, then Data → Sort range → A to Z. Tick “Data has header row” if row 1 is a heading.
- Or use a formula, which leaves the original untouched:
=SORT(A2:A100)
=SORT(UNIQUE(A2:A100))4. In Microsoft Word
- Select the list (paragraphs or a bulleted list).
- On the Home tab, in the Paragraph group, click the Sort button (A above Z with an arrow).
- Choose Sort by Paragraphs, Type Text, Ascending, and click OK.
Word can also sort tables by any column from the same button.
5. On the command line
On macOS and Linux:
sort names.txt # A to Z
sort -f names.txt # ignore upper/lower case
sort -u names.txt # remove duplicates
sort -n numbers.txt # numeric order
sort -r names.txt # reverseIn Python:
lines = sorted(open('names.txt', encoding='utf-8').read().splitlines(), key=str.casefold)Why 10 comes before 2
Text sorting compares characters one at a time from the left. “10” starts with “1”, and “1” comes before “2”, so “10” sorts before “2” — and “Item 10” before “Item 2”. Three ways to fix it:
- Pad numbers with zeros: 01, 02 … 10. Then text order and number order match.
- Use a numeric sort:
sort -non the command line, or store the values as numbers in Excel and Sheets. - Sort by length first: short numbers come before long ones, which works for plain numbers of different lengths.
Upper and lower case
Older and simpler sort routines put all capital letters before small letters, so “Zebra” comes before “apple”. Modern tools usually ignore case for alphabetical sorting. In the Text Sorter, Ignore case is on by default; Excel and Sheets ignore case unless you choose otherwise.
Removing duplicates
Duplicates only match when the text is exactly the same. “Delhi”, “delhi” and “Delhi ” (with a trailing space) are three different lines to a computer. Before removing duplicates:
- Trim extra spaces with the Text Space Remover.
- Make the case consistent with the Case Converter if “Delhi” and “delhi” should count as the same.
- Then remove duplicates with the Text Sorter, or with Remove Duplicates if you want to keep the original order.
Other handy orders
- By length — find the shortest or longest keywords, names or titles.
- Reverse — turn a newest-first export into oldest-first.
- Shuffle — pick a random presentation order or randomise quiz questions.
All of these are one click in the Text Sorter. If you then need numbers in front of each line, add them with the Line Numbering tool.



