Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Random Number Generator

Pick random whole or decimal numbers in any range, with no duplicates if you like.

Use via API

Random integers or decimals in an inclusive range from a cryptographic random source, with or without duplicates (unbiased at any range size), optionally sorted. Send JSON, get JSON back.

POST https://pithlab.com/api/v1/tools/random-number-generator

curl https://pithlab.com/api/v1/tools/random-number-generator \
  -H "Authorization: Bearer $PITHLAB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"min":1,"max":49,"count":6,"allowDuplicates":false,"sort":"asc"}'

Fields and responseOpenAPI documentGet an API key

About the Random Number Generator

Generate random numbers between any min and max, up to 10,000 at once, with or without duplicates, sorted, or with decimals. Uses secure browser randomness.

How to use the Random Number Generator

  1. Choose Whole numbers or Decimals, then enter the smallest and largest values you want. Both ends are included.
  2. Set how many numbers you need, up to 10,000. Untick Allow duplicates to make every number different, like drawing raffle tickets.
  3. Pick a sort order and separator, press Generate, then copy the list or download it as a text file.

Examples

Roll a die

Input

Min 1, max 6, 1 number

Output

e.g. 4
Lottery-style draw

Input

Min 1, max 59, 6 numbers, no duplicates, sorted ascending, comma separated

Output

e.g. 3, 17, 22, 38, 41, 56
Every number from 1 to 10

Input

Min 1, max 10, 10 numbers, no duplicates, sorted ascending, comma separated

Output

1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Decimals

Input

Decimals, min -1, max 1, 2 decimal places, 3 numbers

Output

e.g. 0.37, -0.82, 0.05

Frequently asked questions

Are the numbers truly random?

They come from the Web Crypto API (crypto.getRandomValues), the browser's cryptographically secure generator, with rejection sampling so every value in the range is exactly equally likely. Numbers are generated on your device and never sent anywhere.

How big can the range be?

Min and max can be any whole numbers from -9,007,199,254,740,991 to 9,007,199,254,740,991, the largest integers JavaScript can represent exactly. Even ranges wider than 2^32 stay unbiased because extra random bits are drawn and out-of-range values are rejected.

How does no duplicates work?

Each number appears at most once, like drawing balls from a bag. If you ask for more numbers than the range contains, for example 20 different numbers between 1 and 10, the tool shows an error instead of repeating.

How are decimals generated?

With 2 decimal places between 0 and 1, the tool picks uniformly from 0.00, 0.01 and so on up to 1.00, both ends included. Values are worked out exactly from the digits you type, so there are no floating-point rounding surprises.