How to use the Shuffle Lines Randomly
Shuffle lines randomly in three steps:
1
Paste your list
Paste any multi-line list into the input area — one item per line.
2
Set seed and options
Optionally enable a numeric seed for a reproducible shuffle. Toggle 'Skip empty lines' to exclude blank lines from the shuffle.
3
Shuffle and copy
Click 'Shuffle Lines' to randomise. Click again for a new random order (or the same order if using a fixed seed). Copy or download the result.
When to use this tool
Use to randomise the order of lines in any list:
- →Shuffling a list of quiz questions to create a randomised question order for different students or exam sittings
- →Randomising a list of items for a raffle, lottery draw, or random selection without bias
- →Shuffling test data lines to remove order-dependent bias from automated test suites
- →Creating randomised seating charts or group assignments from a list of names
- →Generating a random playlist order from a list of song titles or file names
- →Randomising the order of code snippets in a training dataset before splitting into train and test sets
Frequently asked questions
Q:What is the Fisher-Yates shuffle and why does it matter?
The Fisher-Yates shuffle (also called the Knuth shuffle) is an algorithm that produces a uniformly random permutation — every possible ordering of the list is equally likely. Naive shuffling approaches (like repeatedly sorting with a random comparator) produce biased distributions where some orderings are more likely than others. Fisher-Yates guarantees true uniformity, making it the correct algorithm for applications like fair draws and unbiased test data.
Q:What is a seed and how does it make shuffles reproducible?
A seed is a number that initialises a deterministic pseudo-random number generator (PRNG). Given the same seed, the PRNG produces the same sequence of numbers every time, and therefore the Fisher-Yates shuffle produces the same permutation every time. This lets you share a shuffle result with others (just share the seed and the original list), reproduce a shuffle for debugging, or use the same random order across multiple environments.
Q:Is the shuffle truly random when no seed is set?
Without a seed, the tool uses JavaScript's Math.random(), which is a pseudorandom number generator seeded by the browser's entropy source (typically a combination of time, hardware, and OS randomness). It is not cryptographically secure but is more than sufficient for fair draws, quiz randomisation, and general list shuffling. For cryptographically secure randomness, a CSPRNG would be needed.
Q:Does the same seed always produce the same order?
Yes — the tool uses the mulberry32 seeded PRNG algorithm, which produces a deterministic sequence for any given integer seed. Seed 42 always produces the same shuffle of the same input, regardless of when or where you run the tool. This is useful for reproducible randomisation in testing, education, and content generation scenarios.
Q:Can I reshuffle the same list to get a different order?
Yes — click 'Shuffle Again' to generate a new random order. Without a seed, each click produces a different result. With a seed set, each click produces the same result (because the same seed always produces the same permutation). To get a different seeded result, change the seed number.
Q:Does shuffling preserve the total number of lines?
Yes — the Fisher-Yates shuffle is a permutation: it rearranges lines without adding, removing, or duplicating any of them. With 'Skip empty lines' enabled, blank lines are excluded before shuffling, so the output contains only the non-empty lines in a random order. With 'Skip empty lines' disabled, blank lines are included in the shuffle and may appear anywhere in the output.