Menu

How to alphabetize a list in Word, Google Docs, Excel or online

Put one item on each line, paste the list into the sort lines tool and copy the A–Z result. In Word desktop use Home > Sort; in Excel and Google Sheets use Sort A to Z. Google Docs needs an add-on or a quick copy and paste.

Published

The quickest way to alphabetize a list is to put each item on its own line, paste the whole list into the sort lines tool and copy the result: it is sorted A–Z as you type, ignoring case. If the list already lives in a document or spreadsheet, every major app can sort it too, except Word for the web and Google Docs, which have no sort command. The table below shows where to find it, and the sections after it cover the details that make sorted lists come out wrong.

Where the sort command is

App How to sort A–Z Notes
Online (sort lines) Paste the list, copy the result Works for text from any app; runs in your browser
Word for Windows (desktop) Select the list, Home > Sort, Sort by Paragraphs and Text, Ascending For one-level bulleted or numbered lists and plain paragraphs
Word for the web Not available Microsoft says lists cannot be sorted there
Google Docs No built-in command Use an add-on, Google Sheets or an online sorter
Excel Data tab > Sort & Filter > Sort A to Z Or the SORT function in Excel for Microsoft 365, 2021 and 2024
Google Sheets Right-click the column letter > Sort sheet A to Z Or Data > Sort range, or the SORT function

Alphabetize a list online

  1. Put one item on each line. If your list is separated by commas, put each item on a new line first (the text splitter does this).
  2. Paste it into the box “Your list (one item per line)” on the sort lines tool. “Sort by” is already set to “Alphabetical (A–Z)”.
  3. Tick any options you need: “Descending (Z–A, longest first)”, “Case-sensitive (Apple before apple; keep both when removing duplicates)”, “Ignore leading quotes, bullets and symbols” or “Remove duplicates”. “Remove empty lines” is ticked by default.
  4. Copy the result and paste it back where it came from.

Nothing is uploaded: the sorting runs in your browser. Here is the tool’s own sample list, before and after, with the default settings:

Before          After
banana          Apple
Apple           apple
cherry          banana
apple           Banana
                cherry
Date 10         Date 10
date 2          date 2
Banana          elderberry
elderberry

Notice two things. The blank line is gone, because “Remove empty lines” is on. And “Apple” and “apple” stay in the order you typed them: by default, uppercase and lowercase count as the same letter, so the tool does not reorder lines that differ only in case. With “Case-sensitive” ticked, the capitalized version comes first in each pair (“Apple, apple, Banana, banana”). It does not move all capitalized lines ahead of all lowercase ones: Zebra, apple, Olive, zoo still comes out as apple, Olive, Zebra, zoo.

After sorting, you can number the list with add line numbers or turn it back into a single line with the comma separator.

Alphabetize a list in Word

Microsoft’s instructions for Word for Microsoft 365, 2024, 2021, 2019 and 2016 on Windows:

  1. Select the list you want to sort.
  2. Go to Home and select Sort (in the Paragraph group).
  3. Set Sort by to Paragraphs and Text.
  4. Choose Ascending (A to Z) or Descending (Z to A).
  5. Select OK.

Word sorts paragraphs, so each item must be its own paragraph. Microsoft describes the feature for one-level bulleted or numbered lists, so flatten a list with sub-items, or sort each level separately, before you use it.

Word for the web cannot sort. Microsoft’s help page states that you can create numbered and bulleted lists there “but you can’t sort lists alphabetically”. Either open the file in the desktop app or copy the list into an online sorter, then paste the sorted lines back over the original.

Alphabetize a list in Google Docs

Google Docs has no sort command in its menus. There are three workarounds:

  • An add-on. Go to Extensions > Add-ons > Get add-ons, search for a sorting add-on, then click Install and Continue and allow the permissions it asks for. Check what access an add-on requests before you install it.
  • Google Sheets. Paste the list into column A of a blank spreadsheet, right-click the column letter and choose Sort sheet A to Z, then copy the column back into your document.
  • Online. Copy the list, sort it with the sort lines tool and paste it back.

Alphabetize a column in Excel or Google Sheets

In Excel, select a cell in the column, then on the Data tab, in the Sort & Filter group, choose Sort A to Z (or Sort Z to A). If the column sits next to other data, Excel asks whether to Expand the selection (keep each row together) or Continue with the current selection (sort this column only, which breaks the rows apart). For more control, choose Data > Sort: you can tick My data has headers so the header row stays on top, and under Options tick Case sensitive.

Microsoft’s page gives two warnings that also apply to lists pasted from elsewhere: remove leading spaces from imported data, and make sure a column does not mix numbers stored as numbers with numbers stored as text.

To keep a sorted copy that updates when the original changes, use the SORT function, for example =SORT(A2:A50). The optional third argument is 1 for ascending (the default) or -1 for descending. Microsoft lists it for Excel for Microsoft 365, Excel 2021, Excel 2024 and the mobile apps, so older versions such as Excel 2016 do not have it.

In Google Sheets, right-click the column letter and choose Sort sheet A to Z, or select the cells and choose Data > Sort range > Advanced range sorting options, where you can tick Data has header row. The formula version is =SORT(A2:A50, 1, TRUE); use FALSE for Z to A.

Why a sorted list can look wrong

Most surprises come from how computers compare text. These examples come from the sort lines tool with the default settings.

Problem Before After Fix
Numbers sort as text item 9, item 10, item 1 item 1, item 10, item 9 Sort by “Natural (2 before 10)”: item 1, item 9, item 10
Bullets and quotes • pears, “Zucchini”, - apples, * mangoes - apples, “Zucchini”, * mangoes, • pears Tick “Ignore leading quotes, bullets and symbols”: - apples, * mangoes, • pears, “Zucchini”
Leading spaces Oslo, ␣␣lisbon, Berlin ␣␣lisbon, Berlin, Oslo Tick “Ignore leading…”, or clean up with remove extra spaces
“The” in titles The Beatles, Abba, Pink Floyd Abba, Pink Floyd, The Beatles Remove or move “The” first; the tool sorts by the first word

(␣ stands for a space.) The “Ignore leading…” option only changes the comparison: the bullets, quotes and spaces stay in the output.

Accented letters sort next to their plain versions, so “Éclair” goes with the e’s and “Zoë” with the z’s:

Before After
Zoë, zebra, Éclair, eagle, Ångström, apple Ångström, apple, eagle, Éclair, zebra, Zoë

The tool uses your browser’s language settings for this comparison. In US English, Å sorts as A; with a Swedish browser setting it sorts after Z, as the Swedish alphabet expects.

Lines that begin with punctuation or digits come before lines that begin with letters. A list of #hashtag, (note), @user, 123 and abc keeps letters last: (note), @user, #hashtag, 123, abc.

To sort people by surname, put the surname first (“Smith, Anna”) before sorting. The tool sorts by the whole line from its first character, so “Anna Smith” sorts under A.

Remove duplicates while you sort

Lists merged from several sources usually contain repeats that differ only in capitals or spaces. Tick “Remove duplicates” in the sort lines tool and they are removed before sorting. Matching ignores case (unless “Case-sensitive” is ticked), spaces at the start and end and doubled spaces inside a line, and the first copy is kept:

Before          After (Remove duplicates on)
Oslo            athens
  lisbon        Berlin
Berlin          lisbon (with its two spaces)
                Oslo
Lisbon
athens
berlin
Oslo

That output also uses “Ignore leading quotes, bullets and symbols”; without it, “ lisbon” would sort first because of its spaces. If the order of the list matters and you only want the repeats gone, use remove duplicate lines instead. It keeps the original order, can keep the last copy rather than the first, and lists which lines were repeated. For a longer walk-through, see the guide to removing duplicates.

Questions

Can Word for the web sort a list alphabetically?

No. Microsoft's help page says that Word for the web can create bulleted and numbered lists but cannot sort them. Open the document in the Word desktop app, or copy the list into the sort lines tool and paste the result back.

Does Google Docs have a sort button?

Google Docs has no sort command in its own menus. You can install a sorting add-on from Extensions > Add-ons > Get add-ons, paste the list into a Google Sheets column and use Sort sheet A to Z, or sort it online and paste it back.

Why does "item 10" come before "item 9"?

Alphabetical order compares text one character at a time, and the character "1" comes before "9". Choose "Natural (2 before 10)" in the sort lines tool to compare the whole numbers instead.

How do I alphabetize a list and remove duplicates at the same time?

In the sort lines tool, tick "Remove duplicates". Matching ignores case (unless "Case-sensitive" is ticked), spaces at the start and end and doubled spaces inside a line, and the first copy is kept. To remove repeats without sorting, use remove duplicate lines.

How do I sort a list Z to A?

Tick "Descending (Z–A, longest first)" in the sort lines tool. In Word choose Descending in the Sort Text dialog, and in Excel or Google Sheets choose Sort Z to A.

Sources