Line Sorter & Shuffler
Sorts lines alphabetically, numerically, by length or randomly, with reverse and case options.
Sorts a list of lines, with the collation stated rather than assumed: natural order for anything with numbers in it, 가나다 for Korean, a named locale, raw code points, length, or a genuine shuffle. Each of those gives a different answer to the same list.
Lines
Order
Digit runs compare as numbers, so file9 comes before file10.
Sorted
Lines
6
How to use it
Pick the mode before anything else
Natural for filenames and versions, 가나다 for Korean names, code point only when you specifically want the machine order that Array.sort gives.
Set the direction and case rule
Case-insensitive is the default because a list of names is rarely meant to put every capital before every lower-case letter, which is what a case-sensitive sort does.
Shuffle when you need randomness
The shuffle is a Fisher–Yates pass, not a random comparator. A random comparator is the classic wrong way to shuffle: it is biased, and different engines give different distributions.
Common questions
Why is file10 before file9?
That is code-point order — "1" sorts before "9" one character at a time. Switch to natural order, which compares digit runs as numbers, and file9 comes first.
My Korean list sorts oddly
Two causes. Text copied from a Mac is stored decomposed and sorts before every precomposed syllable, and code-point order puts Latin before Hangul where Korean convention puts it after. The 가나다 mode fixes both.
What does the locale mode do differently?
It uses that language’s own collation table — Swedish puts å after z, German has two conventions for ä, Czech treats ch as one letter. If none of that applies to your list, natural order is the better default.
Feed it from
Duplicate Line Remover
Removes duplicate lines, keeps only duplicates, or counts how many times each line appeared.
Line Numbering
Adds or removes leading line numbers with a start value, step, padding and separator.
Text Reverser
Reverses a string, the words in it, or the order of lines — grapheme-aware, so emoji survive.
List Formatter
Turns lines into a comma list, quoted SQL IN clause, JSON array or bullet list, and back again.
Next
These accept what this tool produces, so the result can go straight in.
List Formatter
Turns lines into a comma list, quoted SQL IN clause, JSON array or bullet list, and back again.
Random Picker
Picks one or several entries from a pasted list, with weights and an optional spinning wheel.
Word & Character Counter
Counts characters with and without spaces, words, lines, paragraphs and UTF-8 bytes.
Duplicate Line Remover
Removes duplicate lines, keeps only duplicates, or counts how many times each line appeared.
Find & Replace
Replaces text by literal, whole word or regular expression, with capture groups and a preview of every hit.
Markdown Editor
Edits Markdown with a live preview and exports the rendered HTML, with GFM tables and task lists.