Shuffle lines, words or characters
The text shuffler randomly reorders your input so that every arrangement is equally likely. Use it to randomize a list of names, scramble words for a puzzle, reorder quiz questions, or pick a fair random winner. Choose to shuffle by lines, words, or characters.
How it works
The tool splits your text by the chosen unit — by newline for lines, by whitespace for words (dropping empty tokens), or into individual characters. It then applies the Fisher–Yates shuffle: walking from the last item to the first, it swaps each item with a randomly chosen earlier-or-equal position. This produces a uniform, unbiased permutation in linear time — far more reliable than sorting on random keys. A pseudo-random generator is seeded fresh on every click, so each shuffle gives a new order. The shuffled pieces are then re-joined (lines by newline, words by space, characters with nothing).
Why Fisher-Yates and not just sort by random?
A common (incorrect) approach to shuffling is to assign each item a random number and sort the array by those values. This is subtly biased because sorting algorithms are not designed to handle equal-probability comparisons. Fisher-Yates avoids this by working in-place, making exactly one swap per element, and choosing uniformly from the remaining unshuffled positions. Every permutation is equally likely, making it the standard algorithm used in programming libraries, card games, and lottery systems.
Mode guide: which unit to choose
Lines mode — best for:
- Randomizing a list of names for a raffle or secret santa draw
- Reordering quiz questions or flashcard prompts before printing
- Scrambling the order of tasks in a to-do list
Words mode — best for:
- Creating word-scramble puzzles from a sentence
- Shuffling vocabulary words in a study list
- Generating random word order for a creative writing warm-up
Characters mode — best for:
- Creating letter-scramble puzzles (anagrams)
- Generating a shuffled character pool for a password hint
- Producing obfuscated-looking strings for testing
Worked example — picking a random winner
Paste your entrant list, one name per line:
Alice
Bob
Carol
David
Eve
Click Shuffle by Lines. The top name in the result is a fair random pick — every entrant had equal probability of landing there. Click again if you need a second winner (runner-up), or want to re-roll.
Example — word scramble
Sentence: “The quick brown fox jumps over the lazy dog”
One word-mode shuffle might give: “fox lazy over dog the jumps brown quick The”
Each click produces a different word order, suitable for a language-exercise puzzle where students must reconstruct the original sentence.
Everything runs in your browser — nothing is uploaded or stored.