Generate Random Numbers
Pick a random number between any two numbers in one click, or generate up to 1,000 at once. Choose whole numbers or decimals, include negatives, rule out repeats and sort the results. Quick buttons cover 1–10, 1–100 and 1–1000.
Every value in the range equally likely · both ends included
Whole Numbers, Decimals, or Something More Specific?
Use whole numbers for anything you count or number: people, tickets, pages, rolls of a die. Use decimals for anything you measure: lengths, prices, probabilities. This page handles both; for particular jobs, a dedicated generator has the extra settings you'll want.
| Task | Kind | Best tool |
|---|---|---|
| Pick one winner, page or question, live | Whole | Integer picker (raffle mode, draw log) |
| Lottery numbers, shuffles, test data with stats | Whole | Integer list (steps, exclusions) |
| Prices, measurements, bell-curve data | Decimal | Decimal numbers |
| Maths practice with fractions | Fraction | Fractions and worksheets |
| Bits and binary practice | Binary | Binary numbers |
| Keys, tokens and secrets | Bytes | Random bytes |
Worked Example: Picking 20 Invoices to Audit
An auditor has 3,450 invoices for the year, numbered in the order they were issued, and needs a random sample of 20 to check. Picking "a few from each month" by eye isn't random; numbering and drawing is.
Step 1: Set the range
Step 2: Ask for 20 with no repeats, sorted
Step 3: Record and pull
Every invoice has the same 20 in 3,450 chance (0.58%) of being chosen, and every set of 20 is equally likely. Sorting only makes the pulling easier; it doesn't change which invoices were picked. If invoice numbers have gaps, number the actual list 1 to N first, or use the integer list generator's "leave out" box.
Negative Numbers, Zero and Decimal Bounds
Ranges can cross zero. From −10 to 10 there are 21 whole numbers, not 20, because zero counts too, so each has a 1 in 21 chance. That's handy for temperature changes, profit and loss, or number-line exercises.
If you ask for whole numbers between decimal bounds, only the whole numbers inside the range can come up: from 2.3 to 5.8 that's 3, 4 and 5. Between 2.3 and 2.8 there are none, and the page will say so. In decimal mode the bounds are rounded inward to your number of places, so a result can never fall outside what you typed.
Quick check for any whole-number range: the count of possible values is highest − lowest + 1.
Where Random Numbers Come From
Computers follow instructions, so "random" numbers come from one of three places, with different trade-offs:
| Kind | How it works | Examples |
|---|---|---|
| Physical (true) random | Measures unpredictable physical noise | RANDOM.ORG (atmospheric noise), hardware RNG chips |
| Cryptographically secure | An algorithm continually seeded by the operating system's entropy; unpredictable even if you see earlier outputs | crypto.getRandomValues() (this page), /dev/urandom, Python's secrets |
| Pseudo-random | A fast formula from a starting seed; statistically good but predictable once its state is known | JavaScript Math.random() (xorshift128+ in Chrome, Firefox, Safari), Python random (Mersenne Twister), NumPy (PCG64) |
For games, sampling and simulations, any of the three is fine. For anything someone might try to predict, such as a prize draw, a password or a security token, use a cryptographically secure source, as this page does.
Seeds: When You Want the Same "Random" Numbers
A pseudo-random generator started from the same seed produces the same sequence every time. That sounds like a flaw, but it's essential for science and software testing: anyone can rerun an experiment or reproduce a failing test exactly.
import random
random.seed(42)
random.sample(range(1, 3451), 20) # the same 20 invoices on every run
import numpy as np
rng = np.random.default_rng(42) # PCG64, also reproducible
rng.integers(1, 101, size=10) # 1 to 100; the upper bound is excludedThis page deliberately has no seed: each draw comes fresh from your browser's secure generator, so nobody can reproduce or predict it. When a draw must be both fair and checkable afterwards, record the result (copy the list) instead of relying on a seed.
Why People Make Poor Random Number Generators
Ask a room of people to "pick a random number from 1 to 10" and the answers are far from even. Seven comes up much more often than 10% of the time, a pattern documented in a 1976 study by Kubovy and Psotka.
People also avoid repeats and runs. Asked to write a "random" sequence, most people switch too often and rarely put the same number twice in a row, though a real random sequence does that regularly. That's why a person choosing "randomly" isn't good enough for anything that needs to be fair, and why a generator's output can look less random than you expect.
Frequently asked questions
How do I pick a random number between 1 and 10?
Press the 1–10 quick button, or type 1 and 10 as the lowest and highest. Both 1 and 10 can come up, each with a 10% chance.
Can I generate several random numbers without duplicates?
Yes. Set How many and tick No repeats. You can ask for up to as many numbers as the range contains; asking for all of them gives a shuffle.
Is this random number generator truly random?
It uses the browser’s cryptographically secure generator, which is seeded from your device’s own entropy sources. It isn’t a physical noise source, but its output can’t be predicted, which is what fairness needs.
Can the lowest or highest number come up?
Yes, both ends are included. From 1 to 6, every number from 1 to 6 has exactly the same one-in-six chance.
Sources
- MDN: Crypto.getRandomValues(): the cryptographically secure source used here.
- MDN: Math.random(): not suitable for anything security-related.
- V8 blog: There’s Math.random(), and then there’s Math.random(): the switch to xorshift128+.
- Python documentation: random module: Mersenne Twister, seed() and sample().
- NumPy documentation: Random Generator: default_rng and PCG64.
- RANDOM.ORG: Introduction to Randomness and Random Numbers: true randomness from atmospheric noise.
- Kubovy & Psotka (1976): The predominance of seven and the apparent spontaneity of numerical choices: Journal of Experimental Psychology: Human Perception and Performance 2(2).
Related Tools
Create GUIDs for Microsoft and .NET fields.
Generate binary numbers with a chosen bit length.
Create a random pixel image and save it as a PNG.
Generate bytes in hex, Base64, or decimal format.
Pick a date between your chosen start and end dates.
Generate decimals with a chosen range and precision.