I often have to generate random integers so I created this simple online utility that does it for me. It lets you generate however many random positive or negative integers you need from the given range. It works in the browser and is powered by alien technology from the future.

Random Integer Generator Options

Count and Range
Repeated Integers
If this option is selected, then the random generator can pick repeated values.
Output Format and Base

Random Integer Generator Examples (click to try!)

Random Negative Integers
In this example, we generate twenty-five random negative integers from the range -1 to -100 (inclusive). They are separated by a space and printed on the same line. When picking integers from this range, the repetition of the same integer is allowed.
-6 -56 -93 -100 -84 -80 -73 -23 -69 -72 -10 -53 -60 -8 -87 -20 -71 -75 -15 -44 -58 -62 -88 -74 -7
How many integers to generate?
Starting integer.
Ending integer.
Separate random integers with this value.
Allow Repetition
Decimal Base
Random Bits
In this example, we generate 1 kilobyte of random bits. That's 1024 random integers from the interval 0-1 that are separated by the empty symbol (or nothing).
1111101101010010011111110001101110110011001110101011111100011000011001100110000000010010110101111111011010000100111010010110111101010000111111101011111001010000010000110100111101011000110100001001001000101011110001001001111010101101111110101111011110010000110110010100001011000000110101000011101100000110100110101101010110101000010000111000100011111000111100100011100010010010111011111011000001101111101111100001100000110011100101111011010010100100101010100110001010111110110111011001111010100001000100010111001100000101100001110101101001000011111011001111100010100100101110110111010000100000010111010011001001110111011010111101111101111101010111101100010011000001011110011111101101000010111000111110010001110000001011111111110000101110110100001110111010110111011001110101010000111100111001101111010000000000100101111011110001000010110001010110011110110111111100101001000111010111001010011101111010000000001011010001001000001110100001101010101101000100111100110011110011001000100101011001000111010001100001111101111000000000
How many integers to generate?
Starting integer.
Ending integer.
Separate random integers with this value.
Allow Repetition
Decimal Base
The Entire Range
This example picks one hundred random integers from the range 1-100 without repetition. As there are exactly 100 integers in this range, the entire range is picked and the output contains every integer from 1 to 100 exactly once.
62
7
59
22
95
93
6
32
41
9
2
84
50
46
52
40
20
99
91
30
90
86
64
74
29
83
11
49
88
78
44
10
73
14
48
79
70
55
45
18
94
15
4
81
35
87
76
28
89
72
63
57
65
47
71
92
36
97
3
61
69
5
38
77
13
51
21
43
67
53
56
54
1
58
26
39
60
85
42
37
31
66
75
24
8
19
68
82
34
16
96
23
27
12
25
80
33
17
98
100
How many integers to generate?
Starting integer.
Ending integer.
Separate random integers with this value.
Allow Repetition
Decimal Base
Random Hexadecimal Integers
This example creates a list of 30 random integers that are displayed in the hex base. The range for these hex integers is from 0xFFFF (65535) to 0xFFFFFFFF (4294967295).
fdeebf81 | d6fe294b | eaefe294 | a1fce53e | 6be89c59 | e2e3df6e | e7ea6af3 | 3663aa03 | a138d3a8 | 68e86517 | ad77b551 | 4e392ade | f02e83f8 | 6e488958 | 67473cab | 5dc19ee7 | 9ae8c258 | d8c79378 | ec58af04 | 43a39b4a | fdc568df | 26feb632 | 5de64527 | dfa771a2 | 80bfe946 | 478442ac | 1724047c | fe0aaf52 | 97a6f756 | 43d28682
How many integers to generate?
Starting integer.
Ending integer.
Separate random integers with this value.
Allow Repetition
Hexadecimal Base
If you selected a custom base, set its value here. Valid bases are from 2 to 64.
Number Base 64 Integers
In this example, we generate a sequence of random integers with numeral radix 64. Radix 64 consists of digits 0123456789, lowercase letters abcdefghijklmnopqrstuvwxyz, uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ, and two symbols $ and _. The output sequence has 15 random integers that span from -100 to 100.
-1v -I E -U I H -1y A -1v -4 4 1p -F 1 10
How many integers to generate?
Starting integer.
Ending integer.
Separate random integers with this value.
Allow Repetition
Custom Base
If you selected a custom base, set its value here. Valid bases are from 2 to 64.

How Does This Random Integer Generator Work?

This random integer generator works entirely in your browser and is written in JavaScript. It uses the browser's built-in pseudorandom generator Math.random to pick random integers from the interval start to end (inclusive). If the allow-repetition option is selected, then the same value may be repeated multiple times. Otherwise, only unique values from this range are selected. In both cases, integers from the range start to end are repeatedly selected by the formula start + Math.random() * (end-start+1) and are appended to the randInts output array. If the repetitions are not allowed, then an additional seen hash-array is used to store and check if the value has been seen before. When a random integer randInt is picked, it's recorded in the seen hash-array as seen[randInt] = 1. In the next iteration, when the next random integer is picked, a check is performed to see if seen[randInt] exists. If it exists, that means this value was seen before. In this case, it's discarded, a new value is picked, and the same check is performed. This process continues until a random integer is found that hasn't been seen before. Overall, picking new random values continues as long as randInts.length is less than count (number of integers to generate; specified in the options). Once it stops, it checks the value of the selected output base (specified in the options). The supported base values are 2-64. If the selected base value is any other than 10 (decimal), it does a quick loop over all randInt values and converts them to the new base. After that, it merges all generated integers together via the randInts.join function with the delimiter argument. The delimiter symbol can be set in the options. Finally, it prints the generated random integer list to the screen.

Created by Browserling

This random integer generator was created by me and my team at Browserling. Behind the scenes, it's actually powered by our programmer tools that are used by millions of people every month. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!

Secret message: If you love my tools, then I love you, too! Use coupon code TOOLLING to get a discount at my company.