Skip to main content

Random Sampling Calculator

Draw one or many random values from any range — with or without repeats — for a random number, a simple random sample, or a full shuffle. See exactly where your draws land with a visual, hover over any bar to see how many draws it holds, and get the probability of repeats when repeats are allowed.

Background

A single random number, a simple random sample of a class, a shuffled deck, and a series of dice rolls are all the same underlying operation: draw k values from a population of N possible values, either allowing repeats (with replacement) or not (without replacement). This calculator handles all of them through that one mechanic — set k = 1 for a single random number, or k = N without replacement for a full shuffle.

Set up your draw

Range and sample size

k = 1 gives a single random number. k = the full range (without repeats) gives a complete shuffle.

Options

Enter any word or number to get a reproducible "random" sequence — the same seed, range, and sample size always produce the same draws.

Learning options

Result

No result yet. Set your range and sample size, then click Draw.

How to use this calculator

  • Set a minimum and maximum value to define the range of possible values (the "population").
  • Set a sample size — how many values to draw. Use 1 for a single random number.
  • Choose whether repeats are allowed ("with replacement," like dice) or not ("without replacement," like drawing names).
  • Click Draw to get your result, a visual showing where the draws landed, and the full step-by-step logic.
  • Hover over a bar (or tap it, or tab to it and use the arrow keys) to see exactly how many draws landed there. Open the frequency table under the chart to see every count at once, or copy it into a spreadsheet.

How this calculator works

  • With replacement: each draw is an independent, equally likely choice from the entire range — the same value can come up more than once, exactly like rolling a die repeatedly.
  • Without replacement: each draw removes that value from further consideration, so every result in the sample is guaranteed to be distinct — like drawing names from a hat without putting them back.
  • Seeds: computers generate "randomness" using a deterministic formula started from a seed value. Leave the seed blank for a fresh, non-reproducible draw, or enter one to get the same sequence every time — useful for building a repeatable classroom example.
  • Reading the chart: with 40 draws or fewer, each value is shown as a stack of dots with its count above it. With more draws, the chart is a histogram: one bar per value when the range has 30 values or fewer, and 30 equal-width groups of values for larger ranges. A bar's height is the number of draws that landed on it.

Formula & Equations Used

Population size: N = max − min + 1

Probability of at least one repeat (with replacement, k draws from N values): P = 1 − (N/N) × ((N−1)/N) × ... × ((N−k+1)/N) — the same logic as the classic "birthday problem."

Share of draws for a value: percent = count ÷ k × 100 — the counts for all values always add up to k.

Example Problems & Step-by-Step Solutions

Example 1 — A single random number

Pick one random number between 1 and 100.

  1. N = 100 − 1 + 1 = 100 possible values.
  2. Draw k = 1 value — with or without replacement makes no difference when k = 1.

Example 2 — A simple random sample

Randomly select 10 students from a class roster of 30, numbered 1–30.

  1. N = 30, k = 10, drawn without replacement — no student should be picked twice.
  2. Sorting the 10 results makes the roster numbers easy to read off in order.

Example 3 — Repeated independent trials

Simulate rolling a 6-sided die 20 times.

  1. N = 6, k = 20, drawn with replacement — every roll can land on any face again.
  2. Since k > N, at least one repeat is guaranteed (P = 100%) — with only 6 faces and 20 rolls, some number must repeat.
  3. Hover over a stack in the chart, or open the frequency table, to see how many times each face came up. The six counts add up to 20.

Example 4 — A full shuffle

Shuffle the numbers 1 through 52 (like a deck of cards).

  1. N = 52, k = 52, drawn without replacement — every value appears exactly once, just reordered.

Example 5 — Does a die come up evenly?

Roll a 6-sided die 600 times (range 1–6, sample size 600, with replacement).

  1. Each face is expected about 600 ÷ 6 = 100 times.
  2. Hover over each bar to read its count. Real counts will wobble around 100 (say 92 to 108) instead of being exactly equal — that is normal random variation.

Frequently Asked Questions

What's the difference between sampling with and without replacement?

With replacement, every draw is independent and can repeat a previous value — appropriate for dice, coin flips, or any repeated independent trial. Without replacement, each draw is removed from the pool, so results are guaranteed distinct — appropriate for selecting people, cards, or unique IDs from a population.

How do I see how many times each value was drawn?

Hover over a bar or dot stack in the chart (or tap it on a phone, or tab to it and use the arrow keys) to see its count and share of the draws. The frequency table under the chart lists every count at once, and the Copy table button copies it so you can paste it into a spreadsheet.

Why does a small random sample sometimes look uneven?

Genuine randomness doesn't guarantee even spacing — clumps and gaps are expected with small samples. Only with a large number of draws does the distribution reliably start to look flat across the range.

Is a computer's "random" number truly random?

Usually not — it's pseudorandom, generated by a deterministic formula from a seed value. This calculator uses genuinely unpredictable browser randomness by default, but lets you supply your own seed for a reproducible sequence when that's useful for teaching or grading.

Can I use this to shuffle a list, like a deck of cards?

Yes — set the range to match the number of items (1 to 52 for a standard deck), set the sample size equal to the range, and draw without replacement. The result is a complete, randomly ordered permutation.

Why does a bar cover several values on a large range?

When the range has more than 30 values, the chart groups them into 30 equal-width bins so the shape stays readable. Hovering a bar shows the span of values it covers and how many draws landed in it. The frequency table still lists each individual value that was drawn.

Back to all calculatorsAll calculators