Line Order Randomizer

Randomizes the order of lines in a block of text using a Fisher-Yates shuffle, without changing the content of any individual line, useful for randomizing lists, quiz questions, or test data. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-23

Overview

Introduction

Randomizing the order of lines by hand, for a shuffled list, a quiz question order, or randomized test data, is tedious and easy to get visibly non-random.

This tool shuffles line order for you using a proper Fisher-Yates shuffle, and it runs entirely client-side, so nothing you paste is ever uploaded to a server.

What Is Line Order Randomizer?

A line shuffler that randomizes the order of the lines in your text while leaving the text of each line untouched.

It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.

How Line Order Randomizer Works

The text is split on newline characters into an array of lines, that array is shuffled with a Fisher-Yates algorithm, and the shuffled lines are rejoined with newlines.

The transformation happens synchronously in JavaScript, using the browser's own random number generator, with no network round trip involved.

When To Use Line Order Randomizer

Use it to randomize the order of a list, quiz answer choices, a set of test fixtures, or any line-delimited data where order shouldn't matter.

It's a fast way to get an unbiased shuffle without opening a code editor, a REPL, or writing a one-off script just to check.

Features

Advantages

  • Uses a proper Fisher-Yates shuffle instead of a naive sort-by-random-key approach, avoiding bias.
  • Never touches the text within a line, only its position.

Limitations

  • Randomness is not cryptographically secure and isn't seeded, so a shuffle can't be reproduced later.

Examples

Shuffling a short list

Input

banana
apple
cherry

Output

cherry
banana
apple

Each run produces a different random ordering of the same three lines.

Best Practices & Notes

Best Practices

  • Use a 'Shuffle again' click if the first shuffle happens to look too close to the original order.

Developer Notes

The shuffle is implemented as a standard Fisher-Yates: iterate from the last index down to 1, and at each step swap the current element with one at a uniformly random index from 0 to the current index inclusive, using `Math.random()`.

Line Order Randomizer Use Cases

  • Randomizing quiz or survey answer order
  • Shuffling a list of names for a drawing
  • Randomizing the order of test fixtures or sample data

Common Mistakes

  • Expecting the shuffle to be reproducible between runs; it uses `Math.random()` and is not seeded.

Tips

  • Combine with the Sentence or Paragraph Randomizer if you need to shuffle at a different granularity than whole lines.

References

Frequently Asked Questions