Generador aleatorio (Dados, Monedas, Cartas)
Lance dados, lance monedas al aire, saque cartas aleatorias y genere números aleatorios — todo criptográficamente aleatorio.
Acerca de esta herramienta
Genere resultados verdaderamente aleatorios para juegos, decisiones y simulaciones. Lance múltiples dados (d4, d6, d8, d10, d12, d20, d100), lance múltiples monedas al aire, saque cartas de juego aleatorias de una baraja mezclada o genere números aleatorios en cualquier rango. Toda la aleatoriedad usa la API WebCrypto.
Cómo usar
- 1 Seleccione una pestaña: Dados, Monedas, Cartas o Número.
- 2 Configure los ajustes del lanzamiento.
- 3 Haga clic en Lanzar/Voltear/Sacar para generar.
- 4 Los resultados se muestran con un historial de lanzamientos recientes.
What "truly random" means here
There are two grades of randomness in software. The everyday kind, produced by Math.random(), is a fast pseudo-random sequence that is fine for shuffling a playlist but is technically predictable if you know its internal state. The stronger kind comes from the browser's WebCrypto API via crypto.getRandomValues(), which draws from the operating system's cryptographic entropy pool — the same source used to generate encryption keys. This generator uses the cryptographic source for every dice roll, coin flip, card draw, and number, so each outcome is genuinely unpredictable rather than merely hard to anticipate.
How a fair roll avoids hidden bias
Getting an unbiased number in a range is subtler than it looks. The naive approach — take a random 32-bit integer and apply value % 6 for a die — quietly favours some faces. Because 2³² is not evenly divisible by 6, the lowest few results occur slightly more often than the highest. This is called modulo bias, and over thousands of rolls it skews the distribution.
This tool removes the bias with rejection sampling. It requests a fresh random 32-bit value and, if that value falls in the small "leftover" zone that would cause an uneven split, it throws it away and draws again. Only values from the evenly divisible portion are accepted. The cost is occasionally asking for one extra random number; the benefit is a die, coin, or range that is mathematically fair, not approximately fair.
Four generators in one
| Tab | What it produces | Range per item |
|---|---|---|
| Dice | 1–100 dice of d4, d6, d8, d10, d12, d20, or d100 | 1 to the number of sides |
| Coins | 1–100 coin flips, reported as Heads/Tails | 2 outcomes |
| Cards | Draws from one shuffled 52-card deck | cards removed until reset |
| Number | Integers in any min–max range, with optional no-duplicates | min to max inclusive |
The card deck is the one stateful generator. When you load the page or press New Deck, all 52 cards are built and shuffled with a Fisher–Yates pass driven by the same cryptographic source. Each draw removes cards from the deck, so you will never see the same card twice until you reset — exactly like dealing from a real shuffled deck.
A worked example: rolling 2d6
Set the dice tab to a count of 2 and 6 sides, then roll. Each die independently lands on 1–6, and the tool also reports the sum and the average. The two-dice sum is a classic example of why this matters: a total of 7 can be made six ways (1+6, 2+5, 3+4, 4+3, 5+2, 6+1) while a total of 2 can be made only one way (1+1). So even with perfectly fair dice, sums near 7 appear far more often than sums near 2 or 12. The fairness here applies to each individual die; the bell-shaped distribution of the sum is the mathematics of adding them, not a flaw.
The "no duplicates" option for number draws
In the Number tab, ticking No duplicates changes the algorithm entirely. Instead of drawing each value independently (where repeats are possible), it builds the full list of integers from min to max, shuffles it, and slices off as many as you asked for. This guarantees every result is distinct — perfect for a raffle where one ticket cannot win twice, or for picking unique table assignments. If you request more unique numbers than the range can supply (say, 10 unique values from 1–5), the tool refuses with an error rather than looping forever.
Practical use cases
- Tabletop and role-playing games when you do not have physical dice — d20 systems and percentile (d100) rolls are both supported.
- Fair decisions and tie-breakers: flip a coin, or generate one number in a range to pick a winner without anyone questioning the result.
- Raffles and giveaways: use a unique number draw across your ticket range so each number can only be selected once.
- Teaching probability: flip 100 coins at once and watch the heads count cluster near 50, demonstrating the law of large numbers in a single click.
- Sampling and shuffling: draw cards to randomise an order, or pull random numbers to select rows from a dataset.
Common mistakes
- Expecting "even" results. Fair randomness does not mean alternating or balanced — flipping ten heads in a row is unlikely but entirely possible. Each flip is independent of the last.
- Forgetting the deck depletes. If draws stop appearing, the 52-card deck is empty; press New Deck to reshuffle.
- Using it for security. While the underlying source is cryptographic, this is a convenience tool. For passwords or keys, use a dedicated generator.
Privacy
All randomness is generated locally in your browser through the WebCrypto API. No roll, flip, draw, or number is ever sent to a server — the results exist only on your device, and the tool works fully offline.
Preguntas frecuentes
Genera contraseñas aleatorias y seguras con longitud y conjuntos de caracteres personalizables — funciona sin conexión.
Genere UUID v4, UUID v7, ULID y Nano ID — generación masiva con un solo clic.
Calcula porcentajes, incrementos, descuentos, propinas y porcentaje del total — seis modos.