Random Number Generator
Generate one or up to 1,000 random numbers from an inclusive integer range or an exact fixed-precision decimal grid. Prevent duplicates, sort the result, inspect the eligible value pool, and copy or download the generated numbers.
Generation options
1 value · integers · repeats allowed
Generation options
1 value · integers · repeats allowed
Result
Your results
Set the range, then generate a random result.
Ready to generate
Your random result will appear here.
How to Use the Random Number Generator
Enter the Minimum and Maximum values for the range. The generator includes both endpoints when they are valid values on the selected grid.
Select Generate number to create one result using the default settings.
Open Generation options to change the result count, decimal precision, sort order, or duplicate policy. The collapsed summary shows the active settings without requiring the panel to remain open.
After generation, use Again to create a new result with the same settings, Copy to copy one number per line, or Download to save the values in a text file.
Generate a Random Number Between Two Values
The minimum and maximum define the complete permitted interval. A range from 1 to 100 can return any whole number from 1 through 100, including both 1 and 100.
Negative values and ranges crossing zero are supported. For example, -5 through 5 contains 11 integers: five negative numbers, zero, and five positive numbers.
The order in which the bounds are entered matters. The minimum must be less than or equal to the maximum.
When the minimum and maximum are equal, the range contains one eligible value and every valid draw returns that value.
Integer Mode versus Decimal Mode
Set decimal places to 0 to generate integers. Every safe integer between the minimum and maximum is eligible.
Choose between 1 and 6 decimal places to generate values from a fixed decimal grid. Two decimal places produce steps of 0.01, three produce steps of 0.001, and six produce steps of 0.000001.
Decimal generation does not create an arbitrary floating-point number and round it afterward. The generator first identifies the valid grid positions and then selects one of those positions.
This approach gives every displayed fixed-precision value one defined position in the eligible pool.
Integer and fixed-decimal generation
The selected decimal precision determines which values belong to the eligible pool.
Swipe horizontally to view the full table.
How the Eligible Decimal Grid Is Calculated
The generator scales the entered range by 10 raised to the selected number of decimal places. It then works with integer tick positions rather than repeatedly performing decimal arithmetic.
For two decimal places, 1.25 is represented by tick 125 and 1.30 by tick 130. The eligible ticks are 125, 126, 127, 128, 129, and 130.
When a boundary lies between grid positions, the grid moves inward. A minimum of 1.123 with two decimal places begins at 1.13 rather than 1.12 because 1.12 is below the entered minimum.
The interface shows the actual first value, last value, step, and number of eligible values before generation.
Why Decimal Boundaries Can Move Inward
A selected precision permits only certain values. At two decimal places, values occur in hundredth steps; 1.123 is not one of those values.
The lower boundary moves upward to the first valid grid value inside the range. The upper boundary moves downward to the final valid grid value inside the range.
For a range from 1.123 to 1.138 at two decimal places, the only eligible value is 1.13.
This is different from rounding the entered boundaries. The generator never adds a value that lies outside the original range.
Generate Multiple Random Numbers
Open Generation options and enter a count from 1 through 1,000.
When repeated values are allowed, each draw uses the complete eligible pool. The same number can therefore appear more than once in the result.
The result panel displays generated values in a compact scrollable grid. Copying or downloading places one formatted number on each line.
The requested count affects how many draws are made, not the probability assigned to each eligible value on an individual draw.
Generate Unique Random Numbers without Repeats
Enable Unique values to select without replacement. Once an eligible value has been selected, it cannot appear again in the same generated result.
The count cannot exceed the eligible pool. A range from 1 through 5 can produce at most five unique integers.
Unique generation applies only to the current result. Selecting Generate again starts a new sample from the full configured range.
The implementation uses sparse partial Fisher–Yates sampling. Memory use grows with the requested count rather than with the complete eligible range.
Keep Generated Order or Sort the Results
Choose Generated order when the sequence of draws matters. This preserves the first, second, and later generated positions.
Choose Ascending or Descending to reorder the completed result numerically.
Sorting happens after every number has been selected. It does not change the eligible range, selection probabilities, duplicate policy, or generated set.
Do not sort a unique result when the purpose is to create a randomized order. Sorting would retain the values but remove the randomized sequence.
How Random Number Probability Works
When the eligible pool contains n values, each value has a theoretical probability of 1 divided by n on one draw.
A range from 1 through 100 contains 100 eligible integers, so each integer has a 1% chance on an individual draw.
With repeats allowed, each draw is independent and uses the complete pool again.
When k unique values are selected without replacement from n eligible values, each eligible value has a k divided by n probability of appearing somewhere in the completed sample.
Probability for one value on one draw
The table assumes every value has one equal position in the eligible pool.
Swipe horizontally to view the full table.
Random Results Can Contain Repeats and Streaks
Random does not mean that every result will appear evenly over a short sequence.
When repeats are allowed, the same value can appear several times in succession even when every eligible value has equal probability.
A number that has not appeared recently is not due to appear. Previous independent draws do not change its probability on the next draw.
Enable Unique values when the task specifically requires every number in the current result to be different.
Browser Randomness and Unbiased Range Mapping
The generator obtains random integer values through Crypto.getRandomValues(), the browser interface for cryptographically strong random values.
Those source values must still be mapped to the requested range. A simple remainder operation can introduce bias when the source range is not evenly divisible by the target pool size.
The shared random-number helpers use rejection sampling to discard the small leftover region before mapping a source value to an eligible index.
For pools larger than 2^32 values, the implementation uses a 53-bit sampler while remaining within JavaScript's supported integer precision.
JavaScript Safe Integers and Large Ranges
JavaScript uses the IEEE 754 double-precision number format. It cannot represent every integer exactly once values move outside the safe-integer range.
Integer mode therefore requires both boundaries to be safe integers. Decimal mode applies the same requirement after the values are scaled into integer ticks.
Rejecting unsupported ranges prevents distinct mathematical values from collapsing into the same stored JavaScript number.
A rejected range should be reduced in magnitude, widened when no decimal grid point exists, or generated using fewer decimal places.
Copy and Download Generated Numbers
The Copy action places every generated value on a separate line, making the result easy to paste into a spreadsheet, document, code editor, or form.
The Download action creates a plain-text file named random-numbers.txt in the browser.
Fixed-decimal results preserve the selected number of decimal places. A value mathematically equal to 2.5 is exported as 2.50 when two decimal places are selected.
Downloaded and copied values contain the numbers only; interface labels and explanatory text are not included.
Appropriate Uses and Important Limitations
The generator is useful for classroom activities, games, demonstrations, randomized ordering, software test data, examples, and informal number selection.
Although the browser source provides cryptographically strong random values, this general interface does not enforce the formats, entropy requirements, lifecycle controls, or secure handling needed for passwords and cryptographic secrets.
The tool does not provide participant verification, seeded reproducibility, signed records, public audit logs, independent witnessing, or regulatory controls.
Use a purpose-built and appropriately reviewed system for security credentials, regulated drawings, valuable prizes, formal experiments, medical allocation, or other high-stakes decisions.
Private Local Generation
Range settings and generated results are processed in the browser. They do not need to be uploaded to a server.
The values are not placed in the page URL and are not permanently saved by the generator.
Copying places the result on the system clipboard, where it may be visible to other applications with clipboard access.
Downloading creates a local text file through the browser. The user controls where that file is stored.
Random Number Range and Probability Formulas
These formulas describe the eligible pool used by the generator.
Formula variables
- Entered minimum value
- Entered maximum value
- Selected number of decimal places
- Integer scaling factor used for decimal ticks
- First eligible scaled tick inside the range
- Last eligible scaled tick inside the range
- Total number of eligible values
- Number of unique values requested
Examples
Generate one number from 1 to 100
1Input
Minimum 1; maximum 100; count 1; decimals 0.
Show result
Result
One integer from the inclusive range 1 through 100.
Each integer has a 1% chance on the draw.
Generate five unique numbers
2Input
Minimum 1; maximum 50; count 5; decimals 0; Unique values enabled.
Show result
Result
Five different integers selected from the 50-value pool.
A new generation can contain values that appeared in the previous result.
Generate decimal values
3Input
Minimum 10; maximum 20; count 4; decimals 2.
Show result
Result
Four values selected from 10.00 through 20.00 in steps of 0.01.
Trailing zeros are retained in the displayed, copied, and downloaded output.
Use decimal boundaries between grid points
4Input
Minimum 1.123; maximum 1.138; decimals 2.
Show result
Result
1.13 is the only eligible value.
1.12 is below the minimum and 1.14 is above the maximum.
Generate negative numbers
5Input
Minimum -20; maximum -1; count 3; decimals 0.
Show result
Result
Three integers from -20 through -1.
Generate across zero
6Input
Minimum -5; maximum 5; count 4; decimals 0.
Show result
Result
Four draws from an 11-value pool containing -5 through 5.
Zero and both endpoints are eligible.
Create a randomized order
7Input
Minimum 1; maximum 10; count 10; Unique values enabled; Generated order.
Show result
Result
Every integer from 1 through 10 appears exactly once in randomized order.
Do not sort the result when the randomized sequence matters.
Create an ascending random sample
8Input
Minimum 1; maximum 1,000; count 20; Unique values enabled; Ascending.
Show result
Result
Twenty different generated integers displayed from lowest to highest.
Sorting occurs only after selection.
Frequently Asked Questions
How do I generate a random number?
Enter the minimum and maximum values, then select Generate number. The default settings produce one integer.
Are the minimum and maximum included?
Yes in integer mode. In decimal mode, a boundary is included only when it falls exactly on the selected fixed-precision grid.
Can I generate more than one number?
Yes. Open Generation options and choose a count from 1 through 1,000.
Can I generate decimal numbers?
Yes. Choose between 1 and 6 decimal places. The tool selects from exact fixed-precision grid positions inside the entered range.
Are decimal values generated and then rounded?
No. The eligible decimal grid is calculated first, and one of its scaled integer ticks is selected. This avoids creating arbitrary values and rounding them afterward.
Why did the actual grid move inside my range?
One or both entered boundaries did not fall on a valid value at the selected decimal precision. The generator uses only grid values that remain inside the original interval.
What does Eligible mean?
Eligible is the total number of distinct values available on the current integer or fixed-decimal grid.
What does Step mean?
Step is the difference between adjacent eligible values. Integer mode uses 1, while two decimal places use 0.01.
Can the same number appear more than once?
Yes when Unique values is disabled. Every draw then uses the complete eligible pool.
How do I generate numbers without repeats?
Open Generation options and enable Unique values. The requested count must not exceed the eligible pool size.
Does Unique values prevent repeats forever?
No. It prevents repeats only within one generated result. Generating again begins a new sample.
What happens when the unique count is larger than the range?
The generator reports an error because it cannot select more distinct values than the eligible pool contains.
Can I generate negative random numbers?
Yes. Enter negative bounds or use a range that crosses zero.
Can the minimum and maximum be the same?
Yes, provided that value is valid at the selected precision. The eligible pool then contains one value.
How does sorting work?
Ascending and descending sorting are applied after generation. Sorting changes only the output order.
How do I preserve the random draw order?
Choose Generated order in Generation options.
How many decimal places are supported?
The generator supports 0 through 6 decimal places.
Why are trailing zeros displayed?
Fixed-decimal output preserves the selected precision. With two decimal places, 2.5 is displayed as 2.50.
How large can the eligible range be?
The eligible grid can contain up to 2^53 values when its scaled tick boundaries and distance remain within the supported precision rules.
Why are some very large ranges rejected?
JavaScript cannot represent every integer exactly outside its safe-integer range. Rejecting unsupported grids prevents skipped, duplicated, or indistinguishable values.
Does the generator use Math.random()?
No. It uses browser Crypto.getRandomValues through the shared random-number helpers.
Is the random mapping unbiased?
The implementation uses rejection sampling when mapping source values to the eligible range, avoiding the remainder bias caused by simple modulo mapping.
Can I reproduce the same result later with a seed?
No. The generator does not accept a seed or preserve random-generator state.
Can I copy all generated numbers?
Yes. Copy places one formatted number on each line.
Can I download the result?
Yes. Download creates a plain-text file named random-numbers.txt.
Are my settings or generated numbers uploaded?
No. Generation and result handling happen locally in the browser.
Can I use these numbers for passwords or encryption keys?
Do not use this general-purpose interface for security secrets. Use a dedicated generator designed for the required format, entropy, storage, and security controls.
Can I use it for an official lottery or prize draw?
It is suitable for informal selection but does not provide entrant verification, independent auditing, signed records, or regulatory controls.
References
You might also like
Random Name Picker
Enter names, spin a full-screen animated wheel, and reveal one random winner with optional sound and celebration effects.
Random Picker Wheel
Add names or choices, spin the wheel, save reusable wheels locally, keep or remove winners, and review recent results.
List Randomizer
Shuffle names, tasks, topics, numbers, or any line-separated list into a new random order.
Reaction Time Test
Test how quickly you react to a visual signal with a simple browser-based reaction time test.