Keep both copies of a duplicated B line
Input and settings
Input lines: A / B / B / C
Expected result
Four output lines: one A, two Bs and one C, in an unspecified order.
Randomize the order of every line while preserving all entries and duplicates.
These are example steps; replace the values for your task.
Unlike the Roulette tool, which selects one item, this tool returns the complete list in a new random order. Duplicate lines are retained.
You can copy the result, but neither the input nor output is stored in localStorage.
Shuffle lists with duplicate lines and whitespace to check what is preserved and what is removed.
Example buttons replace the inputs and settings above and calculate. Restore previous input steps back one example at a time. After trying multiple examples, repeat restore to return to your original input. This history is lost when the page closes.
Input lines: A / B / B / C
Four output lines: one A, two Bs and one C, in an unspecified order.
Input: padded A, blank line, B, A and a trailing newline
Three output lines: two As and one B. Blank lines and outer whitespace are omitted.
Duplicate content remains as many times as entered. Shuffling can legitimately return the original order. This is unsuitable when blank lines or indentation must remain byte-for-byte unchanged; check the output line count and duplicate counts.
At least two non-empty trimmed lines are required. Deduplication, sampling and fixed-seed replay are unsupported. Examples replace input and output. Restore recovers the original input including its whitespace and blank lines, but not a previous shuffled result. Restoring invalidates the result and copy button; shuffle again before copying.
Verification: existing functions check duplicate multisets, blank-line removal and rejection of fewer than two lines. Browser checks compare actual line counts and multiplicities without assuming an order, then verify restoration of whitespace-rich input and copy state.
Input lines A, B, A produce two A lines and one B line. A shuffle can return the original order; a different order is not guaranteed.
Leading and trailing whitespace is trimmed and blank lines are omitted. The input stays unchanged so you can compare it with the output before copying.
No. Every occurrence is preserved.
Blank lines are ignored.
Yes. The input field is not changed when the result is shuffled.
Share only the tool name and public URL. Your input and results are not included.
Keep any content you need before clearing. This tool does not autosave inputs or results. Reloading or closing the page, clearing inputs or resetting may discard your work.
Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.