Vai al contenuto
RandoKit
IT

Generatore di numeri casuali

Imposta un minimo, un massimo e quanti numeri ti servono. Scegli se ammettere ripetizioni e se ordinare il risultato. I numeri sono estratti con la Web Crypto API tramite campionamento a rifiuto, quindi la distribuzione è uniforme.

Cronologia

Ancora nessun risultato. Usa lo strumento per vedere la cronologia.

Funziona nel tuo browser

Tutto avviene localmente sul tuo dispositivo. I tuoi nomi e le tue liste non vengono mai caricati e i risultati usano la casualità sicura del browser.

RandoKit è pensato per le decisioni di tutti i giorni. Non è certificato per il gioco d'azzardo regolamentato, le lotterie ufficiali o le estrazioni legalmente vincolanti.

Come si usa

  1. 1Imposta il valore minimo e massimo.
  2. 2Scegli quanti numeri generare.
  3. 3Decidi se ammettere duplicati e se ordinare l'output.
  4. 4Premi Genera numeri, poi copia i risultati.

Esempi d'uso

  • Scegliere numeri in stile lotteria per un gioco in ufficio.
  • Generare un codice tipo PIN per un gioco in classe.
  • Scegliere una pagina o una domanda a caso da un libro.
  • Campionare righe casuali da un foglio di calcolo.

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.

Domande frequenti

Sono supportati i numeri negativi?

Sì. Qualsiasi intervallo di interi va bene, purché il massimo sia maggiore o uguale al minimo.

Perché non riesco a generare numeri unici?

Se chiedi più numeri unici di quanti ne contenga l'intervallo, lo strumento ti avvisa. Allarga l'intervallo o consenti i duplicati.

La distribuzione è uniforme?

Sì. Il campionamento a rifiuto su crypto.getRandomValues() elimina il bias del modulo delle implementazioni ingenue.

Guides that use this tool