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 pageIn 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 sort | Natural sort |
|---|---|
| Chapter 1 | Chapter 1 |
| Chapter 10 | Chapter 2 |
| Chapter 11 | Chapter 3 |
| Chapter 2 | Chapter 10 |
| Chapter 3 | Chapter 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.
| Language | Rule | Example order |
|---|---|---|
| English | Accents ignored for order | cafe, café, cake |
| Spanish | Ñ is a separate letter after N | nube, nuez, ñandú |
| German | Ä sorts with A, Ö with O, Ü with U | Apfel, Äpfel, Arm |
| Swedish | Å, Ä, Ö come after Z | Zorn, Åsa, Äng, Öl |
| Turkish | Ç, Ğ, I, Ö, Ş, Ü are separate letters | cam, ç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.