How to sort a list alphabetically

A list of products, customer names or shipping cities that you want in alphabetical order so you can find anything quickly. Sorting sounds simple, but Arabic and numbers make it harder than you might expect.

Published · 2 min read

Why does “item 10” come before “item 2”?

Plain sorting compares characters one at a time, sees “1” before “2”, and puts “item 10” before “item 2”. Numeric sorting reads the whole number and compares its value, so 2 comes before 10 as you would expect. It understands Arabic-Indic digits like ٢ and ١٠ too.

Worked example

The list: item 10, item 2, item 1.

Without numeric sorting it becomes: item 1, item 10, item 2.

With numeric sorting it becomes: item 1, item 2, item 10.

And in Arabic with numeric sorting: «منتج ١٠», «منتج ٢» and «منتج 3» become «منتج ٢», then «منتج 3», then «منتج ١٠».

Sorting that understands the language

The tool uses the ordering rules built into your browser for each language, not raw character codes. So «بن», «تمر», «زعفران» and «هيل» come out in Arabic alphabetical order. Choosing Arabic rules puts Arabic lines first, and English rules put English lines first.

How to do it

  1. Open the Line sorter and paste your list, one item per line.
  2. Choose the sorting rules: Arabic, English or by page language, and ascending or descending.
  3. Turn on numeric sorting if the lines contain numbers, and pick the other options.
  4. Press “Sort”, then copy or download the result.

What to know

  • Numeric sorting understands whole numbers only: no minus signs, decimals or thousands separators.
  • The exact order comes from your browser's data, so small details can differ between browsers.
  • The remove-duplicates option drops exactly identical lines only. For more options, such as ignoring diacritics, use the Duplicate-line remover.

If you want the digits in the whole list to match, Arabic and Western alike, convert them first with the Arabic/Persian/Western digit converter.

Common questions

Are «أحمد» and «احمد» treated as the same?

The sorting rules place them next to each other, but they stay two different lines exactly as you typed them.

Do equal items keep their order?

Yes, equal items keep their original order.

Is my list sent to a server?

No, sorting happens inside your browser.