T
THINKFORU
Submit Feedback

Random Integer Generator: Secure Whole Numbers

Random Integer Generator: Secure Whole Numbers

Random Integer Generator

Save on Google
Press Generate Integers to see your result.

Related tools

ToolWhat it does
Random Number GeneratorPick random numbers in any range, with decimals, sorting and unique-number options.
Random Decimal GeneratorGenerate random decimals with 1 to 10 decimal places and JSON, CSV or text export.
Random PIN GeneratorCreate unguessable 4-digit, 6-digit or custom PINs with weak-PIN filters.
Random Letter GeneratorGenerate random letters A–Z with vowel, consonant, case and unique-letter options.
Random Word GeneratorGenerate random nouns, verbs and adjectives for games, writing prompts and brainstorming.

Discrete Integer Intervals, Divisibility & Number Theory Matrix

Showing 70 of 70 specifications
Integer Range / StepTotal Available IntegersParity Ratio (Even:Odd)Mathematical Category
1 to 6 · step 163 : 3 (= 1 : 1)Common testing set (six-sided die) · 3 primes, 50.0% prime density.
1 to 10 · step 1105 : 5 (= 1 : 1)Common testing set (first ten integers) · 4 primes, 40.0% prime density.
1 to 12 · step 1126 : 6 (= 1 : 1)Common testing set (d12 or months of the year) · 5 primes, 41.7% prime density.
1 to 20 · step 12010 : 10 (= 1 : 1)Common testing set (d20 or small classroom sample) · 8 primes, 40.0% prime density.
1 to 25 · step 12512 : 13Common testing set (small sample size) · 9 primes, 36.0% prime density.
1 to 31 · step 13115 : 16Common testing set (days of a month) · 11 primes, 35.5% prime density.
1 to 49 · step 14924 : 25Common testing set (6/49 lottery balls) · 15 primes, 30.6% prime density.
1 to 50 · step 15025 : 25 (= 1 : 1)Common testing set (common sampling range) · 15 primes, 30.0% prime density.
1 to 52 · step 15226 : 26 (= 1 : 1)Common testing set (playing cards) · 15 primes, 28.8% prime density.
1 to 60 · step 16030 : 30 (= 1 : 1)Common testing set (minutes or seconds) · 17 primes, 28.3% prime density.
1 to 100 · step 110050 : 50 (= 1 : 1)Common testing set (percent scale and the most common test range) · 25 primes, 25.0% prime density.
1 to 365 · step 1365182 : 183Common testing set (days of the year) · 72 primes, 19.7% prime density.
1 to 500 · step 1500250 : 250 (= 1 : 1)Common testing set (mid-size QA range) · 95 primes, 19.0% prime density.
1 to 1,000 · step 11,000500 : 500 (= 1 : 1)Common testing set (large sample) · 168 primes, 16.8% prime density.
0 to 9 · step 1105 : 5 (= 1 : 1)Common testing set (decimal digits) · 4 primes, 40.0% prime density.
0 to 10 · step 1116 : 5Common testing set (inclusive zero-to-ten scale) · 4 primes, 36.4% prime density.
0 to 99 · step 110050 : 50 (= 1 : 1)Common testing set (two-digit numbers) · 25 primes, 25.0% prime density.
0 to 100 · step 110151 : 50Common testing set (percentage scale) · 25 primes, 24.8% prime density.
0 to 255 · step 1256128 : 128 (= 1 : 1)Common testing set (8-bit byte values) · 54 primes, 21.1% prime density.
0 to 1,023 · step 11,024512 : 512 (= 1 : 1)Common testing set (10-bit values) · 172 primes, 16.8% prime density.
−10 to +10 · step 12111 : 10Common testing set (symmetric small range) · 4 primes, 19.0% prime density. Primes counted for positive values only.
−50 to +50 · step 110151 : 50Common testing set (symmetric mid range) · 15 primes, 14.9% prime density. Primes counted for positive values only.
−100 to +100 · step 1201101 : 100Common testing set (symmetric test range) · 25 primes, 12.4% prime density. Primes counted for positive values only.
−500 to +500 · step 11,001501 : 500Common testing set (example range with negatives) · 95 primes, 9.5% prime density. Primes counted for positive values only.
1 to 10,000 · step 110,0005,000 : 5,000 (= 1 : 1)Common testing set (large discrete range) · 1,229 primes, 12.3% prime density.
n ≡ 0 (mod 3) in 1 to 1003316 : 17Congruence class · modulo 3, residue 0 · zero residue (multiples of 3) · e.g. 3, 6, 9, 12…
n ≡ 1 (mod 3) in 1 to 1003417 : 17 (= 1 : 1)Congruence class · modulo 3, residue 1 · quadratic residue · e.g. 1, 4, 7, 10…
n ≡ 2 (mod 3) in 1 to 1003317 : 16Congruence class · modulo 3, residue 2 · quadratic non-residue · e.g. 2, 5, 8, 11…
n ≡ 0 (mod 5) in 1 to 1002010 : 10 (= 1 : 1)Congruence class · modulo 5, residue 0 · zero residue (multiples of 5) · e.g. 5, 10, 15, 20…
n ≡ 1 (mod 5) in 1 to 1002010 : 10 (= 1 : 1)Congruence class · modulo 5, residue 1 · quadratic residue · e.g. 1, 6, 11, 16…
n ≡ 2 (mod 5) in 1 to 1002010 : 10 (= 1 : 1)Congruence class · modulo 5, residue 2 · quadratic non-residue · e.g. 2, 7, 12, 17…
n ≡ 3 (mod 5) in 1 to 1002010 : 10 (= 1 : 1)Congruence class · modulo 5, residue 3 · quadratic non-residue · e.g. 3, 8, 13, 18…
n ≡ 4 (mod 5) in 1 to 1002010 : 10 (= 1 : 1)Congruence class · modulo 5, residue 4 · quadratic residue · e.g. 4, 9, 14, 19…
n ≡ 0 (mod 7) in 1 to 100147 : 7 (= 1 : 1)Congruence class · modulo 7, residue 0 · zero residue (multiples of 7) · e.g. 7, 14, 21, 28…
n ≡ 1 (mod 7) in 1 to 100157 : 8Congruence class · modulo 7, residue 1 · quadratic residue · e.g. 1, 8, 15, 22…
n ≡ 2 (mod 7) in 1 to 100158 : 7Congruence class · modulo 7, residue 2 · quadratic residue · e.g. 2, 9, 16, 23…
n ≡ 3 (mod 7) in 1 to 100147 : 7 (= 1 : 1)Congruence class · modulo 7, residue 3 · quadratic non-residue · e.g. 3, 10, 17, 24…
n ≡ 4 (mod 7) in 1 to 100147 : 7 (= 1 : 1)Congruence class · modulo 7, residue 4 · quadratic residue · e.g. 4, 11, 18, 25…
n ≡ 5 (mod 7) in 1 to 100147 : 7 (= 1 : 1)Congruence class · modulo 7, residue 5 · quadratic non-residue · e.g. 5, 12, 19, 26…
n ≡ 6 (mod 7) in 1 to 100147 : 7 (= 1 : 1)Congruence class · modulo 7, residue 6 · quadratic non-residue · e.g. 6, 13, 20, 27…
Multiples of 2 in 1 to 100 · step 25050 : 0Multiples · divisible when the last digit is even · e.g. 2, 4, 6, 8…
Multiples of 3 in 1 to 100 · step 33316 : 17Multiples · divisible when the digit sum is divisible by 3 · e.g. 3, 6, 9, 12…
Multiples of 4 in 1 to 100 · step 42525 : 0Multiples · divisible when the last two digits form a multiple of 4 · e.g. 4, 8, 12, 16…
Multiples of 5 in 1 to 100 · step 52010 : 10 (= 1 : 1)Multiples · divisible when the last digit is 0 or 5 · e.g. 5, 10, 15, 20…
Multiples of 6 in 1 to 100 · step 61616 : 0Multiples · divisible when the even and digit sum divisible by 3 · e.g. 6, 12, 18, 24…
Multiples of 8 in 1 to 100 · step 81212 : 0Multiples · divisible when the last three digits form a multiple of 8 · e.g. 8, 16, 24, 32…
Multiples of 10 in 1 to 100 · step 101010 : 0Multiples · divisible when the last digit is 0 · e.g. 10, 20, 30, 40…
Multiples of 12 in 1 to 100 · step 1288 : 0Multiples · divisible when the divisible by both 3 and 4 · e.g. 12, 24, 36, 48…
Multiples of 25 in 1 to 100 · step 2542 : 2 (= 1 : 1)Multiples · divisible when the last two digits are 00, 25, 50 or 75 · e.g. 25, 50, 75, 100…
Multiples of 50 in 1 to 100 · step 5022 : 0Multiples · divisible when the last two digits are 00 or 50 · e.g. 50, 100…
X(n+1) = (a · X(n) + c) mod mm states (outputs 0 to m − 1)Depends on a, c and mPRNG · Linear congruential generator (LCG) · the general recurrence; the seed is X(0)
Hull–Dobell theorem (full period)Period m when all three conditions hold1 : 1 over a full period when m is evenPRNG · Full-period rule: c coprime to m; a − 1 divisible by every prime factor of m; a − 1 divisible by 4 if 4 divides m
Numerical Recipes: a = 1,664,525, c = 1,013,904,223, m = 2^324,294,967,296 states (full period)2,147,483,648 : 2,147,483,648 (= 1 : 1); lowest bit alternatesPRNG · LCG · widely copied 32-bit generator; weak low-order bits
ANSI C example: a = 1,103,515,245, c = 12,345, m = 2^312,147,483,648 states (full period)1,073,741,824 : 1,073,741,824 (= 1 : 1); lowest bit alternatesPRNG · LCG · sample rand() from the C standard; use only the high bits
Java java.util.Random: a = 25,214,903,917, c = 11, m = 2^48281,474,976,710,656 states1 : 1 over the full period; lowest bit alternatesPRNG · LCG · 48-bit state; nextInt() returns the top 32 bits
MINSTD (Park–Miller): a = 16,807, c = 0, m = 2^31 − 12,147,483,646 states (1 to m − 1; 0 is never produced)1,073,741,823 : 1,073,741,823 (= 1 : 1)PRNG · Multiplicative LCG · prime modulus 2,147,483,647 (a Mersenne prime); 48,271 is the improved multiplier
Knuth MMIX: a = 6,364,136,223,846,793,005, c = 1,442,695,040,888,963,407, m = 2^6418,446,744,073,709,551,616 states (full period)2^63 : 2^63 (= 1 : 1); lowest bit alternatesPRNG · LCG · 64-bit state, usually a 32-bit output from the high bits
RANDU (IBM): a = 65,539, c = 0, m = 2^31Period only 2^29 = 536,870,912 for odd seeds0 : all odd (odd seed gives only odd outputs)PRNG · Flawed LCG · consecutive triples lie on only 15 planes
Low-order bit weakness (m = 2^k)The lowest j bits repeat with period 2^jLowest bit alternates even, odd, even, oddPRNG · Limitation · parity and small moduli (x mod 2, x mod 4) are highly predictable
LCG limitations overallOutput fully determined by the seedRatio looks fair, order does notPRNG · Limitation · not cryptographically secure, points fall on lattice planes, and mod n mapping adds bias; this tool uses crypto.getRandomValues() instead
Signed 8-bit (int8): −128 to 127256128 : 128 (= 1 : 1)Integer overflow boundary · 127 + 1 wraps to −128 · C int8_t, Java byte
Unsigned 8-bit (uint8): 0 to 255256128 : 128 (= 1 : 1)Integer overflow boundary · 255 + 1 wraps to 0 · bytes, RGB channels
Signed 16-bit (int16): −32,768 to 32,76765,53632,768 : 32,768 (= 1 : 1)Integer overflow boundary · 32,767 + 1 wraps to −32,768 · Java short
Unsigned 16-bit (uint16): 0 to 65,53565,53632,768 : 32,768 (= 1 : 1)Integer overflow boundary · ports, Unicode BMP code units
Signed 32-bit (int32): −2,147,483,648 to 2,147,483,6474,294,967,2962,147,483,648 : 2,147,483,648 (= 1 : 1)Integer overflow boundary · 2,147,483,647 + 1 wraps to −2,147,483,648 · C int, Java int, JavaScript bitwise operators
Unsigned 32-bit (uint32): 0 to 4,294,967,2954,294,967,2962,147,483,648 : 2,147,483,648 (= 1 : 1)Integer overflow boundary · IPv4 addresses, crypto.getRandomValues() Uint32Array
JavaScript safe integers (Number): −9,007,199,254,740,991 to 9,007,199,254,740,99118,014,398,509,481,9839,007,199,254,740,991 : 9,007,199,254,740,992Integer overflow boundary · Number.MAX_SAFE_INTEGER = 9,007,199,254,740,991 · above it, integers lose exactness
Signed 64-bit (int64): −9,223,372,036,854,775,808 to 9,223,372,036,854,775,80718,446,744,073,709,551,6169,223,372,036,854,775,808 : 9,223,372,036,854,775,808 (= 1 : 1)Integer overflow boundary · 9,223,372,036,854,775,807 is the maximum · BigInt.asIntN(64, x)
Unsigned 64-bit (uint64): 0 to 18,446,744,073,709,551,61518,446,744,073,709,551,6169,223,372,036,854,775,808 : 9,223,372,036,854,775,808 (= 1 : 1)Integer overflow boundary · BigInt.asUintN(64, x) · BigInt itself has no fixed upper limit
This tool's allowed range: −1,000,000,000,000,000 to 1,000,000,000,000,0002,000,000,000,000,0011,000,000,000,000,001 : 1,000,000,000,000,000Engine limit · minimum and maximum between −1,000,000,000,000,000 and 1,000,000,000,000,000 so every integer stays exact

Frequently asked questions

QuestionAnswer
How do I generate a random integer between two numbers?Enter the minimum and the maximum, for example 1 and 100 or −500 and 500, then press Generate Integers. Both the minimum and the maximum can appear in the results, and negative numbers are supported.
How does the step value work?The step restricts which integers can appear. With Multiples of step, only multiples of N are used, such as 0, 5, 10 and 15 for step 5. With Counting from minimum, the values are the minimum plus whole steps, such as 3, 8, 13 and 18 for a minimum of 3 and step 5.
Can I generate unique random integers without repeats?Yes. Turn off Allow duplicates to get strictly unique integers. If you ask for more integers than the range and step contain, the result is capped at the number of available values.
How does the generator pick unbiased integers?It uses your browser's crypto.getRandomValues() with rejection sampling, so every available integer has exactly the same chance. Everything runs in your browser and nothing is sent to a server.
Can I export random integers as text, CSV or an array?Yes. Choose plain text (one per line), CSV (comma-separated) or an array such as [1, 5, 9], then copy the results or download a TXT or CSV file. You can generate up to 500 integers at once.
What is the largest range or integer I can use?You can use minimum and maximum values from −1,000,000,000,000,000 to 1,000,000,000,000,000. This stays inside JavaScript's safe integer limit of 9,007,199,254,740,991, so every result is exact.