Shuffle Lines

Paste a list, one item per line, and get it back in random order. Press Shuffle again for a new order as often as you like.

How it works

The shuffle uses the Fisher-Yates method: it walks from the last line to the first and swaps each one with a randomly chosen line at or before it. With a fair source of random numbers, every possible order is equally likely.

The random numbers come from the browser's cryptographic generator, the one used to make encryption keys, not from Math.random. Numbers that would favour some positions over others are thrown away and drawn again, so no line is more likely to end up first.

Nothing is stored, and there is no seed, so an order cannot be repeated on purpose. Everything runs on this page.

How to use it

  1. 1 Paste your list into the Text box, one item per line.
  2. 2 The shuffled list appears below at once.
  3. 3 Press Shuffle again for a different order.
  4. 4 Copy the result, or download it as a .txt file.

Good to know

  • To pick a winner, shuffle the list of names and take the first line.
  • To split a class into random groups, shuffle the names and count them off from the top.
  • Blank lines are shuffled too. Remove Empty Lines first if your list has gaps.
  • If someone may doubt the draw, shuffle while they watch, because the order cannot be produced again later.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Drawing a fair raffle winner from a list of names

A school fair sold 84 raffle tickets, and each buyer's name is in a spreadsheet, one row per ticket. Someone who bought three tickets appears three times, which is right, because they should have three chances. Copy the names column, paste it here, and the list comes back in random order. The first name is the winner, the second gets second prize, and so on.

The fairness comes from two parts. The first is the method. The tool uses the Fisher-Yates shuffle, which goes through the list from the bottom up and swaps each line with a randomly chosen line at or above it. Simpler methods, such as sorting by a random number, can favour some orders over others. Fisher-Yates does not: with fair random numbers, all possible orders of the 84 tickets are equally likely.

The second part is the random numbers. Many web tools use Math.random, which is fast but not designed to be unpredictable. This tool uses the browser's cryptographic generator, the one used to make encryption keys. It also avoids a subtle bias: when a random number would make some positions slightly more likely than others, it is thrown away and a new one is drawn. The note under the result says how many lines changed place.

Do not be surprised if a few lines stay where they were. In a fair shuffle of 84 lines, on average about one line lands in its original place by chance. Press Shuffle again as often as you like; every press is a new, independent order. Other uses work the same way: putting quiz questions in a random order, choosing the order of speakers, or splitting a class into random groups by counting off the shuffled list.

The tool has honest limits. There is no seed, so nobody can produce the same order again to check it later. If you need proof, shuffle while people watch, or record the screen. It cannot know whether your list itself is fair, such as a name typed twice by mistake. It is not an audited system for draws that the law regulates. It takes up to 1 MB of text at a time.

Frequently asked questions

Is the shuffle truly random?

It uses the browser's cryptographic random number generator, the same one used for encryption keys, and a method that makes every order equally likely. That is as random as a web page can be.

Why did some lines stay in the same place?

A fair shuffle leaves some lines where they were by chance. In a list of 10 lines, about one line on average stays put. A shuffle that never did that would not be fair.

Can I get the same order again?

No. There is no seed to save, so each shuffle is new. Copy or download a result you want to keep.

Can I use this for a prize draw?

Yes, for a club raffle or picking a team order. For a draw with legal rules, check what your rules require, as some need an audited method or a witness.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.