Line Sorter
Sort a list of lines alphabetically, numerically, or shuffle them into a random order.
How it works
A → Z and Z → A sort lines alphabetically using locale-aware, case-insensitive comparison, so "Apple" and "banana" sort by letter regardless of capitalisation. Numeric mode reads the leading number of each line and sorts by its value, placing any line that is not a number at the end while keeping their relative order unchanged. Shuffle uses the browser's cryptographically secure random number generator to produce a genuinely unpredictable Fisher-Yates shuffle, not a predictable Math.random() order.
Example
Sorting banana, Apple, cherry (one per line) A → Z gives Apple, banana, cherry — case ignored. Sorting 10, 2, 1 numerically gives 1, 2, 10, not the alphabetical 1, 10, 2 you would get from a plain text sort.
Frequently asked questions
Why does A → Z put "Apple" before "banana"?
The sort is case-insensitive, comparing letters regardless of capitalisation — so "Apple" and "apple" would sort identically, both before "banana".
How does Numeric sort handle lines that aren't numbers?
Non-numeric lines are placed at the end, in their original relative order, since they have no numeric value to compare by.
Is Shuffle truly random?
It uses the Web Crypto API's cryptographically secure random number generator with a Fisher-Yates shuffle, giving an unbiased random order rather than the predictable pattern Math.random() can produce.
Does sorting remove duplicate lines?
No — sorting only reorders lines; use the Duplicate Line Remover tool first if you also want to remove repeats.
Related tools
Count words, characters, sentences and paragraphs instantly, with an estimated reading time.
Case ConverterConvert text between UPPER, lower, Title, Sentence, camelCase, snake_case and kebab-case.
Text Diff CheckerCompare two blocks of text line by line and see exactly what was added, removed or changed.