Random Number Generator
Random numbers between any two values — one or a thousand, with or without repeats — drawn fairly from your operating system's random source. Coin flips and dice too.
Range and options
Both ends are included: 1 to 6 can give 1 and can give 6. Copying puts one number per line, ready to paste into a spreadsheet column.
How to generate a random number
- 1
Set the range
Type a minimum and a maximum, or press one of the common ranges. Both ends are included, so 1 to 10 can give you 1 and can give you 10. Negative numbers work, and so do ranges in the trillions.
- 2
Choose how many
One number, or up to a thousand at once. Tick No repeats for a draw where each number can come up only once — a lottery line, a raffle ticket order, a random sample. Pick an order, and add decimal places if you need them.
- 3
Draw, copy, share
A number is already on screen; press New number to draw again with the same settings. Copy puts one number per line. The address bar holds your settings — never the result — so a link opens the same generator, ready to draw.
Why every number is equally likely
A random number generator has two jobs, and most of them only think about the first. The first is a source of randomness nobody can predict. Here that is crypto.getRandomValues, the cryptographic generator the browser takes from your operating system, which gathers unpredictability from the hardware and is what encryption keys are made from. It is not Math.random, which is built for speed: fine for a game’s sparkle, but its next value can be worked out from the ones before it.
The second job is turning random bits into your range without tilting it, and this is where generators quietly go wrong. Random bits come in powers of two; your range almost never is one. Squeeze 256 equally likely byte values into the numbers 1 to 6 with a remainder and four of the six get one extra way to happen. Scale a random fraction up to the range instead and floating-point rounding makes some values fractionally more common, and the top of the range becomes unreachable.
This generator does neither. For a range of n values it reads just enough bits to count to n, and if the value lands past the end it throws it away and reads again. Every value that survives was reached by exactly one pattern of bits, so all of them are equally likely — exactly, not approximately. Fewer than one draw in two is ever thrown away, so it costs nothing you could notice, even for ranges in the trillions.
No repeats uses the same draw inside a shuffle that only touches the positions it needs, so asking for a thousand different numbers from a range of a trillion takes a thousand steps, not a trillion. Decimals are handled as whole numbers on a finer grid and divided at the end, which keeps both ends reachable at any precision.
You do not have to take our word for it
Fairness you cannot check is just a claim, so here is how to check it. Set the range to 1 to 10, the count to 1,000, and leave repeats on. Each number should turn up about a hundred times — usually somewhere between 80 and 120, because real randomness is lumpy. A generator that gives you exactly a hundred of each is the suspicious one.
The code is open and tested. The unit tests feed the draw every possible byte in turn and confirm each outcome comes up the same number of times, which is the test a modulo fails. They also run a chi-square test — the standard statistical check for an even spread — over tens of thousands of draws. You can read both, and the few dozen lines that do the drawing, in the repository.
And for the sceptical: open your browser’s network panel and press New number. Nothing is requested. The draw happens on your machine, which also means it keeps working with the internet switched off once the page has loaded.
Frequently asked questions
It is as random as your computer can make it. Every draw comes from crypto.getRandomValues, the cryptographically secure generator your browser takes from the operating system — the same source used to make encryption keys. It is not Math.random, whose output can be predicted from earlier values. No software generator is "true" random in the physical sense, but this one is unpredictable to anyone, including us.
The quick way to turn random bytes into a number from 1 to 6 is to take the remainder after dividing by 6. A byte has 256 values, and 256 does not divide evenly by 6, so the remainders 0 to 3 come up 43 times each and 4 and 5 only 42 times. That is a small tilt, but it is a real one, and it gets worse as the range grows. This generator throws away any draw that lands in the uneven part and draws again, so every number is exactly as likely as every other.
Yes — tick No repeats. Each number can then appear at most once, which is what you want for lottery lines, a random order for a list, or picking a sample. If you ask for more numbers than the range holds, say seven different numbers from 1 to 6, it tells you instead of quietly returning repeats.
Both, always. 1 to 100 means a hundred possible numbers, and 1 and 100 are each as likely as 50. That sounds obvious, but the common shortcut of multiplying a random fraction by the width of the range can never return the maximum, and many generators built that way are quietly one short.
Choose a number of decimal places and the range is split into an even grid at that precision: 0 to 1 at two places is the 101 values 0.00, 0.01 … 1.00, each equally likely. Results always show exactly that many places, so 2.50 stays 2.50. Up to ten places are supported, as long as the range at that precision still fits within the 2^53 values a JavaScript number can hold exactly.
Any range holding up to 2^53 values — about nine thousand trillion — with both ends between minus and plus 9,007,199,254,740,991. That limit is not ours: it is the largest whole number a JavaScript number can store without rounding, and past it two neighbouring integers become the same value. Within it, every integer is reachable.
For fairness, yes: nobody can predict or steer the result, and every number has the same chance. What it cannot give you is proof to a third party — there is no signed record, because that would need an account and a server. Draw in front of people, or record your screen. For a legally regulated prize draw, use a licensed service.
No. They are drawn in your browser and stay there. The page address carries your settings — the range, the count, whether repeats are allowed — and never the result, so a shared link cannot be used to pass off a chosen number as a fresh draw. The API, if you use it, draws on our server instead; nothing is stored or logged.
Google's is fine for one number from a small range. Use this when you need more: a thousand numbers at once, a no-repeat draw, decimals, sorting, a copyable list, settings in a link you can send, or an API for a script. The coin and dice modes add flip history, streaks and full dice notation as well.
API — for scripts and agents
The same draw behind a free REST endpoint, no key and no sign-up. It takes min, max, count, unique, sort (none, asc or desc) and decimals; or coin=10 for ten flips; or dice=2d6%2B3 for a roll — write + as %2B, since a bare plus in a URL means a space.
curl 'https://zeal.tools/api/v1/random?min=1&max=49&count=6&unique=true&sort=asc'Try it: /api/v1/random?min=1&max=100, ?coin=10 or ?dice=4d6kh3. A result drawn there is drawn on our server, not in your browser; nothing is stored or logged.
Agents especially should use it: a language model asked for “a random number” returns a likely-sounding one, with a few favourites coming up far more often than chance allows. MCP clients can add https://zeal.tools/mcp and call the random tool for numbers, flips and rolls.
The Zeal Promise
Non-negotiable, on every tool we ship.
- No sign-up — ever
- No watermarks on any output
- No ads near the download button
- Works fully on mobile
- Privacy-first: processing stays in your browser
- Open source (MIT) — audit it, contribute, self-host
- Zero runtime dependencies in tool logic