Shuffle Lines
A genuinely random order, every time.
A genuinely random order, every time.
How to use it
- Paste your list. Names for a draw, questions for a quiz, tasks to pick from.
- Read the new order. Every ordering is equally likely. Press Again for a different one.
- Copy the result. Nothing is recorded, so nobody can check what order came out first.
When you would use this
Shuffling looks like the easiest thing on this list and is the one most often done wrong. The usual shortcut is to sort the list with a comparator that returns a random result, which produces something scrambled and is not a shuffle: a comparison sort asks the comparator about specific pairs in an order that depends on the algorithm, and an inconsistent answer makes the outcome lopsided in ways you can measure but not see. The correct method walks the list backwards swapping each item with a randomly chosen earlier one, which gives every ordering exactly equal probability. The randomness comes from the browser's cryptographic source rather than the ordinary one, which matters if you are drawing names for anything that people care about the fairness of.
Questions
- Is it actually random?
- Yes. It uses your browser's cryptographic random source and an unbiased shuffle, so every possible ordering is equally likely. That is not true of the common shortcut.
- What is wrong with sorting by a random number?
- It is not a shuffle. Comparison sorts call the comparator repeatedly and inconsistently, so some orderings come up far more often than others. It looks random and is measurably not.
- Is my list sent anywhere?
- No. The work happens in the page. There is no server here, which is also why it keeps going with the network disconnected.