Random Number Generator

Generate random integers or decimals in any range, with or without repeats, optionally sorted — instant, free, in-browser.

Pick a mode

Set the range and count, then press Generate.

min
min
max
max
count
qty
d.p.
d.p.
ModeInteger
In-browser RNG

5 random integers · 1 – 100

42

First value · press Generate again for new draws

Count

5

values generated

Mean

average

Sum

total of values

Range

max − min

Distribution histogram 10 buckets across range
min max
Use caseRecommended setupExample
Dice rollInteger, min 1, max 61 – 6
Lottery 6/49Integer, min 1, max 49, unique6 unique 1 – 49
Coin flipInteger, min 0, max 10 / 1
Random fractionDecimal, min 0, max 10.0000 – 1.0000
Shuffle / drawInteger, full range, unique, sortpermutation

The Method

How random integers are sampled

JavaScript's Math.random() returns a uniformly distributed pseudo-random number in [0, 1). To draw an integer between min and max (inclusive), the standard formula is ⌊rand × (max − min + 1)⌋ + min. For decimals at d decimal places, we scale by 10d after sampling. For unique draws, the calculator builds the full min … max range and performs partial Fisher–Yates shuffling — guaranteed no repeats while preserving uniform marginal distribution.

Working for the current setup

⌊rand × (100 − 1 + 1)⌋ + 1 → range 1 … 100
min lower bound (1)
max upper bound (100)
n count (5)
d decimal places ()

About This Tool

What Is a Random Number Generator?

A random number generator (RNG) produces values from a chosen range that look — and statistically behave — as if they were drawn at random. This calculator generates integers or decimals between any minimum and maximum, in counts from 1 up to 1000, with optional uniqueness (no repeats) and sorting.

RNGs are useful for dice rolls, lottery picks, coin flips, random sampling from a population (e.g. choosing 20 survey respondents out of 1000), generating test data, shuffling a list, picking a random winner, or just settling a friendly argument.

This tool uses JavaScript's Math.random(), which is a high-quality pseudo-random generator suitable for everyday use, education, games and statistics. It is not cryptographically secure — for security-sensitive applications (password salts, encryption keys, security tokens) use crypto.getRandomValues() or a dedicated CSPRNG. The distribution is uniform — every integer in [min, max] has equal probability of being drawn.

Use this free random number generator for games, lotteries, statistical sampling, raffles, classroom activities, or any time you need fair, uniform random numbers. All generation happens in your browser — no data is sent to any server.

Integers or Decimals

Switch between whole numbers and decimals (with chosen precision) instantly.

Uniqueness Option

Toggle Unique values to draw without replacement — perfect for raffles.

Sort & Stats

Sort results ascending, plus mean, sum and range for the drawn batch.

Histogram Visual

Built-in 10-bucket histogram — check uniformity of your draws at a glance.

100% Free & Private

No account, no tracking — every draw happens locally in your browser.

Up to 1000 Values

Generate large batches at once — great for sample data sets.

How to Use This
Random Number Generator

Set the range, choose how many, press Generate — and you have your random numbers in an instant.

1

Pick Integer or Decimal

The Integer mode produces whole numbers; Decimal produces fractional values to the chosen number of decimal places.

2

Set Min and Max

Type the minimum and maximum. Negative values are allowed, and min > max is auto-swapped on generation.

3

Choose How Many

Up to 1000 values per click. For very large lists, run the generator multiple times and concatenate.

4

Toggle Options

Enable Unique values to draw without replacement (e.g. lottery picks), or Sort ascending for an ordered result.

5

Press Generate

Click Generate to draw a new batch. Each click is independent — re-press to see fresh values.

6

Inspect the Stats & Histogram

The count, mean, sum and range describe the batch; the histogram visualises distribution across 10 buckets.

Frequently Asked Questions

Everything you need to know about randomness, pseudo-random generators, and when to use each option.

They are pseudo-random, generated by your browser's Math.random(). The output is statistically uniform and indistinguishable from true randomness for any everyday purpose — games, lotteries, sampling, simulations. It is not suitable for cryptography (key generation, security tokens) — for that you need crypto.getRandomValues() or a dedicated CSPRNG.

Yes — enable the Unique values toggle. The generator builds the full range and uses a partial Fisher–Yates shuffle, so no number appears twice in the result. This only works if the count is at most max − min + 1 (you cannot draw 10 unique integers from a 1–5 range).

Up to 1000 values per generation. For larger lists, run the generator multiple times. The 1000-value cap keeps the UI snappy and the histogram readable.

For integers, both bounds are inclusive by default (you can toggle "Include max in range" to exclude it). For decimals, the lower bound is inclusive and the upper bound is exclusive — that is the standard convention for continuous random variables and how JavaScript's Math.random() behaves on [0, 1).

For a small batch (say 10 values), random fluctuations are large — the histogram will not look flat. As the count grows toward several hundred, the bars should level out. This is the law of large numbers at work; the underlying distribution is uniform even if any single batch looks lumpy.

For informal lotteries, classroom draws, and office raffles — yes. Set the range to your ticket / entry numbers, set the count to the number of winners, and enable Unique values. For a regulated lottery you need a certified RNG with cryptographic guarantees, not a browser-side calculator.

In decimal mode you set the number of decimal places (d.p.) from 0 to 10. The generator samples a raw float and rounds to your chosen precision. With 0 d.p. and integer bounds, the result is effectively an integer.

Because the generator is stateless and unseeded. Each call to Math.random() uses the browser's internal entropy. To reproduce a sequence you would need a seeded PRNG — those are easy to find as separate libraries.