Sort Text Lines
Sort text lines online: A to Z, Z to A, numeric, by length, reversed or shuffled. Natural order, case-insensitive and duplicate removal, all in your browser.
How to use Sort Text Lines
- 1Paste your list with one item per line, or open a text file.
- 2Pick an order and switch the options you need, such as natural sort or remove duplicates.
- 3Copy the sorted list or download it as a text file.
What makes it better
- Seven orders: A to Z, Z to A, numeric up or down, length, reverse and shuffle
- Natural sort keeps item2 before item10
- Optional removal of blank lines and duplicates while sorting
- Accent-aware ordering using your browser's own collation rules
- Shuffle uses the browser's secure random generator
About Sort Text Lines
Sort Text Lines puts a list in order, one item per line. Choose alphabetical, numeric, length-based, reversed or random order, and decide whether item2 should come before item10. Sorting follows your browser's language rules, so accented letters land where readers expect them.
Common uses
- Alphabetise a glossary, a list of names or a set of tags before pasting it into a document.
- Order file names such as chapter2.txt and chapter10.txt the way a person would expect.
- Sort a column of prices or IDs from smallest to largest.
- Shuffle a list of names to draw a random order for a presentation or giveaway.
Example
Input
item10 banana Item2 apple item1 cherry
Result
apple banana cherry item1 Item2 item10
Good to know
- Each line is one item; a single line break at the very end of the text is ignored.
- Numeric order reads the first number on each line. Lines without a number are placed at the end.
- Duplicates are matched using the same case and leading-space settings as the sort, and the first occurrence is kept.
Sort Text Lines FAQ
How do I sort a list alphabetically without a spreadsheet?
Paste the list with one item per line and keep the A to Z order selected. The sorted list appears at once and can be copied back into your document.
What does natural sort do?
It compares digit runs as numbers instead of character by character, so item2 comes before item10. Without it, item10 would sort before item2 because 1 comes before 2.
Is the sort case-sensitive?
By default it ignores case, so apple and Banana are ordered by their letters. Turn the option off to make uppercase and lowercase count as different, which follows your browser's collation order.
Can I sort numbers that have decimals or negative signs?
Yes. Numeric order reads the first number on each line, including a leading minus and decimals such as -3.5. Thousands separators are not understood, so 1,200 is read as 1.
Is the shuffle really random?
It uses the browser's cryptographic random generator with a Fisher–Yates shuffle, so every order is equally likely. Change any option and the list is shuffled again.