Random Name Picker
Pick a random name from a comma-separated list
About This Tool
Selects one or more entries at random from a user-supplied list. Use cases include classroom student selection, raffle drawings, team assignment, and decision-making aids. Output preserves selection uniqueness when 'no repeats' is enabled.
The underlying randomness uses the Web Crypto API where available, falling back to Math.random() otherwise. Crypto-grade randomness is sufficient for non-adversarial selection; high-stakes drawings should use audited external services.
The selection algorithm depends on the configuration. For a single random pick, the algorithm samples one uniform integer in [0, list-length) and returns that entry. For multiple picks with replacement, the same algorithm runs n times. For multiple picks without replacement (uniqueness enforced), the Fisher-Yates shuffle applied to a copy of the list produces a uniformly random permutation, from which the first n elements are taken. Fisher-Yates runs in O(n) time and produces statistically uniform results.
The randomness source matters for fairness. Math.random() in JavaScript is implemented as a pseudo-random generator with reasonable but not cryptographic quality; it is sufficient for non-adversarial selection but predictable enough that an attacker observing past outputs could potentially guess future ones. Web Crypto's getRandomValues() draws from operating-system entropy pools (/dev/urandom on Linux, BCryptGenRandom on Windows) and produces output indistinguishable from true random for any practical purpose. The picker uses Web Crypto when available, defaulting to Math.random() only as fallback.
A worked example: a teacher with a list of 28 students picks one at random for a daily question. Each student has a 1/28 = 3.6% chance per pick. Across 30 school days picking with replacement, each student is expected to be picked 30/28 ≈ 1.07 times, with significant variance — some students may be picked 3 times, some 0 times. To achieve approximate equity, "no repeats" mode picks without replacement: 28 unique picks across 28 days (one per day), then optionally restart for the second cycle. This converts random selection into structured rotation.
Weighted selection extends the basic algorithm. Each entry has a weight (default 1); the selection probability is weight divided by total weight. A list of raffle ticket holders where Alice bought 5 tickets and Bob bought 1 ticket gives Alice 5/6 selection probability per draw. Implementation uses cumulative-weight sampling: compute the cumulative sum of weights, draw a uniform value in [0, total], and find the entry where the cumulative sum first exceeds the value. O(n) per draw, or O(log n) with sorted cumulative weights and binary search.
Limitations: the picker is unsuitable for legally regulated drawings. Sweepstakes, gambling, and raffle drawings with material prizes typically require certified randomness with audit trails — verifiable random functions, hardware random number generators with NIST certification, or third-party drawing services with public broadcasts. The picker is a casual tool; high-stakes use cases should use Random.org's certified drawing service or equivalent.
The about text and FAQ on this page were drafted with AI assistance and reviewed by a member of the Coherence Daddy team before publishing. See our Content Policy for editorial standards.