Shuffle Lines Randomly
Put the lines of a list in a random order, using your browser's secure random generator, so every order is equally likely.
Line shuffler
Paste a list and press Shuffle.
Result
Shuffled lines
Lines
Private: Everything runs in this page. Nothing you type is sent anywhere or saved.
On this page
How the shuffle works, with a fixed sequence
| Lines | Random numbers used | Result |
|---|---|---|
| a, b, c, d | all 0 | b | c | d | a |
| a, b, c, d | 1, 1, 0 | c | a | d | b |
| x | none needed | x |
| a, b | 0 | b | a |
| p, q, r | 2, 0 | q | p | r |
Formula
Fisher-Yates shuffle: for i from n-1 down to 1, swap line i with a random line from 0 to i
How the line shuffler works
- Step onePaste your list with one item on each line.
- Step twoPress Shuffle. Press it again for a new random order.
- Step threeCopy the shuffled list.
What this tool does not do
- It is not a certified random source; do not use it for gambling or legal draws.
- It shuffles whole lines only; it does not shuffle the words inside a line.
- It does not remember earlier shuffles.
Frequently asked questions
Is the shuffle fair?
Yes. It uses the Fisher-Yates method with numbers from your browser's secure random generator and no bias, so every order is equally likely.
Can I get the same order again?
No. The shuffle is random each time and nothing is saved.
Is it good enough for a prize draw?
For a casual draw among friends, yes. It is not a certified random source and should not be used where the law or a contract requires one.
References
- Knuth, D. E. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, section 3.4.2 (Algorithm P, shuffling).