Line & Word Shuffler

Randomly shuffle the lines or words of any pasted list — cryptographically random, one click for a fresh order every time.

1,154 views

How It Works

Paste a list (one item per line) or a block of text, choose to shuffle by line or by word, and the tool runs a Fisher-Yates shuffle seeded by crypto.getRandomValues — the same cryptographically strong random source, with the same modulo-bias avoidance, used by this site's dice roller, random number generator, and giveaway-picker tools. Fisher-Yates works from the last item backward: for each position, it picks a random remaining index and swaps it in, so every possible ordering of the list is equally likely, with no bias toward any position.

The bias-avoidance detail matters more than it sounds. A naive random index generated as Math.random() * n, or worse, a cryptographically random integer reduced with % n, is not perfectly uniform when n does not evenly divide the generator's range — certain positions come up very slightly more often than others. Over a handful of shuffles nobody would notice; over a quiz platform running thousands of shuffles a day, a slight bias in question order or giveaway-entry order is a real fairness problem. This tool rejects and re-draws out-of-range values instead of reducing them with modulo, so every shuffle stays unbiased regardless of list length.

It is the exact same shuffling principle that powers this site's dice roller and random-number tools, just applied to an array of lines or words instead of a single number: pick uniformly among the remaining unshuffled items, place it, and repeat until none are left. That guarantee — every permutation of the input is equally reachable — is what separates a fairness-grade shuffle from one that merely looks scrambled but quietly favors certain arrangements.

What to Know

  • Line mode treats each line as one unit to shuffle — ideal for randomizing a name list, a reading order, or a set of quiz questions.
  • Word mode splits on spaces, shuffles the words, and rejoins them — good for scrambling a single sentence or short phrase.
  • Genuinely random, not pseudo-random-looking: the crypto source used here is the same class of randomness used for cryptographic keys, not the weaker default random function built into most languages.
  • Nothing is stored: the shuffle runs entirely in your browser and produces a new, independent order every time you click — refreshing gives a different result, not a repeat.

Frequently Asked Questions

Is the shuffle truly random?

Yes — it uses an unbiased Fisher-Yates shuffle driven by crypto.getRandomValues, not Math.random(), with out-of-range draws rejected rather than reduced by modulo, so every ordering is equally likely regardless of list length.

Can I shuffle words within a single sentence?

Yes — switch to word mode and it splits on spaces, shuffles, and rejoins.

Why not just use Math.random()?

Math.random() is a fast pseudo-random generator meant for graphics and animation, not fairness-sensitive selection, and naively reducing its output to a range with modulo introduces a small statistical bias. crypto.getRandomValues is a cryptographically strong source built for exactly this kind of unbiased random choice.

What real-world tasks is this good for?

Randomizing quiz or exam question order, shuffling names before a random task or seat assignment, mixing up a giveaway entry list before drawing, or breaking up a reading list into a fresh order each time.

Will shuffling the same list twice give the same order?

No — each shuffle draws fresh random values, so two runs on the identical input produce independent, generally different orderings, exactly like shuffling a physical deck twice.

Comments

No comments yet — be the first to write one!

Similar Tools