How alphabetical sorting works
Alphabetical order arranges text by comparing it letter by letter from the start. This sorter uses your browser's language-aware comparison, so accented letters such as e and e-acute are placed next to each other, and capital letters do not split the list into two groups unless you ask for case sensitivity.
Numbers need special care. A plain comparison puts 10 before 2 because the character 1 comes before 2. Natural sorting reads whole numbers instead, so Chapter 2 comes before Chapter 10, as a person would expect. It is on by default and can be turned off.
How to sort a list
- Paste your list, with one item on each line.
- Choose how to sort: A to Z, Z to A, shortest or longest first, reverse the order, or shuffle.
- Set the options for natural number order, case sensitivity and empty lines.
- Press Sort lines.
- Copy the sorted list or download it as a text file.
Sorting options
- Alphabetical A to Z or Z to A: the standard dictionary order, ascending or descending.
- By length: puts the shortest or the longest lines first, handy for finding outliers or tidying code.
- Reverse: flips the current order, for example to put the newest entries first in a log.
- Shuffle: puts the lines in random order, useful for quiz questions, playlists and picking names.
Common uses
- Bibliographies and reference lists, which are normally listed alphabetically by author.
- Glossaries, indexes and lists of terms.
- Name lists for classes, teams and guest lists.
- Keyword, tag and category lists for websites and shops.
- Programming: sorting imports, configuration keys or lists of files.
Tips for a clean sort
- Remove duplicates first with the Remove Duplicate Lines tool.
- Make sure there are no spaces or bullets at the start of lines, since they affect the order.
- To sort names by surname, put the surname first, as in Smith, Anna, before you sort.
- Keep a copy of the original order if it carries meaning.
Sorting names, references and titles
Alphabetical order is simple for single words but needs a rule for names and titles. Reference lists are normally sorted by the author's surname, so write each line as Surname, Given name before you sort. Library and book lists often ignore leading articles such as the, a and an, so The Hobbit is filed under H. If you want that behavior, remove the article from the start of each line first, sort, and then put it back at the end.
Accented letters sort next to their plain versions, so an e with an accent is placed with the other e entries, and capital letters mix with small ones unless you turn on Case sensitive. Punctuation and symbols usually sort before letters, and digits come before letters. For long lists, run the Remove Duplicate Lines tool first so each entry appears only once.
Sorting numbers correctly
A list of plain numbers needs numeric order, not text order. In text order, 100 comes before 20 because the first character 1 is smaller than 2. With Natural number order switched on, the sorter reads whole numbers, so 20 comes before 100, and mixed lines such as file2 and file10 are ordered the way a person would expect. For lists of negative numbers or decimals, check the first lines of the result, because a minus sign or a decimal point is treated as text.
Plain sorting vs natural sorting
| Plain alphabetical order | Natural order |
|---|---|
| item 1, item 10, item 2 | item 1, item 2, item 10 |
| b, A, c, B | A, b, B, c (ignoring case) |
| Zoe, Anna, Mia | Anna, Mia, Zoe |
Frequently Asked Questions
How do I put a list in alphabetical order?
Paste the list, one item per line, choose Alphabetical A to Z and press Sort lines.
Can I sort Z to A?
Yes. Choose Alphabetical Z to A for reverse alphabetical order.
Why does 10 come before 2 in some sorters?
Plain sorting compares characters one by one. Natural number order, which is on by default here, fixes that.
Does the sorter care about capital letters?
Not by default. Turn on Case sensitive if you want capitals handled separately.
Can I sort lines by length?
Yes. Choose shortest first or longest first.
Can I shuffle a list?
Yes. The Shuffle option puts lines into random order.
Is my list saved or uploaded?
No. Sorting runs in your browser and nothing is uploaded.