Random Number Generator

Generate one or more random integers between a minimum and maximum value (inclusive).

Random Number Generator

Formula

n = floor(random() × (max - min + 1)) + min (count times)

Draws each integer uniformly from the inclusive range using the browser Math.random path. Repeats for the requested count without guaranteeing uniqueness.

This random number generator draws integers from an inclusive minimum to maximum range. Defaults are min 1, max 100, and count 1. Because the process is stochastic, do not expect one fixed sample value. Each click can return a different integer inside the range.

Use it for classroom demos, raffle style picks, and quick sampling drills. When you need deterministic percent math instead of chance, switch to the percentage calculator.

How the formula works

For each requested number, the tool computes floor(random() × (max – min + 1)) + min. That maps a unit interval draw onto every integer from min through max with equal weight in the usual model. The loop repeats count times.

Worked example

With min 1, max 100, and count 1, a single integer from 1 through 100 is produced. A second click may return a different integer. With count 5, five independent draws appear; repeats among those five are allowed.

InputValue
Minimum1
Maximum100
Count1
Inclusive span100 integers
Result naturestochastic (varies per run)

How to use the fields

  • Minimum is the lowest integer allowed.
  • Maximum is the highest integer allowed.
  • How many is the count of independent draws in one result string.

Inclusive range habits

People often forget that both endpoints are live. If you want 1 through 10, set max to 10, not 9. The +1 inside the span formula exists so max is reachable.

Check a tiny range such as min 5 and max 5. Every draw should be 5. That sanity test confirms inclusivity before you trust a wider span.

Common mistakes

  • Expecting the same number on every refresh
  • Assuming count greater than 1 returns unique values
  • Setting max below min
  • Treating browser randomness as cryptographic key material

Independence versus uniqueness

Independent draws can collide. If you need a sample without replacement, you must use a different algorithm that removes chosen values. This page does not claim uniqueness for multi-count output.

State that limitation in worksheets so students do not mark duplicate draws as bugs.

Classroom fairness talks

Equal chance across the inclusive span is the teaching goal. After many draws, frequencies should look roughly flat for a small range, though short runs will wobble. That wobble is normal sampling noise, not proof of a broken range.

Have learners predict whether 1 and 100 are possible, then verify by repeated trials.

Documenting stochastic work

Write min, max, count, and the observed list. Because the next run differs, a bare screenshot without inputs cannot be audited. For graded labs, require the input triple beside the output.

If two students disagree, compare inputs first. Different max values explain many “unfair” claims.

When not to use this tool

Security tokens, password generation, and high stakes lotteries need stronger randomness sources and audit rules. Keep this generator for learning and lightweight picks.

Simulation homework that must be reproducible should use a seeded generator in code, not repeated browser clicks.

Scaling count carefully

Larger counts produce longer comma separated lists. Readability drops before the field maximum is reached. Prefer several smaller runs when you are presenting live to a group.

For probability lessons, fix min and max, vary count, and discuss how duplicate risk rises as count grows relative to the span size.

Teaching probability without promising a fixed draw

Never write an answer key that claims the generator must return a specific integer such as 47. The correct key states the inclusive span and the count. Students should defend that any integer inside the span is admissible for a single draw.

When count is greater than 1, add a sentence about possible repeats. That single clarification prevents a wave of “bug” reports when two identical numbers appear side by side.

If you need a shuffled unique set for group assignment, say so explicitly and use a different process. This page remains independent draws from min through max.

Limitations

No uniqueness mode, no custom probability weights, and no cryptographic guarantees. Results are ordinary browser random integers in an inclusive range.

Frequently Asked Questions

What are the default inputs?

Minimum 1, maximum 100, and count 1. Each run returns a new integer in that inclusive range.

Is the range inclusive?

Yes. Both min and max can appear as results.

Why do I get a different number each time?

The generator is stochastic. It uses browser randomness, so fixed answers are not expected.

Are duplicates possible when count is greater than 1?

Yes. Uniqueness is not guaranteed unless a different sampling method is used. This tool draws independently each time.

What if max is less than min?

The tool rejects that pair. Set max at or above min.

Is this cryptographic randomness?

No. It is ordinary browser Math.random style generation for classroom and casual use.

Can count be larger than one?

Yes, up to the field maximum. Each draw is independent within the same min and max.

How should I document a draw?

Record min, max, count, and the returned list plus the time of the draw, since repeats will differ.