Ir al contenido
RandoKit
ES

Generador de números aleatorios

Define un mínimo, un máximo y cuántos números necesitas. Elige si se permiten repeticiones y si quieres ordenar el resultado. Los números se extraen con la Web Crypto API usando muestreo por rechazo, así la distribución es uniforme.

Historial

Aún no hay resultados. Usa la herramienta para ver el historial.

Funciona en tu navegador

Todo ocurre localmente en tu dispositivo. Tus nombres y listas nunca se suben, y los resultados usan la aleatoriedad segura del navegador.

RandoKit está pensado para decisiones cotidianas. No está certificado para juegos de azar regulados, loterías oficiales ni sorteos legalmente vinculantes.

Cómo usarla

  1. 1Fija el valor mínimo y el máximo.
  2. 2Elige cuántos números generar.
  3. 3Decide si se permiten duplicados y si quieres ordenar la salida.
  4. 4Pulsa Generar números y copia los resultados.

Ejemplos de uso

  • Elegir números tipo lotería para una porra de oficina.
  • Generar un código tipo PIN para un juego en clase.
  • Escoger una página o pregunta al azar de un libro.
  • Muestrear filas aleatorias de una hoja de cálculo.

About this tool

How the number generator computes a draw

You set a minimum and a maximum, and the tool treats both bounds as inclusive — asking for 1 to 10 can return 1 or 10, not just the numbers between them. Under the hood, each number is produced with crypto.getRandomValues(), which reads from the browser's cryptographic random source rather than Math.random(). Because the range you request rarely divides evenly into the raw bytes the API returns, the tool uses rejection sampling: it discards any raw value that would introduce a slight bias toward the low end of the range (the classic "modulo bias" problem) and re-draws until it gets a value that maps cleanly onto your range. The result is that every integer in [min, max] has exactly equal probability, not an approximation of it.

Count, duplicates, and sort order

The "how many numbers" setting controls how many values come out of a single draw. With duplicates allowed, each number is drawn independently, so the same value can appear more than once — useful for simulating repeated dice-like rolls or generating random amounts. With duplicates forbidden, the tool draws without replacement: once a number is picked it's removed from the eligible pool, guaranteeing a set of distinct values. Sorting is purely cosmetic and happens after the draw — choosing ascending or descending order doesn't change which numbers were picked, only how they're displayed and exported.

Worked example: a 6-from-49 style pick

Say you want to draw 6 unique numbers between 1 and 49, sorted ascending, to run a private lottery-style pool. Set min to 1, max to 49, count to 6, and turn off duplicates. The tool draws the first number from all 49 candidates, removes it, draws the second from the remaining 48, and so on until 6 numbers are chosen, then sorts them for display — something like 3, 11, 22, 29, 34, 47. Every one of the 49 numbers had an equal 1-in-49 chance of being the first pick, and the full combination is one of just over 13.9 million equally likely 6-number sets.

When to use this vs. other RandoKit tools

Reach for this tool whenever you need plain numeric output — raffle ticket numbers, sample sizes for a survey, a seed value, or picking a handful of unique numbers from a large range. If your goal is actually to roll dice with the sum-of-multiple-dice distribution tabletop games use, the dice roller is the right tool instead, since a d20 roll and a "random number 1-20" pick behave the same, but 2d6 does not behave like a flat 2-12 range (see the dice roller's page for why). And if you're choosing from a list of names rather than numbers, use the random winner picker. For background on the underlying math, the guide on how random number generators work goes deeper.

Common mistakes

  • Forgetting that bounds are inclusive and setting max one lower than intended, silently excluding a value you wanted eligible.
  • Requesting a "duplicates forbidden" draw with a count larger than the range itself, which isn't possible — you can't draw 10 unique numbers from a 1-5 range.
  • Assuming a small sample of draws will look evenly spread out. Ten draws from 1-100 will often leave visible gaps and a cluster or two purely by chance, not by a flaw in the tool.

Fairness and modulo bias

A naive way to turn a random byte into a "random number 1-49" is to take the byte modulo 49, but because 256 (the range of a byte) doesn't divide evenly by 49, low numbers would come up very slightly more often than high ones. Rejection sampling avoids this: the tool only accepts raw random values that fall within an evenly-divisible range for your min/max, and discards the rest before re-rolling, which removes the bias entirely rather than shrinking it. See Math.random() vs crypto.getRandomValues() for a fuller comparison of why this matters.

Privacy

All number generation happens locally in your browser — nothing about your range, count, or results is sent to a server. Past draws are kept in your browser's local storage only, and you can export results as .txt or .csv, or share a draw via an encoded URL, without any data leaving your device.

Preguntas frecuentes

¿Se admiten números negativos?

Sí. Cualquier rango de enteros vale mientras el máximo sea mayor o igual que el mínimo.

¿Por qué no puedo generar números únicos?

Si pides más números únicos de los que caben en el rango, la herramienta avisa. Amplía el rango o permite duplicados.

¿La distribución es uniforme?

Sí. El muestreo por rechazo sobre crypto.getRandomValues() elimina el sesgo de módulo de las implementaciones ingenuas.

Guides that use this tool