🎲 Random Number Generator

Generate truly random numbers using the Web Crypto API. Single numbers, sets, dice, and more.

🎲 Random Number Generator

?
📖
Related Guide
Random Selection: True Randomness vs Picking Fairly From a List
When basic randomness is enough, and when true randomness matters.
Read Article →

What is the Random Number Generator?

This tool generates numbers using crypto.getRandomValues() — the same cryptographically secure random number API used in security applications — rather than the weaker Math.random() function. It covers four modes: a single random integer in a range, a set of multiple numbers (with or without repeats), a dice roller for any number of sides, and a coin flip, so one page handles nearly every everyday randomization need.

How to Use It

Choose the tab that matches your need. For a single number, set a minimum and maximum and click Generate. For a set — like lottery numbers — set the range, how many numbers you want, and whether repeats are allowed. The dice roller lets you pick the number of dice and sides per die, and the coin flip tab lets you flip one or many coins at once, with a running history kept below the result.

When to Use It

Use it for picking lottery or raffle numbers, running a tabletop game that needs dice rolls, settling a decision with a coin flip, drawing a random sample for a survey or experiment, or randomly selecting a winner from a numbered list of entries without any risk of bias.

Who Benefits

Teachers picking random students, game designers testing mechanics, researchers drawing random samples, and anyone running a raffle or giveaway can get an unbiased result instantly instead of relying on guesswork or a physical dice and coin that might not be handy.

Frequently Asked Questions

It uses crypto.getRandomValues(), the Web Crypto API's cryptographically secure random source, rather than the weaker Math.random(). This produces numbers that are statistically indistinguishable from true randomness and are safe to use even for fair drawings and lottery-style selections.
Use the "Multiple / Set" tab. Set your min and max range, how many numbers you want, and switch "Unique Only?" to Yes so no number is repeated in the results — exactly what you'd need for lottery-style number picks.
The Dice Roller rolls any number of dice, but all with the same number of sides per roll — choose from d4, d6, d8, d10, d12, or d100. To combine different die types, roll each type separately and add the totals yourself.