Skip to content

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
  1. How the shuffle works, with a fixed sequence
  2. Formula
  3. How the line shuffler works
  4. What this tool does not do
  5. Frequently asked questions
  6. References
  7. Related tools

How the shuffle works, with a fixed sequence

LinesRandom numbers usedResult
a, b, c, dall 0b | c | d | a
a, b, c, d1, 1, 0c | a | d | b
xnone neededx
a, b0b | a
p, q, r2, 0q | 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

  1. Step onePaste your list with one item on each line.
  2. Step twoPress Shuffle. Press it again for a new random order.
  3. 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).