Formula
A to Z: compare lines piece by piece, treating runs of digits as whole numbersby number: sort on the number a line starts with
- Natural order puts item2 before item10 because 2 < 10
- Lines without a leading number go to the end in numeric modes
Each line is compared with the others using your language's alphabetical rules, then placed in order.
Worked examples
Natural alphabetical order
- Your lines
- item10 Banana item2 apple Cherry item1
- Order
- A to Z
- Upper and lower case
- Ignore case (apple = Apple)
- Remove blank lines
- No
- Remove duplicate lines
- No
Lines
6
Order: Sorted A to Z
apple Banana Cherry item1 item2 item10
Numbers in front of words
- Your lines
- 10 apples 2 pears 300 plums notes
- Order
- By leading number, lowest first
- Upper and lower case
- Ignore case (apple = Apple)
- Remove blank lines
- No
- Remove duplicate lines
- No
Lines
4
Order: Sorted by number, lowest first
2 pears 10 apples 300 plums notes
How it works
Alphabetical order uses your browser's language-aware comparison, so accented letters sort next to their base letters and numbers inside text are read as numbers: item2 comes before item10, which a plain character-by-character sort would get wrong. The case option decides whether Apple and apple are treated as equal. Reverse order simply flips the list you pasted, and shuffle uses the browser's secure random generator for a fair, unbiased shuffle.
Numeric sorting reads the number at the start of each line, including thousands separators such as 1,500 and negative or decimal values, and orders by that value. Lines that do not begin with a number are placed at the end and the result notes how many there were. Length sorting counts characters, with ties broken alphabetically, which helps when you want the longest entries first.
You can also strip blank lines and remove duplicates in the same pass. To only deduplicate while keeping the original order, use Remove Duplicate Lines; to count what is in the list, use the Word Counter; and to change the capitalisation of every line, use the Case Converter.
Assumptions and limits
- Alphabetical order follows your browser's language settings.
- Numeric sorting uses the number at the very start of each line only.
- Shuffling gives a different order each time you run it.