Generate a random number

Draw bounded random integers or decimals with browser cryptographic randomness.

freeworks offlinenothing uploaded
ToolRandom Number Generator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Integer mode uses rejection sampling from a 32-bit random word to avoid modulo bias, while decimal mode divides a random word by 2³² to select values in the interval. Count repeats sampling independently.

  • The initial range is 1–100 with one draw.
  • The source is not seeded for reproducibility.

Worked example

Roll 5 Dice
Generate 5 random integers between 1 and 6
Input
											Min: 1
Max: 6
Count: 5
Integers: true
										
Output
												5, 3, 1, 1, 2
											

When to use this

Raffles draw tickets, test harnesses sample bounds, and games choose random integer or decimal inputs.

Edge cases

  • Integer bounds use ceil and floor, so a range with no integer is rejected.
  • Out-of-range words are discarded rather than introducing modulo bias.
  • A seed cannot reproduce browser crypto results.

References