List Shuffler — Randomize Line Order Online
Shuffle any list of lines into random order using Fisher-Yates. Optional trimming and blank-line filtering. Great for bucketing users into A/B tests, randomizing a playlist, or breaking alphabetical bias. 100% local.
Last updated:
Paste a list and get it back in random order. Uses Fisher-Yates for a uniform, unbiased shuffle. Optional whitespace trimming and blank-line filtering.
What is List Shuffler?
List shuffling is the elementary operation of putting things in random order. Its correctness is deceptively subtle — the widely-copied `arr.sort(() => Math.random() - 0.5)` produces a biased permutation because JavaScript's sort algorithm assumes a consistent comparator. The correct algorithm is Fisher-Yates (also called Knuth shuffle): iterate from the end, and swap each element with a random one from itself to the current position. This tool implements Fisher-Yates directly, so every possible ordering of your list is equally likely.
How to shuffle a list online
- 1Paste your list, one item per line.
- 2Toggle 'trim whitespace' and 'ignore empty lines' if needed.
- 3Click Shuffle — the output is a uniform random permutation.
- 4Click again for a fresh shuffle — each click uses a new random seed.
Use Cases
Randomize a playlist
Paste song titles, click shuffle, get a fair new order without your music app's questionable shuffle algorithm.
Break alphabetical bias in surveys
Shuffling answer choices in a survey removes primacy bias — respondents no longer favor the first item.
Randomize test-question order
For an exam bank, shuffle questions so cheating from a neighbor doesn't work.
Tips & Best Practices
- ▸Never use `arr.sort(() => Math.random() - 0.5)`. It's biased in every major JS engine — some elements are more likely to stay near their starting position.
- ▸Fisher-Yates is O(n) — it can shuffle millions of items in a fraction of a second.
- ▸For repeatable shuffles (unit tests), do it in code with a seeded PRNG. This tool always uses fresh Math.random.
Frequently Asked Questions
How does the shuffle work?
It uses Fisher-Yates (also known as Knuth) shuffle, which produces a uniform random permutation in O(n) time. Every possible ordering of your list is equally likely.
How is this different from Random Picker?
Random Picker returns a subset of size N; List Shuffler returns the full list in random order. Use Shuffler when you want to reorder without dropping anything.
Is the shuffle repeatable?
No — every click gets a fresh random ordering based on Math.random. If you need a repeatable / seeded shuffle (for testing), do it in code with a seeded PRNG like mulberry32.
Is my list uploaded anywhere?
No. All shuffling runs in your browser.
Related Tools
Regex Tester
Test regular expressions online. Live match highlighting, capture groups, and support for JavaScript flags (g, i, m, s, u, y).
Regex Replace
Find and replace text with a regular expression online. Supports every JavaScript flag (g, i, m, s, u, y), all backreferences ($1..$9, $&, $`, $', $<name>), and escape sequences (\n, \t) in the replacement. Live match-by-match preview and diff. 100% local.
Text to Speech
Convert text to spoken audio using your browser's built-in Speech Synthesis API. Pick from all voices installed on your OS, adjust rate, pitch, and volume. No account, no download, no upload — 100% local.
XML Formatter
Format, beautify, and validate XML documents online. Handles namespaces, CDATA sections, and mixed content.
SQL Formatter
Format and beautify SQL queries. Supports SELECT, JOIN, subqueries, CTEs, and multiple SQL dialects.
Case Converter
Convert text between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case, and more.