toolbench.onlineby Valkyron Labs

Random

List Shuffler

Shuffle pasted lines with a Fisher-Yates pass driven by crypto.getRandomValues. Trim whitespace or drop blank lines, then copy the reordered lines.

List Shuffler

Shuffle lines with a Fisher-Yates pass from crypto.getRandomValues.

Shuffled output

—

Output actions

Ready to copy output once your result appears.

Line order and shuffle options

List Shuffler reorders whole lines. The pass is Fisher-Yates: from the end of the list toward the front, each position is swapped with an index chosen from crypto.getRandomValues. Trim whitespace and Remove empty lines run before that pass. The same lines can come out in a different order on every click. Duplicates are kept.

How to shuffle a list

  1. 1Paste one item per line into Lines to shuffle. Trim whitespace starts checked. Remove empty lines starts unchecked.
  2. 2Turn Remove empty lines on when a blank row should disappear instead of taking a slot in the new order.
  3. 3Click Shuffle, then Copy output. There is no download button. Click Shuffle again when you want another permutation.

What it is good for

  • • Drawing a random speaking order or a randomized quiz list from names you already cleaned.
  • • Keeping duplicate rows, because this page reorders and does not dedupe.
  • • Dropping blank lines before the shuffle, or keeping them when an empty row is a real item.

Example

Input

apple
banana
cherry

Output

cherry
apple
banana

cherry, apple, banana is one legal permutation. The button will not reproduce it. Any order of the same three lines is a correct result, and a second click should be treated as a new draw.

What the shuffle keeps

The input is split on line breaks, including Windows carriage returns, so the CR is not left on the text. Each piece is one item. Fisher-Yates then walks from the last index down to 1. At index i it reads one 32-bit value from crypto.getRandomValues and takes that value modulo i + 1. The item at i swaps with the item at that remainder. Index 0 is never drawn on its own; it is wherever the earlier swaps left it. A list of one line is returned unchanged because the loop does not run.

The multiset of lines is preserved when Remove empty lines is off. Two identical names stay two rows. Order is the only thing the pass is allowed to change. Sorting, numbering, and case-folding are not on this page. If the list should lose duplicates first, do that on the duplicate-line remover, then paste the kept lines here.

The two checkboxes

Trim whitespace is on by default. It runs String trim on every line before the shuffle, so leading and trailing spaces do not make two copies of the same word look different, and they do not survive into the output. Turn it off when the spaces are data, such as an indented outline you are only reordering.

Remove empty lines is off by default. With it off, a line that is empty after the optional trim still occupies a slot and can land anywhere, including between two words. With it on, those empty strings are filtered out before the swaps. A line of spaces becomes empty only when trim is on. The checkboxes apply on the next Shuffle click; they do not rewrite the result by themselves.

Jobs a shuffled list is for

A roster, a playlist of titles, or a stack of test prompts can be pasted and reordered for a meeting or a worksheet. Because the draw changes every click, save the output you actually used. The page will not reconstruct it later.

Clean the source before you randomize if blanks and duplicates would distort the draw. The pasted-list guide walks through duplicate removal, wrapped-line repair, and alphabetical sorting while you still care about the original sequence. Shuffle only the copy that is allowed to lose that sequence. Alphabetical order, when you need it instead, is the line sorter. Joining wrapped lines is line operations.

Blank lines, one line, and the remainder

An empty box splits to a single empty string. Trim leaves it empty. Remove empty lines deletes it, and the join of an empty array is an empty result. With Remove empty lines off, Shuffle still returns that one empty line. Neither case produces a warning.

The remainder used for the swap index is not rejection sampling. When i + 1 does not divide 2^32, some indexes are very slightly more likely than others. For a meeting roster the difference is not observable. This page does not claim a perfectly uniform draw, and it does not expose a seed, so a permutation cannot be repeated on purpose.

Copy output is the only way to take the lines away. The result area is labeled Shuffled output. There is no count field and no option to shuffle inside a line or to shuffle comma-separated cells. Commas stay inside the line they arrived on.

Rules and limitations

Lines split on \n or \r\n. Trim whitespace defaults to on. Remove empty lines defaults to off. Both apply before Fisher-Yates. Duplicates are preserved. A single remaining line is not moved.

Each swap index is a crypto.getRandomValues uint32 reduced with modulo the inclusive index. There is no seed and no download. Copy output copies the latest shuffle only.

Common problems

If a repeated name vanished, it was removed before this page, or Remove empty lines was on and the row was blank. This shuffle does not dedupe.

If the order matches a previous click, that is chance, not a saved seed. Click Shuffle again. If spaces that mattered disappeared, Trim whitespace was still checked.

Frequently asked questions

Does the shuffle remove duplicate lines?

No. Two identical lines stay two lines and are ordered independently. Remove duplicates on the text deduplicator first if the draw should contain each item once.

What does Trim whitespace do to a blank line?

Trim turns a line of spaces into an empty string. If Remove empty lines is off, that empty string is shuffled like any other row. If Remove empty lines is on, it is dropped before the swaps.

Will I get the same order twice?

Not by design. There is no seed. The sample order cherry, apple, banana is only one possible result for apple, banana, cherry. Another click is a new permutation.

How is the swap index chosen?

Fisher-Yates walks from the last line toward the second. Each step reads one 32-bit value from crypto.getRandomValues and uses the remainder modulo the current span. That is not rejection sampling, so the distribution is very close to uniform rather than perfectly uniform.

Is my input uploaded or saved?

This tool processes input in your browser and does not save its input or output to local storage. Copy and download are user actions. The site uses analytics for page and action metadata and may use ads and production error reporting; see the Privacy Policy for those services.

About this tool

Maintained by Toolbench. For large or deeply nested files, split the input into smaller batches and verify representative results before using them in an import or application. Report reproducible problems through Contact.

Guides

Next steps

Related tools

Continue the workflow with nearby tools for formatting, publishing, debugging, or follow-up checks.

Trust

Policies, contact, and answers

Clear pages for how Toolbench works, what we collect, and how to reach us.