Skip to content
Toolew.com

Shuffle Lines

Randomly shuffle lines, words or comma-separated items with a cryptographically secure Fisher–Yates shuffle.

Runs in your browser. Your data is not uploaded.
Loading tool…

Tool guide

What this tool does

Shuffle Lines puts any list into a fair random order. It uses the Fisher–Yates algorithm driven by your browser’s cryptographic random number generator, so every ordering is equally likely. You can shuffle lines, words or comma-separated items, keep only the first few results to draw winners, and number the output.

Putting a list into random order sounds trivial, but many quick methods are biased. Sorting with a random comparison, a common shortcut in code, makes some orders noticeably more likely than others, and predictable random numbers can be guessed. For a raffle, a presentation order or a quiz, people need to trust that the result was fair.

This tool uses the Fisher–Yates shuffle, which walks through the list once and swaps each item with a randomly chosen item that has not yet been placed. The random numbers come from crypto.getRandomValues with rejection sampling to avoid modulo bias, so every one of the n! possible orders has the same probability. A new shuffle happens only when you press Shuffle, so the result does not change while you edit options.

How to use Shuffle Lines

  1. Enter your items under “Items to shuffle”, one per line, or press Sample.
  2. Choose what to Shuffle: lines, words, or comma-separated items.
  3. Set “Keep only the first N after shuffling” to draw that many random items; leave it at 0 to keep everything.
  4. Turn on “Number the result” for a running order.
  5. Press Shuffle (or Ctrl + Enter). Press it again for a fresh order.
  6. Copy, download or share the result as a record.

Tips for better results

  • To pick one winner, set N to 1. To draw first, second and third place, set N to 3 and turn on numbering.
  • Remove duplicate lines first if entrants may have been added twice, unless repeat entries are allowed.
  • Keep a copy of the original list alongside the result if you need to show how the draw was made.
  • For splitting people into groups, the Random Team Generator balances group sizes for you.

Common use cases

  • Deciding speaking order for a meeting or class presentations.
  • Drawing giveaway winners from a list of entrants.
  • Randomising quiz questions or flashcards to avoid memorising order.
  • Creating a random playlist order from a list of song titles.

Common mistakes to avoid

  • Shuffling a list with blank lines left in, which can make an empty line a “winner”. Keep “Ignore empty lines” on.
  • Re-running the shuffle until you like the result, which defeats the purpose of a fair draw.
  • Using word mode on names with spaces, which separates first and last names. Use lines instead.

Frequently asked questions

Is the shuffle truly random?

It uses your browser’s cryptographically secure random number generator, the same source used for generating encryption keys, combined with an unbiased Fisher–Yates shuffle. The outcome cannot be predicted from previous shuffles.

Why does the order not change when I edit the list?

Shuffling runs only when you press Shuffle, so a draw is not silently redone while you type. Press the button again whenever you want a new order.

Can I pick random items from a list?

Yes. Set “Keep only the first N after shuffling” to the number you need. Because the whole list is shuffled first, every item has an equal chance of being picked and no item is picked twice.

How many items can I shuffle?

Lists with hundreds of thousands of lines shuffle almost instantly, since the algorithm makes a single pass through the list.

Feedback & suggestions

Help us improve Shuffle Lines. We read every message.

Rating (optional)
Necessary
Required for security, language and theme preferences. Always on.