Use Shuffle Lines
Use Shuffle Lines to reorder complete lines without editing the text inside each line. Enter or upload your text, choose the controls, and the result updates automatically; then copy or download it.
How to shuffle lines
- Paste text into the input box, click Upload, or drop a file anywhere on the page. Uploaded files are read as text. The picker accepts
.txt,.csv,.log,.md, andtext/plain. - Choose your settings; changing the input or any option automatically regenerates the current output.
- Read the result in the readonly output box. Click Copy to copy non-empty output, or click Download to save it as
shuffled-lines.txt.
Choose the shuffle controls
- Seed (optional): the value is trimmed before use. A non-empty seed with the same input and settings produces the same result. A blank seed uses
Math.random(), so another click normally produces a pseudorandom order but does not guarantee a different result. - Shuffle count: sets the number of shuffle passes. The input accepts values from 1 to 50; values outside that range are clamped before shuffling.
- Blank lines: choose Shuffle with other lines, Keep in original position, or Remove before shuffling. A blank line is any line where
line.trim() === '', including whitespace-only lines. - Line ending: choose Auto (match input), LF (\n), or CRLF (\r\n). Auto uses CRLF when it is the dominant detected ending and otherwise uses LF; it does not preserve a mixed pattern exactly.
- Prevent identical order: the tool retries up to 200 times and then attempts a swap. A visibly different result can still be impossible when lines have identical content or the selected policy leaves no distinguishable permutation.
Understand the output and limitations
- The tool reorders complete lines. It does not sort lines, remove duplicate nonblank lines, or shuffle words within a line.
- Remove before shuffling removes blank and whitespace-only lines, so the output can contain fewer lines. The other blank-line choices retain the input line count.
- Empty input produces empty output and no stats. Copy and Download do nothing when the output is empty.
- The stats line can show input lines, output lines, blank lines, and order unchanged when applicable.
- A seed provides repeatability for the same input and settings. It is not proof of fairness, security, or auditability.
Frequently Asked Questions
Does shuffling change the content of any line?
Only the order of complete lines changes. Words, punctuation, spacing, and capitalization inside a line are not edited. The Remove before shuffling option can remove blank or whitespace-only lines.
What does the seed field do?
A non-empty Seed (optional) value makes the result reproducible for the same input and settings. The value is trimmed before use. A blank seed is pseudorandom and is not guaranteed to produce a unique order.
What is the blank-line policy?
Blank lines lets you choose Shuffle with other lines, Keep in original position, or Remove before shuffling. Whitespace-only lines count as blank.
Can I stop the result from matching the original order?
Prevent identical order retries up to 200 times and then attempts a swap. It cannot guarantee a visibly different result when values are indistinguishable, such as duplicate lines.