How to use the sort Lines
- Choose the sort order from the list.
- Type or paste into the Lines to sort box.
- Tick Ignore upper/lower case if you want that option; leave it clear otherwise.
- Tick Remove empty lines if you want that option; leave it clear otherwise.
- The result updates instantly as you type. There is no button to press.
- Use Copy result to copy the figures, or Copy link to share a link that reopens the sort Lines with the same inputs.
How it works
Alphabetising a list by hand is slow and error-prone. Paste a list here, one item per line, and choose how to order it: alphabetically in either direction, by the numbers in each line, by line length, or simply reversed. The sorted list appears instantly, ready to copy.
The alphabetical sorts use natural ordering, which treats runs of digits as numbers rather than individual characters. A plain computer sort puts "Item 10" before "Item 2", because the character "1" comes before "2". Natural sorting puts them in the order a person would expect: Item 1, Item 2, Item 10. It also uses your browser's language-aware collation, so accented letters such as "é" sort next to "e" rather than after "z".
With Ignore upper/lower case ticked, "apple" and "Apple" are treated as equal, so capitalised words aren't all pushed to the top. The numeric sorts look for the first number in each line, including negatives and decimals, so you can sort lines like "Order 1,250 – shipped" by amount. Lines without a number go to the end. The length sorts are handy for spotting outliers in data or arranging tags.
Formula
Example
Sorting Banana, apple, Item 10, Item 2, cherry, Item 1 from A to Z, ignoring case, gives apple, Banana, cherry, Item 1, Item 2, Item 10. Without natural ordering, Item 10 would come before Item 2. Sorting the same list by length, shortest first, gives apple, Banana, cherry, Item 1, Item 2, Item 10.
Frequently asked questions
What is natural sort order?
Natural sorting compares numbers inside text by their value, so 'file2' comes before 'file10'. It's how most people expect lists of numbered items to be ordered.
Can I sort and remove duplicates at the same time?
Use the remove duplicate lines tool first, then paste the result here, or the other way round. Both keep everything in your browser.
How are accented letters sorted?
The sort uses your browser's language-aware collation, so letters such as é, ñ and ü sort alongside their unaccented versions.