Skip to content
Everyday Utilities Free · No signup · Private · Instant results

Random Picker

Pick a random item from your list — great for raffles and decisions.

About the Random Picker

The Random Picker selects one or more items randomly from a list you provide. Paste a list of names, options, or any text items, choose how many to pick, and decide whether repeats are allowed. The tool uses the Fisher-Yates shuffle — the algorithm recommended by Donald Knuth in The Art of Computer Programming (Volume 2, Section 3.4.2) — for unbiased without-replacement sampling.

Random selection has surprising depth. The naive approach — repeatedly picking a random index from the list — produces biased results when picking more than one item, because the same item can be picked twice (with replacement) or the algorithm must retry (slow). Fisher-Yates solves this by shuffling the entire list in a single pass, then taking the first N items. Each permutation has exactly equal probability.

JavaScript’s Math.random() uses a PRNG (pseudo-random number generator) — specifically, an xorshift128+ variant in V8 (Chrome, Node) and a similar algorithm in SpiderMonkey (Firefox) and JavaScriptCore (Safari). PRNGs are deterministic and reproducible from a seed, which is why this tool is not suitable for cryptographic uses. For password generation or PIN codes, use the dedicated PIN Code Generator which uses crypto.getRandomValues().

Common uses include picking a winner for a raffle, choosing a team member for a task, deciding what to eat for dinner from a list of restaurants, generating a random sample for a survey, and selecting test data from a larger dataset. The separator option supports newline (for pasted lists), comma, or semicolon (for spreadsheet exports).

How It Works

The tool first parses the input using the chosen separator (newline, comma, or semicolon), trims whitespace from each item, and discards empty entries. This produces a clean list of strings.

For unique picks (without replacement), the tool implements the Fisher-Yates shuffle: for i from n-1 down to 1: j = random integer in [0, i]; swap arr[i] and arr[j]. The first count items of the shuffled list are returned. This algorithm is O(n) in time and O(n) in space (because we copy the list with slice() to avoid mutating the original).

For non-unique picks (with replacement), the tool simply picks count random indices, each independent of the others: arr[Math.floor(Math.random() * arr.length)]. This is O(count) in time and O(count) in space.

The random seed shown in the output is a 32-bit hex value generated at the time of the pick. It is for reference only — JavaScript’s Math.random() does not allow seeding the underlying PRNG, so the seed cannot be used to reproduce the result. For reproducible randomness, use a seeded PRNG library like seedrandom or the new Math.random() replacement in the Web Crypto API.

Edge cases: an empty input is rejected. Picking more unique items than the list contains is rejected (you cannot pick 5 unique items from a list of 3). A pick count below 1 or above 1000 is rejected to prevent abuse. The input is split on the chosen separator, so items containing the separator character need a different separator.

Worked Examples

Default list (7 names), pick 1, unique mode, newline separator: returns one name at random, like ‘Diana’. Each name has a 1/7 = 14.3% chance of being picked.

Same list, pick 3, unique mode: returns 3 distinct names in random order, like ‘Frank, Alice, Grace’. Each subset of 3 names has equal probability.

Same list, pick 3, with-replacement mode: returns 3 names, possibly with repeats, like ‘Charlie, Charlie, Bob’. Useful for simulating dice rolls or weighted sampling.

Comma-separated input red, blue, green, yellow, purple, pick 2, unique mode, comma separator: returns 2 distinct colors, like ‘green, red’.

Single-item list, pick 1, unique mode: returns the only item, deterministically. This is a degenerate case — the picker always returns the same result.

When to Use This Tool

  • Running a fair raffle or giveaway — paste the entrants list and pick one winner.
  • Choosing a team member for a chore or task when nobody volunteers.
  • Deciding what to eat for dinner from a list of restaurants.
  • Generating a random sample of survey respondents from a larger population.
  • Picking test data from a production dataset for QA testing.
  • Selecting a random order for presentations or turn-taking in a meeting.
  • Splitting a class into random groups for a project.

Limitations & Disclaimer

The picker uses JavaScript’s Math.random(), which is a pseudo-random number generator suitable for statistical sampling but not for cryptographic or security purposes. For PIN codes, passwords, or lottery drawings, use crypto.getRandomValues() via the PIN Code Generator. The Fisher-Yates implementation is unbiased (picks j from [0, i] at each step). The seed shown in the output cannot be used to reproduce the result because Math.random() does not accept a seed argument. See our disclaimer for full terms.

Frequently Asked Questions

Is the picker truly random?

It uses JavaScript&rsquo;s <code>Math.random()</code>, which is a pseudo-random number generator (PRNG) based on xorshift128+ (in V8). PRNG output is statistically uniform but deterministic from the seed state &mdash; it is not cryptographically secure. For statistical sampling, raffles, and games, it is more than sufficient. For security-sensitive uses (PINs, passwords, lottery drawings), use the Web Crypto API via <code>crypto.getRandomValues()</code>; see the <a href='/tools/pin-code-generator.php'>PIN Code Generator</a>.

What is the difference between with-replacement and without-replacement?

Without replacement (unique mode) means each item can be picked at most once &mdash; like drawing cards from a deck. With replacement means each pick is independent &mdash; like rolling a die. Use without replacement for raffles and group assignments; use with replacement for simulations and bootstrap sampling.

Why does the seed in the output not reproduce the result?

JavaScript&rsquo;s <code>Math.random()</code> does not accept a seed argument &mdash; the seed is internal state, set from system entropy at page load. The seed shown in the output is a freshly generated random value for reference only; it cannot be passed back to <code>Math.random()</code> to reproduce the pick. For reproducible randomness, use a third-party seeded PRNG.

How does the Fisher-Yates shuffle guarantee unbiased results?

At each step <code>i</code>, the algorithm picks <code>j</code> uniformly from <code>[0, i]</code> (not <code>[0, n-1]</code>). This ensures each of the <code>n!</code> possible permutations has equal probability. The common implementation bug is picking <code>j</code> from <code>[0, n-1]</code> at every step, which produces biased permutations.

What is the maximum list size?

There is no hard limit on the list size, but very large lists (over 100,000 items) may be slow to display in the textarea. The Fisher-Yates shuffle is O(n), so even a million-item list shuffles in well under a second on modern hardware. The pick count is capped at 1000 to prevent UI abuse.

Can I paste items with the separator character inside them?

If your separator is newline and an item contains a newline (e.g. a multi-line address), the item will be split into two pieces. Use a different separator (comma or semicolon) or replace newlines inside items with spaces before pasting. For complex structured input, consider using a JSON array as input.

Last updated: September 9, 2026  ·  Author: HT99 Tools Editorial Team