Tools

Home
Base64String to HexHash GeneratorUTF-8URL Encode

Shuffle Lines

Randomize the order of lines in your text. Uses Fisher-Yates shuffle for true randomness.

Your data never leaves your browser
INPUT0 lines
OUTPUT0 lines
Ready

Paste a list of lines, hit Shuffle, and get them back in random order using a proper Fisher-Yates algorithm — no position bias, no favored items. Works for raffles, quiz questions, playlists, student names, or any ordered list you want scrambled. And everything runs in your browser. Nothing gets uploaded.

How It Works

Paste Your Lines
→
Fisher-Yates Shuffle
→
Random Order Output

The Fisher-Yates algorithm walks backward through your list, swapping each line with a randomly chosen line before it. This produces a truly unbiased permutation — every ordering is equally likely. It runs in O(n) time, so even a 10,000-line file shuffles instantly.

Examples

Randomizing a Class Presentation Order

A teacher needs to assign random speaking slots so nobody complains about favoritism.

INPUT
Alice Bob Charlie Diana Ethan
OUTPUT
Diana Ethan Alice Charlie Bob

Shuffling Quiz Questions for an Exam

You're building two versions of a test. Shuffling the question list gives you Version B without rewriting anything.

INPUT
Q1: What is the capital of France? Q2: Who wrote Hamlet? Q3: What is 7 × 8? Q4: Name the largest ocean. Q5: What year did WW2 end? Q6: Define photosynthesis.
OUTPUT
Q4: Name the largest ocean. Q1: What is the capital of France? Q6: Define photosynthesis. Q3: What is 7 × 8? Q5: What year did WW2 end? Q2: Who wrote Hamlet?

Randomizing a Spotify Playlist Export

Exported playlists are sorted by date added. Shuffle to break out of the same opening tracks every time.

INPUT
Bohemian Rhapsody - Queen Blinding Lights - The Weeknd Shape of You - Ed Sheeran Stairway to Heaven - Led Zeppelin
OUTPUT
Shape of You - Ed Sheeran Stairway to Heaven - Led Zeppelin Bohemian Rhapsody - Queen Blinding Lights - The Weeknd

Who Uses This

🎓 Teachers

Randomize student presentation order, seating charts, or group assignments without anyone calling bias.

👨‍💻 Developers

Generate shuffled test data for unit tests, randomize seed lists, or scramble CSV rows before sampling.

🎲 Event Organizers

Draw raffle winners, set random bracket positions, or shuffle trivia questions for game night.

✍️ Content Creators

Mix up social media post schedules, reorder video ideas, or randomize poll options so the first choice doesn't always win.

Common Mistakes

Pasting text with no line breaks

If your entire text sits on one line, there's nothing to shuffle. Make sure each item is on its own line — hit Enter between them. A single paragraph won't get rearranged.

Expecting the same result every time

Each shuffle is random. If you need a specific shuffled order saved, copy the output right away before clicking Shuffle again. There is no undo button that restores the previous arrangement.

Leaving blank lines mixed in

Blank lines count as lines too. After shuffling, you might see random gaps scattered through your output. Clean up empty lines from your input first if you don't want them in the mix.

Technical Details

Frequently Asked Questions

Is the shuffle truly random?

It uses the Fisher-Yates algorithm with JavaScript's Math.random(), which gives you a pseudo-random shuffle. For classroom picks, playlist mixing, or quiz ordering, it's more than random enough. It won't pass cryptographic standards, but that's not what this is for.

Can I shuffle lines in a CSV file?

Yes — open your CSV in a text editor, copy all the rows (skip the header), paste them here, shuffle, then paste back. Just make sure you don't shuffle the header row in with the data, or you'll end up with column names in the middle of your file.

Does this tool save or upload my text?

No. The entire shuffle happens in your browser using JavaScript. Nothing gets sent to a server. Close the tab and your data is gone — there's no database, no cookies, no tracking involved.

How many lines can I shuffle at once?

There's no set limit. The tool handles tens of thousands of lines without breaking a sweat. If your browser can hold the text in a textarea, this tool can shuffle it. Performance only starts to slow around 100,000+ lines on older machines.

Can I undo a shuffle?

Not directly — once you shuffle, the previous order is gone. Best practice: copy your original list before shuffling, or keep it in a separate tab. That way you always have the original if you need to go back.

Share: