Random Sampler
Randomly select specified number of items from a list. Supports sampling with and without replacement.
What is Random Sampler?
Random Sampler is a free online tool for randomly selecting a specified number of items from a list. It uses the Fisher-Yates shuffle algorithm to ensure fair and random sampling.
How to Use This Tool?
- Enter List: Enter or paste the list items for sampling in the text box, one item per line.
- Set Sample Size: Enter the number of items to sample.
- Select Separator: Choose newline, comma, or tab as separator based on your input format.
- Choose Sampling Mode:
- Uncheck “Allow Duplicates”: Sampling without replacement (each item appears at most once)
- Check “Allow Duplicates”: Sampling with replacement (same item can be selected multiple times)
- Start Sampling: Click the “Sample” button to get results.
Key Features
- Without Replacement: Uses Fisher-Yates shuffle algorithm, each item appears at most once
- With Replacement: Allows duplicate selection, same item can be selected multiple times (for lotteries)
- Multiple Separators: Supports newline, comma, tab as list separators
- Visual Results: Display sampled items as tags for clarity
- One-click Copy: Copy sampling results to clipboard
Use Cases
- Lottery Events: Randomly select winners from participant lists
- Data Sampling: Randomly select samples from large datasets for analysis
- Test Data: Randomly select portion of data for testing from complete data
- Random Assignment: Randomly assign tasks, rooms, seats, etc.
- Survey Sampling: Randomly select survey subjects from a population
Frequently Asked Questions (FAQ)
Is this tool safe?
Absolutely safe. This tool runs entirely in your browser (client-side processing). Your list data is not uploaded to any server.
What’s the difference between sampling with and without replacement?
- Without Replacement: Randomly selects specified number of items from the list, each item appears at most once. Suitable for selecting winners from a group of people.
- With Replacement: Each selection is independent, the same item can be selected multiple times. Suitable for simulating dice rolls, roulette draws, etc.
Is the sampling truly random?
Yes. The tool uses the Fisher-Yates (also known as Knuth) shuffle algorithm, one of the most classic and fair shuffle algorithms in computer science. Each sampling is an independent truly random selection.
Can the sample size be larger than the list length?
If “Without Replacement” is selected, the sample size cannot exceed the list length. If “With Replacement” is selected, the sample size can be set arbitrarily.