随机数生成器
在选定范围内生成随机整数,支持唯一性和多次抽取的选项。
What the random number generator does
This tool produces genuinely random whole numbers inside a range you choose. You set a minimum and a maximum, say how many numbers you want, and optionally tick “unique” so no value repeats. It is the utility you reach for whenever you need an impartial pick and do not want to trust your own instinct: drawing a giveaway or raffle winner from a list of entry numbers, rolling dice or simulating a lottery, seeding a spreadsheet or database with test data, choosing a random sample of rows to spot-check, bucketing users for a rough split test, or simply settling who goes first. Both bounds are inclusive, so a range of 1 to 6 can return any of 1, 2, 3, 4, 5 or 6, exactly like a real die, and a range of 0 to 99 gives you all one hundred values.
How it stays fair, and why that is harder than it looks
The important detail is where the randomness comes from. Plenty of quick scripts use JavaScript’s Math.random(), which is fast but is a pseudo-random generator never meant to be unpredictable, and mapping it onto a range with a plain % (modulo) quietly introduces bias. This tool instead calls the browser’s cryptographic source, crypto.getRandomValues(), to fill a 32-bit unsigned integer, then uses rejection sampling to fit it to your range without skewing the odds. In plain terms it works out the largest whole multiple of your range size that fits inside 2³², discards any raw draw above that cutoff, and only then takes the remainder. Throwing away that leftover band is exactly what makes every number equally likely, instead of the lowest few values being very slightly favoured — the hidden lean you would inherit from a naive modulo. The outcome is a uniform, unbiased draw that is safe to use for fair selection.
Ranges, counts and the unique option
You can draw a single number or up to a thousand at once, and each bound may sit anywhere between minus one billion and plus one billion. If you enter the minimum and maximum the wrong way round the tool swaps them for you rather than erroring. The “unique” checkbox changes the behaviour to sampling without replacement, which is what you want for a shortlist of distinct winners or a set of non-colliding row numbers.
- Picking 5 unique numbers from 1–100 gives you five different values — useful for choosing distinct raffle tickets or test IDs.
- Asking for more unique numbers than the range can hold is impossible (there are only so many distinct values), so the tool tells you rather than looping forever.
- Without “unique”, repeats are expected and correct — ten dice rolls can absolutely land on the same face twice.
- These are integers only; if you need decimals, scale the output yourself (for example divide by 100 for two-place values).
Where to draw the line
Even though the numbers come from a cryptographic source, a short numeric range holds very little entropy, so this is a tool for fair selection and test data, not for minting secrets. A random number between 1 and 100 is one of only a hundred outcomes and would be trivially guessable as a password or token. When you actually need an unpredictable secret — an API key, a session identifier, a strong credential — use a dedicated generator with far more entropy; if you are wiring randomness into your own services, our developer docs describe the token and key patterns we recommend. For raffles, dice, sampling and shuffling, though, this is exactly the right tool.
Private by design
Everything happens in your browser. The ranges you type and the numbers that come out are generated locally on your own device using the built-in cryptographic API — nothing is sent to a server, nothing is stored, and nothing is logged. That matters for a fairness tool: because no draw ever leaves your machine, there is no server-side record that could be second-guessed, and the result is yours alone. Refresh the page and every previous draw is simply gone.
人们通过搜索找到此页面
- 随机数生成器
- 随机数生成器 的工作原理
- 随机数生成器 用于 Windows
- 随机数生成器设置
- 最佳 随机数生成器 2026
- 免费代理列表 解释
- 免费代理列表
- wireguard 安卓版
- http 代理 安卓版
- 新鲜的免费代理列表
- 代理设置
- 最佳 代理认证 2026
- http 代理
- 我的 IP 地址是什么?
- 免费网络工具
- 代理检查器
此页面回答的真实搜索短语 — 链接的短语打开详细覆盖它们的页面。