How to use the sort lines
- Paste one item per line.
- Pick a sort order.
- Copy the sorted result.
About this tool
Paste a list and sort it alphabetically, in reverse, by number, or by line length. A to Z uses natural ordering, so item2 comes before item10. You can also reverse the order or shuffle randomly, and drop blank lines.
Natural sorting
Plain alphabetical sorting puts item10 before item2, because it compares one character at a time. A to Z here uses natural ordering, so item1, item2, item10 come out in the order people expect, and the same applies to file names with numbers.
The sort modes
- A to Z and Z to A sort as text, with an option to ignore case.
- Numbers up and Numbers down sort by the first number found in each line, so "₹1,200" and "15 kg" work. Lines with no number count as zero.
- Shortest first and Longest first sort by the number of characters.
- Reverse flips the current order without sorting.
- Shuffle puts the lines in random order, using your browser secure random generator, which is handy for draws and for picking winners.
Tips
Run the list through Remove Duplicate Lines after sorting to get a clean, unique, ordered list. Tick Remove empty lines to drop blanks. Sorting follows your browser language settings for accented letters, so the order of non-English text can differ slightly between devices.
What it cannot do
It sorts whole lines, not columns. Sorting a list of IP addresses works only partly, because each part is compared as a number in sequence, so for strict IP order use a dedicated tool. Dates in a day-month-year format sort as text, so convert them to year-month-day first.
Frequently asked questions
Does it sort numbers correctly?
A to Z uses natural ordering, so item2 comes before item10. Numbers up and down sort by the first number in each line.
Can I sort and remove duplicates?
Yes. Sort here, then paste into the remove duplicates tool.
Is my list uploaded?
No. Everything runs in your browser. Nothing is uploaded.
How do I sort a list alphabetically in Excel?
Select the column and use Data, then Sort A to Z. This page is quicker when your list is not in a spreadsheet.
Does shuffle give a fair result?
Yes. It uses a standard Fisher-Yates shuffle with a cryptographic random source, so every ordering is equally likely.