Line shuffler

What is a Line Shuffler?

Shuffling a list is useful more often than you might think: randomising quiz questions, choosing a fair presentation order, picking prize winners, mixing test data or avoiding bias in A/B samples. This tool shuffles the lines of any text into a random order, with an optional seed so you can reproduce the same order later.

How to use it

  1. Paste a list, one item per line.
  2. Optionally enter a seed.
  3. Shuffle and copy the result.

Example

Input:

Asha
Ben
Chen
Diego
Ela

One possible shuffle:

Chen
Ela
Asha
Diego
Ben

Why the seed matters

Without a seed, every shuffle is different. With a seed, the same input and seed always produce the same order. That lets you publish the seed with the result so anyone can verify that a draw was not manipulated, or keep a test fixture stable between runs.

How a fair shuffle works

A correct shuffle uses the Fisher-Yates algorithm: walk from the last line to the first, and swap each line with a randomly chosen line at or before it. Every possible order is equally likely. A common mistake in code is sorting with a random comparator, such as sort(() => Math.random() - 0.5), which produces biased results.

Tips

  • Remove empty lines first if they should not be shuffled into the list.
  • To pick winners, shuffle and take the first N lines.
  • For draws that matter, announce the seed method before the draw, not after.

Frequently Asked Questions

Is the shuffle truly random?

Without a seed, each shuffle uses fresh randomness so every order is possible. With a seed, the order is reproducible.

What is a seed used for?

It makes the shuffle repeatable. The same list and seed always give the same order, which helps with verification and testing.

Why not sort with Math.random?

Sorting with a random comparator is biased. The Fisher-Yates algorithm gives every order an equal chance.

How do I pick random winners from a list?

Shuffle the list and take the first lines as winners.