Skip to the content

Shuffle Lines Randomly

Put the lines of a list in random order, as often as you like. Every possible order is equally likely.

Lines in
0
Lines out
0
Duplicates
0
Share this tool:TwitterFacebookLinkedInWhatsAppEmail

A fair shuffle

Before
Alice Bob Chloe David
After
Chloe Alice David Bob
One of the possible orders. Yours will be different.

Four lines can be put in 24 different orders, ten lines in 3,628,800. The shuffle picks one of them without a preference for any. It goes through the list once and swaps each line with a randomly chosen one that has not been placed yet (the Fisher-Yates method), using numbers from your browser's cryptographic random generator. That is the source browsers use for encryption keys, not the predictable generator behind an ordinary "random" function.

When you use it for a draw or a starting order:

  • Every line is one ticket. A name that is in the list twice is twice as likely to come out on top. Switch on Remove duplicate lines if that is not the idea; Ignore case then also sees anna and Anna as one person.
  • Empty lines are left out and spaces around a name are trimmed, so a stray blank line can't win.
  • Shuffle again draws a new order. So does adding or removing a line.
  • Nothing is saved. If the outcome has to be on record, copy or download it straight away.

Sorting, removing duplicates, numbering and adding a prefix can be combined on the Sort & Dedupe Lines page, which also remembers your settings.

See all 9