Random Number Generator
Draw integers or decimals with unique batches, session exclusions, or repeatable seeds.
Runs locally in your browser. Nothing is uploaded or sent to a server.
Enter Minimum, Maximum and How many (1-10,000), then click Generate to get random integers or decimals within inclusive bounds. Secure mode uses browser cryptographic randomness. Choose Unique (no repeats) for one batch or Draw without replacement to exclude earlier session results. Bounds support ±1,000,000,000 and decimals support 0 to 10 places. Reproducible (seeded) mode repeats results with the same seed and settings for tests and games, not draws or security. Copy numbers with comma, space or newline separators.
Updated
Related Tools
Password Generator
Generate random passwords, word-based passphrases, or PINs with rules that match your destination.
developer-toolsUUID Generator
Generate random, time-ordered or name-based UUIDs; format results and inspect existing IDs.
design-toolsRandom Color Generator
Explore pastel, vivid, or dark colors, copy four formats, and revisit 12 recent swatches.
text-toolsLorem Ipsum Generator
Set an exact word count, generate paragraphs or lists, and copy plain text or HTML.
How do you generate a batch within a chosen range?
Enter Minimum and Maximum, set How many (1-10,000), and click Generate. Both endpoints are included. For a classroom with 24 numbered seats, set Minimum to 1, Maximum to 24 and the count to 4. Choose Integers and Unique (no repeats) to select four different seat numbers. Leave Randomness mode on Secure (default) for a fresh random draw.
The range contains 24 − 1 + 1 = 24 possible integers. An illustrative result is 3, 8, 17, 24; these numbers show a valid batch, not a promised output. Selecting Ascending under Sort puts the sampled values into numerical order after generation. It does not change which seats were selected. Without Unique, a batch such as 3, 3, 17, 24 is also valid because draws can repeat.
Outside a draw session, changing settings generates a result automatically. Once Draw without replacement is enabled, configure the batch and press Generate to take numbers from the remaining pool. This distinction matters when you want each deliberate click to represent one round of selection.
How do the three ways to avoid repeats differ?
Choose the exclusion rule that matches your task. A unique batch does not remember every earlier batch. A draw session does, until it is reset. Avoiding the previous result only changes a single-number draw, so an older number can return after an intervening result.
| Control | What it excludes | Useful example |
|---|---|---|
| Unique (no repeats) | Duplicates within the current batch | Select four distinct seats at once |
| Draw without replacement | All numbers already drawn in the active session | Select successive groups without reusing seats |
| Avoid repeating the last result | The previous single result when another value exists | Pick a different starter on the next turn |
For the 24-seat example, a session drawing four numbers leaves Remaining at 20, then 16 after another four. Session drawing prevents duplicates even if Unique is unchecked. Requesting more than the remaining pool produces an error asking you to reset or reduce the count. Reset clears the exclusions and current result. Changing the range, number type or precision starts a new session; changing count or sort does not clear the drawn pool.
Avoid repeating the last result is shown for a count of one. It also works with Unique enabled. A range containing only one value disables that control because a different result is impossible. These session and previous-result controls are unavailable in seeded mode.
How are decimal values counted and formatted?
Decimals use a fixed precision from 0 to 10 places. At two places, a range from 1.20 to 1.25 is converted internally to integers 120 through 125. Its size is 125 − 120 + 1 = 6. The possible outputs are 1.20, 1.21, 1.22, 1.23, 1.24 and 1.25. Asking for all six with Unique and Ascending returns exactly that list; asking for seven unique values fails.
In general, available values = (maximum − minimum) × 10precision + 1 when the endpoints fit the precision. This is a discrete grid, rather than a continuous interval with infinitely many possible fractions. Results retain exactly the chosen number of decimal digits, including trailing zeros. Internally, scaled BigInt arithmetic preserves the decimal digits instead of sampling floating-point fractions and rounding them afterward.
Bounds must fit the selected precision. At two places, 1.205 is rejected rather than rounded to 1.21 or 1.20. Extra trailing zeros are accepted, so 1.200 represents the same endpoint as 1.20. Negative bounds work in both number types. With zero decimal places, decimal mode uses a whole-number grid.
What happens with reversed bounds or invalid inputs?
Entering Minimum as 20 and Maximum as 10 produces the inclusive range 10 through 20: the parser orders the endpoints. Equal bounds are valid too. With both set to 7, ordinary generation can return 7 repeatedly, while a unique batch can contain only one result. Zero is a valid endpoint and can appear in a range that crosses it.
Each endpoint must be within −1,000,000,000 and 1,000,000,000. Count must be a whole number from 1 to 10,000, regardless of how wide the range is. Enter plain numeric text such as -250 or 0.75. Commas, a leading plus sign and scientific notation such as 1e3 are not accepted by the bound parser. Surrounding spaces are trimmed. Invalid settings display an error rather than a new list, and Copy is disabled when an error is present.
How does Secure mode generate unbiased numbers?
Secure mode draws its random words from crypto.getRandomValues(), the Web Crypto API. It refills a pool of 1,024 unsigned 32-bit words, or 4,096 bytes, as needed. The generator does not use Math.random(). Seeded mode uses a separate deterministic source, so the cryptographic-source description applies specifically to Secure mode.
The range conversion uses rejection sampling to avoid modulo bias. It discards the uneven tail before taking a remainder. For six outcomes, 232 = 4,294,967,296 leaves a remainder of four when divided by six. Rejecting those last four raw values makes the accepted space divisible by six. With uniformly distributed input words, each of the six outcomes has the same probability.
Unique selection uses a partial Fisher-Yates shuffle when the available pool is at most twice the requested count. For larger pools it collects distinct random offsets in a set. These paths avoid allocating an enormous array for a wide range. Sorting happens after sampling, so Ascending and Descending change presentation rather than the underlying selection rule.
When should you use a reproducible seed?
Use Reproducible (seeded) mode when a test fixture or game experiment needs the same batch again. Enter Seed text and keep the same range, count, type, precision, uniqueness and sort settings. Every Generate click constructs the seeded source again: it repeats the batch rather than advancing to a new batch in a continuing sequence.
The implementation hashes the seed through xmur3, initializes sfc32 and runs 12 warm-up rounds. Seed used appears with the result, including an explicit empty-seed indicator when the field is blank. Copy seed copies the seed separately from Copy, which copies numbers. This mode is for tests and games, not draws, lotteries or security. Switching into it disables session drawing.
What are the presets and common uses?
The 1-10 and 1-100 presets each request one integer. The d6 and d20 presets request one integer from 1 to 6 or 1 to 20 respectively. Those four presets turn uniqueness off and use As drawn ordering. The 6 of 49 preset instead requests six unique integers from 1 through 49 and selects Ascending. Presets change number settings; they do not switch the randomness mode.
For sampling spreadsheet rows, number only the eligible rows before drawing. For an informal giveaway, assign each eligible entry a number and use session drawing if winners are selected in successive rounds. The tool accepts numeric ranges rather than participant names, weights or spreadsheet uploads. For other everyday numeric tasks, browse the generator tools alongside this page.
What does copying or sharing preserve?
Copy sends the current displayed batch to the clipboard. Comma separates values with a comma and space, Space uses one space, and New line puts each number on its own line. Sorting is already reflected in the copied order. There is no file export control in this generator.
The page address stores settings after #: mode, seed when applicable, bounds, count, uniqueness, sort, number type and precision. It does not store the generated list, session exclusions, separator or last-result avoidance. Sharing a Secure-mode configuration therefore does not share the same draw. A seeded configuration reproduces the batch through its seed and settings. Anyone receiving that link can read the included seed.
Number generation runs locally without network requests in the generator code. Once the tool has loaded, its generation logic needs no connection. Session history lives in component memory rather than a saved draw log, so copy any results you want to keep before resetting or leaving.
Is this generator suitable for official draws?
Secure mode provides cryptographic randomness and unbiased range mapping, but this interface supplies no certification, signed result or permanent audit trail. The 6 of 49 preset is a number-selection convenience, not a lottery prediction. Seeded mode is deliberately repeatable and must not be used when unpredictability is required. Choose a separately audited process when your draw requires independently verifiable records.
What else can you generate?
For a secret rather than a numeric sample, use the Password Generator. For structured identifiers, open the UUID Generator. Design tasks have a Random Color Generator, while the Lorem Ipsum Generator provides placeholder text. Those tools address different output types; this page focuses on numeric ranges and draw rules.
How to Use Random Number Generator
-
Minimum
Enter both inclusive bounds, or select 1-10, 1-100, d6, d20 or 6 of 49. Set How many (1-10,000) to the size of your batch.
-
Integers
Choose Integers or Decimals. For Decimals, set Decimal places from 0 to 10. Choose As drawn, Ascending or Descending under Sort.
-
Randomness mode
Keep Secure (default) for random draws. Select Unique (no repeats) for a distinct batch or Draw without replacement for session exclusions. For repeatable test data, choose Reproducible (seeded) mode and enter Seed text.
-
Generate
Click Generate. Choose Comma, Space or New line, then click Copy. In a draw session, check Remaining before the next batch and use Reset to restore the pool.