Randomising text by hand takes longer than it sounds. Cutting a list into strips and re-ordering them, or copying words one by one into a new arrangement, introduces bias toward the ends of the original. Text Word Shuffler applies a Fisher-Yates shuffle — the same algorithm used in card decks and game engines — so every permutation is equally likely and the result is ready to copy in one click.
Four modes cover the most common use cases without overlap. Shuffle Words scrambles the order of tokens within each line, leaving paragraph structure intact. Shuffle Lines reorders the lines themselves. Shuffle Characters mixes the letters inside each word while keeping the words in place. Shuffle Sentences treats punctuation-terminated spans as the unit and reorders those instead.
Worked Example: Shuffling a Pangram Four Ways
Click Load Sample to paste The quick brown fox jumps over the lazy dog near the river bank. With Shuffle Words active, pressing Shuffle produces a new word order on every click — for example river fox the dog near jumps bank. lazy the brown quick over. The stats bar reports 12 Words shuffled and increments the shuffle counter on each press.
- Switch to Shuffle Characters on the same sentence and each word is internally scrambled: ehT kciuq nwrob and so on. Spaces are preserved in their original positions so the word count does not change.
- Enter my-seed-42 in the seed field and press Shuffle twice. Both runs produce the same output. Clear the seed and the result is different every time. This is the non-obvious feature most first-time visitors miss: seeded shuffles let you share a reproducible scramble with a colleague by sending them the seed.
- The seed field accepts any string. It is hashed with a 32-bit FNV-1a variant into a starting value for the mulberry32 generator, which then drives the Fisher-Yates passes. Two seeds that hash to the same 32-bit integer produce the same output, but collisions are rare enough to be irrelevant for typical text sizes.
What Each Shuffle Mode Produces
- Shuffle Words splits each line on whitespace runs, shuffles the token array, then rejoins with the original spacing pattern. A line with a double space between two words keeps that double space after shuffling.
- Shuffle Lines treats every newline-separated segment as one unit. Blank lines count as lines and can land anywhere in the output, which is intentional for list reordering but worth noting for structured text.
- Shuffle Characters treats each non-whitespace token as an array of Unicode code points and shuffles those. A 3-character word has 6 possible orderings; a 1-character word stays unchanged.
- Shuffle Sentences splits on
. ! and ? followed by whitespace, shuffles the resulting spans, then joins them with a single space. Text without terminal punctuation is treated as one sentence and emerges unchanged.
Tricky Inputs: Blank Lines, Punctuation and the 50 000-Character Ceiling
- Inputs over 50,000 characters are rejected before shuffling begins with the message Input exceeds 50,000-character limit. The Fisher-Yates algorithm is O(n) but building the output string at that scale causes a perceptible pause on mid-range hardware.
- A single word with no spaces returns that word unchanged in Shuffle Words mode — there is only one permutation of a one-element array. The shuffle counter still increments to confirm the operation ran.
- Changing the mode clears the output rather than re-running automatically, so you always see exactly which mode produced the result in the output box.
- All shuffling runs locally in the browser. No text is transmitted anywhere.