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.
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.
- In the Job menu, choose Shuffle lines.
- 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.
- 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 to LF (Unix) or CRLF (Windows) when another program needs one of them.
- Press Process lines. Cancel stops a run and keeps your input.
- 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.
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.
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.
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.