Skip to main content

Shuffle lines

Put the lines of a list in a random order, with the option of ignoring empty lines, then copy the result. Values are never changed and duplicates are kept.

  • Clipboard
Automate

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Was this tool useful?

How does this tool work?

Randomly shuffle the order of the lines in a list without changing the values themselves. It is a quick way to vary the order in which items are presented or to prepare an informal activity.

Paste one value per line to get a random permutation of their order. The “Ignore empty lines” option is on at the start; switch it off if blank lines should take part in the shuffle. The values themselves are not changed and duplicates stay in. Running the shuffle again can give a different order, but chance may also leave some items where they were. The tool uses the Fisher–Yates algorithm with the browser’s cryptographic random number generator. It suits an informal running order or a classroom activity. For a regulated draw, an auditable ranking or a fair allocation, use a dedicated procedure: shuffling lines is not proof of a draw. A random shuffle changes the order of presentation without giving any special value to the first positions. In an exercise it varies the questions; in a brainstorming session it helps break away from the original order. Each run is a fresh permutation, but the result may keep some lines in place: randomness does not guarantee a visibly different order. Duplicates remain separate lines, so a value that appears twice can appear twice in the result. The empty-line option decides whether blank lines are shuffled or ignored; when blank lines separate groups in your data, check the output carefully. Do not confuse this shuffle with an official draw: the tool provides no proof of fairness, no reproducible seed and no record of the draw. If the order may need to be justified later, keep the original list and note the method used. For an activity with several groups, shuffle the list before sharing out the items rather than assuming the shuffle creates fair groups by itself. If some lines must stay together, merge them into a single line first: the tool treats each line independently. To check that every value is still there, compare the number of useful lines before and after the shuffle, taking the empty-line option into account.

How to use this tool

  1. Enter the data

    Type one value per line.

  2. Choose the options

    Decide how empty lines are handled.

  3. Check the result

    Shuffle and review the new order.

Use cases

Varying questions

Change the order of the questions in an exercise for a different presentation without rewriting them.

Informal running order

Shuffle a list of participants for an activity that does not require a certified draw.

Rethinking ideas

Shake up the order of proposals during a brainstorming session, then keep the ones you like.

Examples

One possible permutation

Each run draws a new order; another run might return B, C, A or even the original order.

Input

A
B
C

Result

C
A
B

Tips and best practices

  • Duplicates stay in, and some items may keep their position after shuffling.
  • Shuffling lines is not a certified or auditable draw procedure.
  • The shuffle uses the Fisher–Yates algorithm with the browser’s cryptographic random generator (crypto.getRandomValues).

Frequently asked questions

Is the result always different?

No. A permutation can keep some lines in place, and with a short list it can even return the original order.

Are duplicates kept?

Yes, repeated lines stay in the result as separate lines.

Can I keep empty lines?

Yes. Switch off “Ignore empty lines” and they will be shuffled like the other lines.

Does the text of the lines change?

No, only their order is shuffled.

Is it suitable for an official draw?

No. An official draw needs an auditable procedure with a record of how the result was obtained.

Related tools

Tools similar or complementary to this one.

Similar tools

Automatically add a number in front of every line, in the format you choose.

Text & writingUse this tool

Remove duplicate lines from a list while keeping one occurrence of each value.

Text & writingFeaturedUse this tool

Compare two lists to find the items they share and the ones that differ.

Text & writingUse this tool