Sort Lines
Sort the lines of a list alphabetically in Arabic or English, by length or by number, reverse them or shuffle them, with options to ignore the Arabic “al-” prefix and drop duplicates.
The tool
How to use
- Paste your list, one item per line.
- Pick a sort order and any options you need.
- Copy the sorted list.
Privacy & how it works
Processes your data in the browser and stores nothing.
- Engine: lightweight in-page code, no external libraries.
- Works offline after you open it once.
- Alphabetical sorting relies on Intl.Collator, available in all modern browsers.
Frequently asked questions
How is Arabic sorted?
In alphabetical order using the browser’s Arabic collation rules: hamza forms (أ إ) sort with alef, alef with madda (آ) counts as two alefs, and diacritics are ignored. In a mixed list, Arabic lines come before English ones.
What does ignoring the “al-” prefix do?
It files “الرياض” under ر and “المدينة” under م. The rule is simple: any line that starts with “ال” followed by two or more letters. A word where those letters are part of the name is treated the same way, so check such cases.
How does numeric sorting work?
It takes the first number in each line (Arabic-Indic digits, decimals and negatives are accepted) and sorts by it. Lines without a number go to the end in their original order.
Does alphabetical sorting understand numbers inside text?
Yes. “file 2” comes before “file 10” instead of being compared character by character.
Is the shuffle truly random?
It uses the Fisher–Yates algorithm with a pseudo-random generator in the browser. Fine for mixing names or study questions, not for official draws.