Text tools
Randomize list order, or sort and remove duplicate lines
To randomize list order, paste one item per line, choose Shuffle lines in the Job menu and press Process lines. This list randomizer puts the lines in a random order drawn from your browser's cryptographic random source. It runs in your browser tab. The same page can also sort lines or remove duplicate lines.
Processed in your browser
Comparisons keep original spelling and whitespace. Dedupe keeps the first matching line. Only settings that apply to the chosen job are shown.
Editor text: CRLF and CR become LF. Output downloads use your chosen line endings and UTF-8.
Counts appear after processing.
Choose a job and settings, then process lines.
How to randomize a list
The page opens on the sort job, so choose the shuffle job first. Settings that only apply to sorting or duplicate checks hide while Shuffle lines is selected.
- Choose Shuffle lines
In the Job menu, choose Shuffle lines.
- Add one item per line
Paste your list into the Input text box, one item per line. You can also press Open UTF-8 file to load a text file, or Use example to try a sample.
- Choose which blank lines to keep
To leave blank items out, set Blank lines to Remove empty lines or Remove whitespace-only lines. The default, Keep all, shuffles blank lines with the rest.
- Set output line endings
Set Output line endings to LF (Unix) or CRLF (Windows) when another program needs one of them.
- Process the list
Press Process lines. Cancel stops a run and keeps your input.
- Copy or download the new order
Read the counts next to the Result heading, then press Copy result or Download .txt. The download is named shuffle-lines.txt.
Press Process lines again for another random order. Reset clears the text and restores the default settings.
How the shuffle works
The shuffle uses the Fisher-Yates method. It walks from the last line to the first and swaps each line with a line at a random position at or before it. Each random position comes from crypto.getRandomValues, the browser's cryptographic random source. The engine throws away random values that would favor some positions and draws again.
A 4-line list has 24 possible orders. In a Node.js measurement, the engine shuffled a 4-line list 240,000 times. All 24 orders appeared, each between 9,790 and 10,179 times against 10,000 expected. The chi-square statistic was 17.53 with 23 degrees of freedom, under the 41.64 cutoff at the 1% level.
With Blank lines set to Keep all, the shuffle keeps every line, including repeated items and blank lines. It can also return the original order, 1 time in 24 for 4 different lines. When the result matches the input exactly, including its line endings, the status line reads "No changes: output matches input."
Remove duplicates or sort the same list
Two other jobs share this page. Remove duplicate lines keeps the first copy of each line and deletes later copies, so the kept lines stay in input order. Ignore case in comparisons treats Anna and anna as the same line. Ignore edge whitespace in comparisons does the same for spaces and tabs at the start or end, and the kept line keeps its original text.
Ignore case uses Unicode lowercase conversion, independent of Sorting locale. Ignore edge whitespace uses JavaScript's trim rules. Duplicate checks do not normalize Unicode or use locale equivalence, so an accented letter and the same letter with a separate combining accent can remain distinct.
Sort lines puts the list in Ascending or Descending order. Sort comparison offers Code unit order, Locale alphabetical and Natural (item2 before item10). With Locale alphabetical or Natural selected, Sorting locale sets the alphabetical order, so ä sorts after z in Swedish and between a and z in German. Natural order compares runs of digits, so negative numbers, decimals and dates can end up out of order.
Lines with equal comparison keys keep their input order in both directions. Browser collation data can vary. The result status reports the browser's resolved sorting locale.
The shuffle keeps repeated lines. If a list of names has someone entered twice and each person should appear once, run Remove duplicate lines first. Then press Use as input and run Shuffle lines.
Limits
The tool reorders a whole list. It does not pick a winner or split a list into groups, and it is not a certified drawing or audit system.
Each run does one job. There is no seed option, so you cannot ask for the same random order again. Copy or download the result if you need it later. Entries have no weights, so every line has the same chance at every position.
An item is one whole line. The tool does not split items on commas, read spreadsheet columns or shuffle the words inside a line, so a word list needs one word per line. Opened files must be valid UTF-8 text, and other bytes show an error. Duplicate checks do not remove accents or normalize Unicode, so café and cafe stay two lines.
There is no fixed size cap. The memory your browser gives the tab limits the list size, and a very large result can make the Result box slow.
Questions
How do you shuffle a list?
Put each item on its own line and apply a Fisher-Yates shuffle. Here, choose Shuffle lines in the Job menu, paste the list into Input text and press Process lines. The engine swaps each line with a random position at or before it, using the browser's cryptographic random values.
How do I randomize a list?
Make sure each item sits on its own line, then paste the list into the Input text box or open a UTF-8 text file. Choose Shuffle lines. If the list has gaps, set Blank lines to Remove whitespace-only lines, which drops empty lines and lines with only spaces or tabs. Press Process lines, then copy or download the new order.
What app can I use to randomize a list?
Use this page in a web browser. It needs JavaScript, Web Workers, Intl.Collator and crypto.getRandomValues. Without them, the page shows a message and keeps Process lines disabled. In the project's browser test, the layout fit a 390-pixel-wide screen with no sideways scrolling.
How do I put a list in alphabetical order?
Choose Sort lines in the Job menu and set Sort comparison to Locale alphabetical. Pick a Sorting locale, keep Sort order on Ascending for A to Z, and press Process lines. The default, Code unit order, compares character codes and puts Zoe before adam. Each line sorts as a whole, so Ada Lovelace sorts under A.
How are numbers sorted?
Code unit order compares digits as characters, so item10 sorts before item2 and 10 before 9. Set Sort comparison to Natural to compare runs of digits as numbers, which puts item2 before item10. A minus sign or decimal point is not part of that number, so -10 sorts after -5 and 1.25 after 1.5.
What happens to blank lines and line endings?
CRLF, LF, CR, Unicode line separator and paragraph separator split the input into lines. A final separator ends the last line without adding another item. Empty input has zero lines. Blank lines filtering runs before sorting, shuffling or duplicate removal. Whitespace-only filtering includes spaces, tabs and other JavaScript trim whitespace.
Output uses the chosen LF or CRLF endings and keeps a leading UTF-8 byte order mark. Final newline applies to nonempty output. Even with Omit when possible selected, a final empty record needs a terminating newline to preserve it. The result status explains when this happens.
Does the preview match the downloaded file?
The preview shows the same text. Browser textareas display CRLF endings as LF, while Download .txt saves the selected line endings and any leading UTF-8 byte order mark. Editing a loaded file or choosing Use as input switches to editor text with LF endings. Programs that receive copied text may change its line endings.
Open UTF-8 file decodes strictly, regardless of the filename extension or MIME type. Malformed UTF-8 bytes show an error.
Are my files uploaded?
No. Open UTF-8 file reads the file in a Web Worker inside your browser tab, and Process lines loads only the tool's own code from this site. In the project's browser test, the page sent no request to another origin and wrote nothing to local storage while it sorted, removed duplicates, shuffled, opened a file and saved results.