I often have to generate random ASCII so I created this simple online utility that does it for me. It lets you generate however many random ASCII characters you need from a predefined pattern or the given code point range. It works in the browser and is powered by alien technology from the future.
Random Ascii Generator Options
Random Ascii Generator Examples (click to try!)
0S3Rbi6dAy9s99aPibE9hmRiSk46lST3 qtmlIP2ESWHAJ0JlIhYcuw1qEvTkSxai VcFlQHid6W50mJ1QzLTl7QS0mc5hPQsm KBzJFDeLIe1JdzC5IzwGD3UvhaA9FVoL 1UQagzdDVAfFNQpRuw0d59o6Yb0EDOWP HJxVBz033h70oH3Dluq8KKeVNF2Eq1fC fi9kQkQsEX01P8N3mTkev2E46O1EM7Me X5HTC56zeEGORDZ4VXjs5iSbjLLDipcF YT0A9uKIqp6BdB7Sztg5xm3UAa8JA0Ou SIgNSDTIt70JZZWv1DkEVU5w7DgotZ49
+ - 4 < = 7 * 2 0 6 3 3 > = / 0 ( 9 4 ^ = 9 > - 4 3 - = - 8 = 9 0 = 8 4 * > 5 2 < / 1 3 ) ^ 6 9 - * ) ^ ^ 9 4 7 > 8 4 6 2 ^ / / 1 5 7 > ( 2 + + - - 8 9 3 4 3 8 ) ^ 4 3 6 4 7 1 < / 6 7 2 ^ 2 8 3 = ) /
A, ␜, M, ␜, ␛, ␇, W, ␞, U, ␚, ␝, H ␒, P, I, ␡, ␂, X, U, N, W, K, ␝, P Q, ␏, ␓, ␌, U, ␅, ␜, ␏, L, E, ␀, ␑ G, U, B, ␅, E, ␓, S, F, K, ␠, O, ␁ ␊, ␅, ␇, ␂, ␚, ␁, ␚, V, ␚, W, L, ␋ ␊, ␋, ␎, ␓, ␍, ␒, E, ␆, ␜, A, J, ␓
How Does This Random Ascii Generator Work?
else if (customPattern),
else, each responsible for one of the modes. The first
if statement is used to generate a predefined pattern. In this mode, the program calls a function that stores all the predefined patterns in a lookup table called
charsets and returns an array with all characters in the charset. For example, all lowercase letters are stored in
charsets['alphalc'] array that looks like this:
["a", "b", "c", …, "z"]. To select a random array element, it calls the
randomArrEl(charset) function and puts the return value in the
char variable. This function is a one-liner
arr[Math.floor(Math.random() * arr.length)]. The second
else if statement is used to generate a custom pattern. In this mode, the program splits the custom character pattern into symbols using the
grapheme-splitter.js library and assigns the created array to the
customChars variable. Then it calls the function
randomArrEl(customChars) to generate a random ASCII character. The final
else statement is used to generate ASCII characters from a range of ASCII codes. The program converts the input range (or ranges, if multiple are specified) to the array
decimals and picks a random
dec value from it via the same
randomArrEl(decimals) function. To convert the picked decimal value to an ASCII symbol, it calls the
String.fromCharCode(dec) function. Each of the three control statements contain two
for loops. The first loop runs from
count that is responsible for the number of ASCII strings in the output. The second loop runs from
length and is responsible for the length of each result. At the end of both loops, the program calls the output prettifiction function that optionally replaces ASCII control characters and spaces with Unicode glyphs and converts the output array
chars to a string using the
Created by Browserling
This random ascii 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.