Skip to content

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

Quick:

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.

Which random number tool to use for common tasks
TaskKindBest tool
Pick one winner, page or question, liveWholeInteger picker (raffle mode, draw log)
Lottery numbers, shuffles, test data with statsWholeInteger list (steps, exclusions)
Prices, measurements, bell-curve dataDecimalDecimal numbers
Maths practice with fractionsFractionFractions and worksheets
Bits and binary practiceBinaryBinary numbers
Keys, tokens and secretsBytesRandom 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

Lowest 1 · highest 3450 · whole numbers

Step 2: Ask for 20 with no repeats, sorted

How many 20 · No repeats ticked · order Smallest first

Step 3: Record and pull

Copy the list into the working papers, then pull invoices in that order

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:

Types of random number generator and where they are used
KindHow it worksExamples
Physical (true) randomMeasures unpredictable physical noiseRANDOM.ORG (atmospheric noise), hardware RNG chips
Cryptographically secureAn algorithm continually seeded by the operating system's entropy; unpredictable even if you see earlier outputscrypto.getRandomValues() (this page), /dev/urandom, Python's secrets
Pseudo-randomA fast formula from a starting seed; statistically good but predictable once its state is knownJavaScript 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 excluded

This 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