Sort Lines of Text
Sort a list alphabetically, numerically, by length or randomly.
Sort Lines
Instant online text processing
What does Sort Lines do?
Sort any list of lines with natural ordering that handles numbers inside text correctly, so item2 comes before item10. Options cover reverse order, case sensitivity, length sorting and shuffling.
How to Use Sort Lines
- 1Paste your linesOne item per line.
- 2Choose the sortAlphabetical, numeric, by length, or random.
- 3Copy the resultOr download it as a text file.
Key Features
- Alphabetical sorting with natural number ordering (item2 before item10)
- Numeric sort that reads the leading number on each line
- Sort by line length, ascending or descending
- Random shuffle for picking or randomising a list
- Case-sensitive option and reverse order
- Optional deduplication in the same pass
Frequently Asked Questions
What is natural sorting?
Ordering that treats digit runs as numbers, so file2 comes before file10. Plain alphabetical sorting compares character by character and puts file10 first, which is almost never what you want.
How does sorting handle accented characters?
Using the browser’s locale-aware collator, so é sorts next to e rather than after z. That matches how a dictionary in your language orders words.
Is the random shuffle fair?
It uses a Fisher-Yates shuffle, which gives every permutation equal probability. It draws on the standard random source, which is appropriate for ordering a list but not for anything security-sensitive.
Can I sort and remove duplicates at once?
Yes — switch on the deduplicate option. The list is sorted and duplicates dropped in one pass, with a count of what was removed.
Everything you paste stays in this page. Text tools run as JavaScript in your browser, so nothing is uploaded, logged or stored.
Related Tools
Remove Duplicate Lines
Strip repeated lines from a list, with a count of what went.
Text Cleaner
Strip formatting, HTML, smart quotes and invisible characters.
Reverse Text
Reverse text by character, word, line or sentence.
Add Line Numbers
Number every line of text, with control over format and start.
