How to sort a list alphabetically

To sort a list alphabetically, put one item per line and use a sort command: Home > Sort in Word, Data > Sort A to Z in Excel or Google Sheets, or paste the list into the sorter on this page. For lists with numbers, use natural sort so item 2 comes before item 10, and choose the alphabet of your language so letters like Ñ, Å or Ç land in the right place.

5 min read

The quickest way

Paste your list into the box below, one item per line. The Sort action is already selected, so the list appears in A to Z order straight away. Tick Z to A for reverse order, turn on Natural sort if the lines contain numbers, and pick the Alphabet of your language. Copy the result and paste it back where it came from.

If your list lives in a document or spreadsheet, the built in commands described below work too. The online way is handy when the list comes from an email, a website, a PDF or a chat, or when the program you use has no sort command at all.

Try it here: Sort Lines

Open the full tool page

In Microsoft Word

Word can sort paragraphs, list items and table rows. Select the list, then go to Home and click the Sort button (the A Z icon with an arrow) in the Paragraph group. In the Sort Text dialog, keep Sort by set to Paragraphs, Type to Text and choose Ascending for A to Z or Descending for Z to A. Click OK.

Each line must be its own paragraph. If the list was pasted with manual line breaks (Shift+Enter), Word sees it as one paragraph and nothing moves. For a numbered list, Word renumbers the items after sorting. To sort a table, click inside it and use the same button; you can sort by any column and tell Word whether the table has a header row.

In Excel and Google Sheets

In Excel, click any cell in the column and choose Data > Sort A to Z (or Sort Z to A). If the column is part of a table with other columns, Excel asks whether to expand the selection; choose expand so each row stays together. For more control, Data > Sort lets you sort by several columns and choose case sensitive sorting under Options.

In Google Sheets, select the range and choose Data > Sort range, then A to Z. Both programs also have formulas that keep the original list untouched: SORT returns a sorted copy and UNIQUE returns a copy without duplicates. In Excel 365 and Google Sheets you can combine them as SORT(UNIQUE(A2:A100)).

Watch out for numbers stored as text. Excel sorts real numbers by value, but codes like item 10 and item 2 are text and are compared letter by letter, so item 10 comes first.

In Google Docs and other editors

Google Docs has no built in command to sort lines. You can install a sorting add-on from Extensions > Add-ons, or copy the list into Google Sheets, sort it there and copy it back. The same applies to Apple Pages, Notepad and most email programs: paste the list into a sorter, sort it, and paste it back.

Developers often use the command line: sort on macOS and Linux sorts lines of a file, sort -u removes duplicates at the same time, and on Windows PowerShell Sort-Object does the same. These follow the system locale, so results for accented letters depend on your settings.

Numbers in a list: natural sort

Plain alphabetical sorting compares characters one by one. Because the character 1 comes before 2, file10 lands before file2. Natural sort reads the digits inside a line as a whole number, so the order matches what people expect.

Turn on Natural sort (2 before 10) in the tool whenever the list contains version numbers, room numbers, invoice numbers or file names. If you need a spreadsheet to sort codes naturally, a common trick is to pad the numbers with zeros (item 002, item 010).

Plain sortNatural sort
Chapter 1Chapter 1
Chapter 10Chapter 2
Chapter 11Chapter 3
Chapter 2Chapter 10
Chapter 3Chapter 11

Accents and language rules

Alphabetical order is not the same in every language. A simple sort based on character codes puts all accented letters after Z and all capital letters before small ones. Real alphabet rules are different, and the sorter on this page follows them for 20 languages through the Alphabet setting.

Case is ignored by default, so Apple and apple sit next to each other. Tick Case sensitive if you need capitals and small letters to be treated as different.

LanguageRuleExample order
EnglishAccents ignored for ordercafe, café, cake
SpanishÑ is a separate letter after Nnube, nuez, ñandú
GermanÄ sorts with A, Ö with O, Ü with UApfel, Äpfel, Arm
SwedishÅ, Ä, Ö come after ZZorn, Åsa, Äng, Öl
TurkishÇ, Ğ, I, Ö, Ş, Ü are separate letterscam, çay, ılık, inek

Removing duplicates and empty lines

Sorting brings duplicates next to each other, which makes them easy to spot, but it does not remove them. In the tool, switch the Action to Remove duplicates: the first occurrence of each line stays in place and later copies are removed. Then switch back to Sort. Trim spaces is on by default, so a value with a space at the end still counts as a duplicate.

Empty lines are left out of the sorted result automatically. For lists copied from PDFs or web pages that are full of blank lines, Remove empty lines cleans them up without changing the order.

Common problems

  • Everything stays in one line: the list uses commas or semicolons instead of line breaks. Replace them with line breaks first, or paste a column from a spreadsheet, which arrives as one value per line.
  • Names sorted by first name: sorting compares the start of each line. Put names as Last name, First name if you need surname order.
  • The, A and An at the start: libraries ignore these articles when filing titles; sorting tools do not, so remove or move them first if you need that rule.
  • Numbers in the wrong order: turn on Natural sort.
  • Accented letters at the end: choose the right Alphabet for your language.

Step by step

  1. Paste your listPaste the list into the box, one item per line, or open a text file.
  2. Check the sort optionsSort is already selected. Turn on Natural sort for numbers and tick Z to A for reverse order.
  3. Choose the alphabetPick the Alphabet of your language so accented letters land in the right place.
  4. Remove duplicates if neededSwitch the Action to Remove duplicates, then back to Sort.
  5. Copy the resultCopy the sorted list or download it as a text file. The summary shows how many lines are left.

Frequently asked questions

How do I alphabetize a list in Word?

Select the list, click Sort in the Paragraph group on the Home tab, keep Paragraphs and Text, choose Ascending and click OK.

Can I sort a list in Google Docs?

Not with a built in command. Use a sorting add-on, or paste the list into Google Sheets or an online sorter, sort it and paste it back.

Why does 10 come before 2 when I sort?

Plain sorting compares characters, and 1 comes before 2. Turn on natural sort so numbers inside the lines are compared by their value.

How do I sort by last name?

Sorting uses the start of each line, so write names as Last name, First name before sorting, or sort a separate surname column in a spreadsheet.

Does sorting remove duplicates?

No. It places duplicates next to each other. Use Remove duplicates to delete them; the first occurrence of each line is kept.

Is my list uploaded?

No. Sorting runs in your browser and nothing is sent to a server. After the first visit it also works offline.