Sort Lines Alphabetically
- Lines
- 0
Everything runs in your browser. Your data never leaves your device.
What this tool does
Paste a list with one item per line and sort it in the order you choose: A to Z, Z to A, shortest or longest first, by the number in each line, in reverse, or shuffled at random. It handles English and Arabic, so it works for names, keywords, file lists, vocabulary, prices and more.
How to use it
- Paste your lines into the first box.
- Choose a Sort order and any options.
- Copy the sorted list from the result box.
Sort orders
- A → Z / Z → A: alphabetical order. Numbers inside text are compared by value, so item2 comes before item10.
- Shortest or longest first: sorts by the number of characters in each line.
- By number: uses the first number found in each line. Western digits (0-9) and Eastern Arabic digits (٠-٩) both work, and decimals and negatives are understood.
- Reverse current order: flips the list upside down without sorting it.
- Shuffle randomly: mixes the lines, which is useful for draws and quizzes.
Options
- Ignore upper/lower case is on by default, so “apple” and “Banana” sort together as you would expect.
- Remove empty lines deletes blank lines.
- Remove duplicate lines keeps only one copy of each line.
Example: the lines “pear, Apple, banana” sort A to Z as “Apple, banana, pear”. The prices “$12, $3, $25” sorted low to high become “$3, $12, $25”.
Everything runs in your browser and your list is never uploaded.
Frequently asked questions
Does it sort Arabic words in the correct alphabetical order?
Yes. On the Arabic page the tool uses Arabic collation, so words sort in the order of the Arabic alphabet from alif to yaa, not by raw character codes.
Why does item2 come before item10?
The sort is "natural", so numbers inside text are compared by value. item2 comes before item10, as you would expect in a list.
What happens to lines with no number when sorting by number?
Lines without a number are placed at the end, in alphabetical order, whether you sort low to high or high to low.
Can I sort and remove duplicates at the same time?
Yes. Tick "Remove duplicate lines" and the repeated lines are removed before the list is sorted.