Shuffle Lines
Put a list of lines into random order. Free, and runs entirely in your browser — nothing you enter is uploaded, stored or sent to a server.
About Sort Lines
Sorting a list sounds trivial until the result looks wrong. A plain computer sort compares character codes: capitals come before lowercase, item10 comes before item2, and accented letters land after z. This offers the orders people actually mean.
Natural order reads runs of digits as numbers, so file2 comes before file10. Alphabetical follows your language's collation, so é sorts with e. Leading number sorts by the number each line starts with, keeping lines without one at the end. Length counts characters, not bytes, so emoji and accents count as one each. You can also reverse the current order, or shuffle it with a cryptographically random, unbiased shuffle.
Duplicates, empty lines and stray spaces can be removed in the same pass, and a case-insensitive comparison treats Apple and apple as the same.
Where it helps
- Natural and locale-aware orders, so numbers inside text and accented letters sort the way people expect.
- Removes duplicates, empty lines and surrounding spaces in the same pass.
- Shuffles with crypto.getRandomValues and an unbiased algorithm, so every order is equally likely.
- Handles up to 200,000 lines in the browser without sending them anywhere.
Limits
- It sorts whole lines. To sort a CSV by one of its columns, use the table viewer in Structured Formats.
- Alphabetical order follows your browser's language, so the same list can sort slightly differently for readers in different locales.
Frequently asked questions
What is natural sort order?
An order that reads a run of digits as one number instead of character by character. A plain sort puts img12 before img2 because 1 comes before 2. A natural sort puts img2 first because 2 is less than 12. It is how file managers list files.
Why do capital letters sort first in other tools?
Because they compare character codes, and every capital letter's code is lower than every lowercase one. Turn on Ignore case here, or leave it off: the comparison still uses proper collation, which puts a before B.
Is the shuffle truly random?
Yes. It is a Fisher–Yates shuffle driven by crypto.getRandomValues, with rejection sampling so no order is favoured. That is suitable for drawing lots or randomising a test order.
Related tools
- Duplicate Remover — Remove, isolate or list duplicate lines
- Whitespace Remover — Trim, collapse and normalise whitespace
- Case Converter — Switch between sentence, camel, snake and other cases
- Text Comparison — Line-by-line diff of two blocks of text
- Markdown Viewer — Read a Markdown file the way it is meant to look, with its contents beside it
- Markdown to HTML — Convert Markdown to HTML you can paste somewhere, with the rendered page beside it
More Text Tools tools
- Markdown Viewer — Read a Markdown file the way it is meant to look, with its contents beside it
- Markdown to HTML — Convert Markdown to HTML you can paste somewhere, with the rendered page beside it
- Case Converter — Switch between sentence, camel, snake and other cases
- Word Counter — Count words, characters, sentences and reading time
- Text Comparison — Line-by-line diff of two blocks of text
- Duplicate Remover — Remove, isolate or list duplicate lines
- Whitespace Remover — Trim, collapse and normalise whitespace
- Sort Lines — Sort lines alphabetically, naturally, by number or length, reverse them, or shuffle them