Shuffle the order of any list using a true Fisher-Yates random shuffle.
Randomly reorder the lines of any text using a uniform shuffle algorithm. Paste a list, click shuffle, get a randomized version. Useful for randomizing test orders, picking lottery winners, generating random playlists, and breaking sorted bias in any line-based data. Everything runs locally in your browser; nothing is uploaded.
Shuffling means producing a random permutation of the input — every line still appears, but in a different order. A good shuffle has two properties: every possible ordering is equally likely (uniform distribution), and the algorithm doesn't introduce bias toward keeping nearby items near each other. Naive sort-by-random-key shuffles fail the first property; this tool uses Fisher-Yates, the standard correct algorithm, which guarantees both.
The output contains exactly the lines you put in, in random order. No lines are added, removed, modified, or duplicated. Run the same input through twice and you'll get two different orderings — which is the point.
Randomizing test or quiz question order. Teachers and trainers shuffle question banks before generating a new test version, preventing students from sharing answers by question number. Shuffle the question list, generate version A; shuffle again, generate version B.
Picking winners from a list. A list of contest entries, raffle tickets, or potential candidates. Shuffle the list and take the top N. Defensible, reproducible if you keep the seed (this tool doesn't expose seeds for simplicity, but you can document the input list and date for auditability).
Generating random playlists or rotation orders. A list of songs, articles, or work assignments that need to be rotated without bias. Shuffle, save the order, work through it sequentially.
Randomizing user or test data. A list of test users for a phased rollout, a list of cells for a sample treatment in research. Shuffle to break any latent ordering effects.
Generating creative writing prompts. A list of plot elements, character traits, or setting details. Shuffle to produce unexpected combinations that a human ordering would have missed.
Breaking accidental sorting. Sometimes you have data that's been alphabetized or chronologically ordered for reasons that no longer apply, and downstream consumers expect random order. Shuffle to neutralize.
A/B test assignment. Splitting a list of users into two groups for an A/B test starts with shuffling. Shuffle the list, take the first half as group A and the second as group B — both groups have random membership, which is what you want.
A common mistake is to shuffle by sorting on a random key: assign each item a random number, sort by that number. This sounds correct but produces biased orderings in practice.
The bias comes from how sort algorithms compare elements. JavaScript's Array.prototype.sort() uses Timsort or similar, which makes O(n log n) comparisons. If your "compare" function returns a random number each time, you're answering "is A less than B?" inconsistently — sometimes yes, sometimes no, depending on what random number comes up. The sort algorithm gets confused, produces non-uniform results, and certain orderings become more likely than others.
The fix is the Fisher-Yates shuffle: walk through the array from the last element to the first, and at each position swap with a randomly chosen earlier element. This produces every permutation with exactly equal probability and runs in O(n) time. This tool implements Fisher-Yates correctly.
The shuffle uses JavaScript's Math.random() as its randomness source. This is a pseudo-random number generator — sequence is determined by an internal state that's seeded from system entropy at page load. The output is statistically uniform and perfectly fine for shuffling test questions, picking raffle winners, generating playlists, or any application where adversarial prediction isn't a concern.
For applications where someone could benefit from predicting your shuffle (cryptographic key generation, secure lottery systems, gambling), Math.random() is not acceptable. Use a cryptographically secure source like crypto.getRandomValues() in a custom implementation, or a hardware random number generator.
For everything else — and that's almost everything — Math.random() is what you want.
Shuffling doesn't deduplicate. If your input has duplicate lines, the output also has duplicate lines, just in different positions. To dedupe before shuffling, run the input through Remove Duplicates first.
Shuffle is not the same as sample. Shuffling produces a random ordering of all your lines. Sampling produces a random subset. If you want N items chosen randomly from a larger list, shuffle and take the first N — but realize you've used the whole list, not just the sample size.
"Random" can produce surprising patterns. Real random output sometimes contains runs, clumps, and apparent patterns. If your shuffled list has 5 items in alphabetical order in a row, that's not a bug — it's expected to happen occasionally with truly uniform shuffling. Reshuffle if it bothers you.
Reproducibility. This tool doesn't expose a seed input, so you can't reproduce a specific shuffle. If you need reproducibility (for an audit trail or test fixture), keep a snapshot of the shuffled output — don't expect to recreate it from the input alone.
Three common ways to shuffle, three different contexts.
This tool — fastest for small to medium line lists in a browser, no install, runs locally. Good up to a few hundred thousand lines.
The shuf command on Unix, or sort -R as a portable alternative — best for very large files, scriptable, integrates into pipelines. shuf is the right choice for files too large to comfortably paste into a browser, or for automated pipelines that shuffle as part of larger workflows.
Python's random.shuffle() — best when shuffling is one step in a larger script, or when you need to seed the shuffle for reproducibility (random.seed(42); random.shuffle(items) always produces the same shuffle).
Paste text into the input box. The tool splits the text on line breaks, applies the Fisher-Yates shuffle to the resulting array, and joins the results back with newlines for output. Empty lines are treated like any other line — they're shuffled along with everything else, not stripped.
Implementation runs in O(n) time and constant additional memory. Multi-megabyte inputs shuffle in well under a second on modern hardware.
Always shuffle the same source twice for sanity-check. If you're using shuffle output as the basis for an audited decision (a winner, a sample group), shuffle the input three times and verify the three outputs are different. If they're identical, something is wrong with the randomness source.
For very long lists, sample after shuffling. Need 50 random items from a list of 5,000? Shuffle the whole list, take the first 50. Don't try to sample 50 random indices directly — Fisher-Yates is the cleanest way to guarantee uniform sampling without replacement.
For reproducibility, snapshot the output. Save the shuffled output to a file with a timestamp before using it for any decision. The shuffle itself isn't reproducible, but the result is.
Statistically yes — uniform distribution across all possible orderings. Cryptographically no — uses a pseudo-random number generator that's predictable to anyone who can determine its internal state. For everyday use this distinction doesn't matter; for security-sensitive applications it does.
Yes. The shuffle reorders lines but doesn't add, remove, or merge them. If "apple" appears three times in input, "apple" appears three times in output, in random positions.
Empty lines are treated as ordinary lines and shuffled along with the rest. They're not stripped. If you want them removed, run the input through the Remove Spaces tool with the "remove line breaks" mode first, or strip them manually.
Not directly. Split the list manually, shuffle the portion you want shuffled, then concatenate back together.
This tool doesn't support synchronized shuffling. The standard technique is to combine the lists into a single list with a delimiter (line 1: "list1_item1 | list2_item1"), shuffle, then split back. Or use a script with random.shuffle and an index permutation.
That's the point. Each click invokes a fresh random number sequence seeded from system entropy. Reproducibility requires saving the output, not regenerating it.