Roll a die on a website and you get a number. Flip a virtual coin and you get heads or tails. It feels exactly like the real thing, but nothing physical happened -- no cube tumbled, no coin spun. A website has to manufacture that unpredictability entirely in software, and how well it does that depends on what it's being used for.
There's no dice cup inside your browser
Computers are built to be predictable. Give a program the same input twice and it's supposed to produce the same output twice -- that's the whole point of a computer being reliable. Randomness has to be faked on top of that, using something called a pseudorandom number generator (PRNG). A PRNG starts from a seed value, usually derived from something that changes constantly, like the current time down to the millisecond, and runs it through a formula that scrambles it into a sequence of numbers that looks random to a human but is technically fully determined by that starting seed.
In JavaScript, this is Math.random(). It's fast, it's built into every browser, and for rolling a die or flipping a coin, it's completely fine. Nobody is going to reverse-engineer the seed of your dice roll to cheat at a board game.
Where "looks random" stops being good enough
The problem shows up when randomness needs to resist someone trying to predict it on purpose. Math.random() was never designed to be unpredictable under attack -- in some browser implementations, if you know enough consecutive outputs, you can work backward and guess the next ones. That's irrelevant for a coin flip deciding who goes first in a game. It's a real problem if that same kind of generator were used to create a password, a security token, or an encryption key.
That's why browsers ship a second, separate random number source: the Web Crypto API's crypto.getRandomValues(). It pulls from the operating system's cryptographically secure random number generator, which draws on genuinely unpredictable inputs the OS collects -- things like precise timing jitter in hardware events. It's slower and more overhead than Math.random(), which is exactly why it's reserved for things that actually need it.
Why your dice roll and your password aren't held to the same standard
A good rule of thumb: if the output needs to look fair to a human watching a game, Math.random()-style randomness is plenty. If the output needs to be unguessable by someone actively trying to guess it, it needs cryptographic randomness. A die roll, a coin flip, picking a random number from a range, shuffling a quiz question order -- none of that has an adversary. A password or an API key does, because someone with a financial reason to crack it might actually try.
Does any of this change what you experience?
Not for games. Statistically, a well-implemented PRNG distributes outcomes evenly across millions of rolls, so a die built on Math.random() isn't going to run "hot" or "cold" in any way a human would notice over a normal session. If you roll a die ten times and get three sixes, that's not the random number generator failing -- a six-sided die lands on any face about 1 in 6 times, and small samples swing around that average constantly, exactly like a real die would.
Where the distinction actually matters is if a tool is generating something you'll rely on for security. A password generator should be pulling from the cryptographic source, not the games-grade one, precisely because its output needs to survive someone trying to predict it, not just look plausible to a casual glance.
Try it yourself
You can roll anything from a standard six-sided die up to a d100 with the Dice Roller, flip a coin with the Coin Flipper, or pull a number from any range you set with the Random Number Generator -- all running the games-grade randomness that's exactly right for the job. For anything security-related, the Password Generator uses the stronger cryptographic source instead, which is the whole reason it exists as a separate tool rather than reusing the same function.