Random draws: fairness, uniqueness, and cryptographic vs PRNG
임의 범위에서 정수 또는 소수 난수를 일괄 생성합니다. 중복 없음 모드 지원.
Random draws: fairness, uniqueness, and cryptographic vs PRNG
Use crypto-backed draws when assigning prizes or secrets. PRNG modes are fine for simulations. “Unique numbers only” prevents duplicate raffle tickets within one batch.
Audit compliance may require external attestation—this page is a convenience utility.
How the numbers are generated
Each number comes from your browser’s cryptographically secure generator (crypto.getRandomValues), the same source used to create encryption keys. It is unpredictable even to someone who has seen every earlier result, and it is never seeded from the clock.
Turning random bits into a number in your range is where many generators go subtly wrong. Taking a 32-bit random value modulo the range size makes low numbers slightly more likely whenever the range does not divide 2³² evenly. This tool uses rejection sampling instead: draws that would fall into that uneven tail are discarded and redrawn, so every integer between your minimum and maximum has exactly the same probability. Ranges wider than 2³² combine two draws into a 53-bit value, the largest whole number JavaScript represents exactly.
Results are whole numbers. If you type decimal bounds they are rounded inward — a range of 1.5 to 9.9 draws from 2 to 9 — so the result can never fall outside what you entered.
Duplicates allowed vs unique numbers only
With duplicates allowed, every draw is independent, like rolling a die several times — repeats are expected and are not a sign of a broken generator. Repeats arrive sooner than most people expect: drawing 10 numbers from 1–100 has a 37% chance of at least one repeat, and drawing 23 numbers from 1–365 crosses 50% (the classic “birthday problem”).
With “unique numbers only” ticked, the tool draws without replacement, like pulling tickets from a hat. For ranges up to 100,000 it shuffles the whole range with a Fisher–Yates shuffle and takes the first N values; for larger ranges it draws and skips any value it has already picked. Either way, the order of the results is itself random.
Worked examples
- Dice: 1 to 6 for a standard die, 1 to 20 for a d20. Set “how many” to the number of dice and leave duplicates allowed — two dice can show the same face.
- Raffle with 250 numbered tickets and 3 prizes: minimum 1, maximum 250, generate 3, unique only. Draw all prizes in one click so no ticket can win twice.
- Lottery-style pick (6 from 49): minimum 1, maximum 49, generate 6, unique only, then sort the numbers yourself if you want them in order.
- Random spreadsheet row: if your data starts on row 2 and ends on row 1,001, use 2 to 1,001 so the header row can never be chosen.
- Splitting 30 people into teams: number everyone 1–30, generate 30 unique numbers, and assign the first 10 results to team A, the next 10 to team B, and so on.
Running a fair public draw
The generator is fair, but a draw also has to be seen to be fair. Agree the range and the number of winners before drawing, run the draw once on screen or on a recorded call, and do not redraw because of an unwelcome result. Publish the settings (range, count, unique or not) alongside the winning numbers.
The tool keeps no log and stores nothing, which protects privacy but means it cannot later prove what was drawn. Sweepstakes and promotions governed by law in some countries require an independently audited draw; use a regulated provider for those.
Limits
- Up to 1,000 numbers per click.
- Bounds can be any whole numbers within about ±9 quadrillion (±2⁵³ − 1).
- In unique mode, “how many” cannot exceed the size of the range — you cannot pick 11 distinct numbers from 1–10.
Related tools
These free tools pair well with this page — open them in a new tab to finish your workflow.
자주 묻는 질문
이것은 진정한 난수인가요?
이 도구는 브라우저의 암호학적으로 안전한 난수 생성기인 window.crypto.getRandomValues()를 사용합니다. 복권 번호, 무작위 키, 논스 생성 등 보안이 중요한 용도에 적합합니다. Math.random()과 달리 이전 결과로 다음 값을 예측할 수 없습니다.
PRNG와 CSPRNG의 차이는 무엇인가요?
PRNG(유사 난수 생성기)는 시드로 초기화된 결정론적 알고리즘을 사용합니다. 같은 시드면 같은 수열이 생성됩니다. CSPRNG(암호학적으로 안전한 PRNG)는 이전 출력을 알아도 예측 불가능합니다. 이 도구는 CSPRNG를 사용합니다.
같은 숫자가 두 번 생성될 수 있나요?
네. 각 숫자는 동일한 확률로 독립적으로 추출되므로 유일성이 보장되지 않습니다. 고유한 숫자가 필요하면 여러 개 생성 후 중복을 제거하거나 셔플/순열 방법을 사용하세요.
사용할 수 있는 최대 범위는 얼마인가요?
JavaScript 안전 정수 범위 내의 정수(최대 2^53 - 1)를 지원합니다. 범위 내 모든 값의 확률이 같습니다. 나머지 연산 편향을 피하기 위해 거부 샘플링을 사용하며, 2^32보다 넓은 범위는 32비트 난수 두 개를 결합합니다.
주사위 굴리기를 시뮬레이션하려면?
표준 6면 주사위는 1~6 범위를 설정하세요. 기타 주사위: d4는 1~4, d8은 1~8, d10은 1~10, d12는 1~12, d20은 1~20(테이블탑 RPG에서 자주 사용).