Text Tools

How to Alphabetize Lists – and Why “Item 10” Comes Before “Item 2”

Sorting a list sounds trivial until numbers, capitals and accents get involved. Here is how to get the order you actually expect.

In this article
  1. Alphabetical order basics
  2. Natural sort fixes numbers
  3. Which sort for which list
  4. How to sort
  5. Sorting surnames
  6. Fair random order
  7. Sorting other languages
  8. Sorting in spreadsheets vs here
  9. Numbering after sorting
  10. Clean before you sort

Alphabetical order basics

Simple alphabetical sorting compares text character by character. That works for plain words, but creates three classic surprises:

  • Numbers inside text: “item 10” comes before “item 2”, because “1” is before “2”.
  • Capitals: some tools put all capitalised words before lowercase ones.
  • Accents: “Émile” may end up after “Zara”.
Sort Lines (Alphabetical Order)Sort any list A–Z or Z–A, in natural or numeric order, by length, or shuffle it randomly. Remove duplicates and empty lines in the same step. Free and instant.
Open the free tool

Natural sort fixes numbers

Natural order reads numbers as numbers, so you get item 1, item 2 … item 10. It is how people expect file names, chapter lists, versions and room numbers to be ordered. The Sort Lines tool uses your browser’s language-aware rules, so accented letters sit next to their plain versions too.

Which sort for which list

ListBest order
Names, guests, studentsA → Z (case-insensitive)
Files, chapters, versionsNatural
Prices or scores in each lineBy number in the line
Short phrases first (e.g. for tags)Shortest first
Presentation order, rafflesShuffle randomly
Newest first instead of oldestReverse current order

How to sort

  1. Paste your list into Sort Lines, one item per line.
  2. Choose the order.
  3. Tick “Remove duplicates” if needed; keep “Trim spaces” and “Remove empty lines” on for lists copied from spreadsheets.
  4. Copy the sorted list.

Sorting surnames

To sort people by surname when the list says “Ali Khan”, flip the names first. With Find and Replace using regex, find ^(\S+) (\S+)$ and replace with $2, $1 to get “Khan, Ali” – then sort.

Fair random order

For raffles, team picks and presentation order, the shuffle uses your device’s secure random number generator and the Fisher–Yates method, which gives every possible order an equal chance. For a public draw, shuffle in front of everyone or share your screen so the result is trusted.

Sorting other languages

Alphabetical order differs between languages: in Swedish, “Ä” comes after “Z”; in Spanish dictionaries, “ñ” follows “n”. The tool follows your browser’s language rules, which suits most lists. Urdu and Arabic words are sorted by their own alphabet order. If a list mixes scripts, each script is grouped together, which is usually what readers expect.

Sorting in spreadsheets vs here

Spreadsheets sort columns well, but a quick list in an email, a chat or a document is faster to paste here. Copy one column from Excel or Google Sheets, sort it, and paste it back.

Numbering after sorting

Need a numbered list once it is in order? Paste the sorted list into a word processor and apply numbering, or use Find and Replace to add a dash or bullet to the start of every line with the pattern ^. Keep the numbers out of the list while sorting – otherwise “10. Zainab” sorts by the number, not the name.

Clean before you sort

Sort Lines (Alphabetical Order)Sort any list A–Z or Z–A, in natural or numeric order, by length, or shuffle it randomly. Remove duplicates and empty lines in the same step. Free and instant.
Open the free tool
Keep reading

Related articles

All articles
Text

How to Clean Email, Phone Number and Keyword Lists in Seconds

Lists collected from several places always contain repeats. Sending to the same person twice or paying for duplicate keywords is avoidable – here is how.

3 min read
Text

Title Case, Sentence Case, camelCase and More – When to Use Each

Capital letters change how professional text looks, and in code they can break things. Here is a practical guide to every common case style.

3 min read
Text

How to Compare Two Versions of a Document and Spot Every Change

“I only changed a few words” – but which ones? Comparing two versions side by side shows every addition and deletion, so nothing slips past you.

3 min read