Skip to main content
Generator Hut

Random Number Generators & Number Tools

Every number tool here draws from your device's cryptographic random source rather than a seeded software algorithm, and every one runs entirely in the browser. Pick a fixed-width generator when you need codes of an exact length, or the custom range generator when you need numbers between two arbitrary bounds.

13 tools in this category

Fixed-width codes versus arbitrary ranges

The digit generators exist because a code and a number are not the same thing. 42 and 0042 are the same integer, but only one of them is a valid four digit PIN — and dropping the leading zeros is the single most common way a batch of codes gets corrupted between a generator and a spreadsheet. The digit tools pad every result to a fixed width so that never happens.

The custom range generator is the opposite tool: no padding, no fixed length, any minimum and maximum you like including negative numbers. Use it for drawing winners, sampling spreadsheet rows, assigning turn order, or anything where the number is a position rather than a code.

What makes a random number generator trustworthy

Two things, and most online generators get the second one wrong. The first is the entropy source: these tools use the Web Crypto API, which reads the operating system's cryptographically secure pool, rather than Math.random(), which is seeded predictably enough that its output can be reconstructed by anyone who has watched enough of it.

The second is how that entropy is mapped onto your range. Taking a random 32-bit value modulo your range is the obvious approach and it is quietly biased: whenever the range is not a power of two, the lowest numbers come up measurably more often. These tools discard draws that land in the uneven remainder and redraw instead, so the distribution is genuinely flat.

You can see the difference at scale rather than in a single draw. Run a biased generator ten thousand times over 1–100 and the low numbers pull ahead of the high ones; run an unbiased one and the counts stay level.

Choosing a length for codes

Each digit multiplies the guessing space by ten. Three digits gives 1,000 possibilities, four gives 10,000, five gives 100,000 and six gives a million. For anything protecting access, four digits is the practical floor and only works when paired with an attempt limit — a four digit PIN with unlimited guesses is not a security control.

Six digits is the standard for one-time passcodes, and it works there because the codes also expire in around thirty seconds. For a code that stays valid indefinitely, longer is meaningfully safer.

Frequently asked questions

Are these random number generators actually secure?

They use crypto.getRandomValues(), which is backed by the operating system's CSPRNG — the same source that seeds TLS session keys. Math.random() is never used anywhere on the site. Results are also mapped onto your range with rejection sampling, so there is no bias toward the low end.

Is anything I generate sent to a server?

No. Generation is client-side JavaScript. There is no back end that could receive it, no analytics script watching, and no logging. Values exist in your browser tab until you copy, export or close it.

Which generator should I use for a PIN?

The four digit generator for a standard bank-style PIN, or the six digit generator where the system allows it. Both keep leading zeros, which matters because 0042 is a valid PIN and 42 is not the same thing.

Can I generate numbers in bulk?

Every number tool takes up to 10,000 values per batch, with one-click copy of the whole set and CSV or JSON export. Repeat as often as you like — there is no rate limit and no account.

Can I use these for a prize draw?

The randomness is cryptographically secure and unbiased, which is the technical bar for a fair draw. Formal, regulated lotteries are a different matter — those generally require an audited and certified system with a verifiable record of every draw.