Text Line Sorter
Sort lines of text alphabetically, in reverse, or shuffle them randomly, with optional duplicate removal, blank-line filtering, case-insensitive ordering, and a line count.
FreeOnline Tool
Loading…
How to Use
- Paste or type the text you want to sort into the input box; each line is treated as one item.
- Choose the mode: ascending (A-Z), descending (Z-A), or random shuffle.
- Optionally tick "Remove duplicate lines" and "Ignore blank lines".
- Click the "Sort" button and check the result on the right.
- Copy the sorted text to use it.
Features
- Three modes: ascending lexicographic order, descending order, and random shuffle.
- Optional duplicate removal that keeps only unique lines.
- Optional blank-line filtering to strip empty lines out of the text.
- Case-insensitive sorting, so A and a are treated as the same letter.
- Displays the resulting line count.
Use Cases
Tidying up word lists
Sort a collected list of vocabulary, keywords, or tags alphabetically and drop the duplicates to get a clean list in seconds.
Ordering configuration entries
Sort enumerated values and environment variable lists in config files so the file stays consistent and easy to review.
Deduplicating exported data
Clean up a list exported from a database or report by removing repeated entries and keeping only unique values for analysis.
Randomizing an order
Shuffle an ordered list for A/B test group assignment, randomized survey questions, or simple random sampling.
FAQ
What ordering rule is used?
Lines are sorted lexicographically by Unicode code point. Numbers sort as characters rather than by value, so 10 comes before 2. Pad numbers to the same width first if you need numeric order.
Can it sort Chinese text?
Yes, though Chinese characters sort by their Unicode code points. That is an encoding order, not pinyin order and not stroke order. Pinyin sorting requires a dedicated Chinese sorting tool.
Does removing duplicates change the order?
Deduplication runs after sorting and keeps the first occurrence of each repeated line. Deduplicating first would give the same result, since identical values end up adjacent once sorted.
How much text can it handle?
Tens of thousands of lines are fine as long as browser memory allows. For datasets in the millions of lines, command-line tools such as sort and awk are far more efficient.