Choose the characters
Letters, digits, hex, base64 URL-safe, base32 or your own.
Pick a character set and a length and get as many random strings as you need: tokens, ids, test data, coupon codes or keys. Generated in your browser with a secure random source.
100% private — everything is generated in your browser with its secure random number generator, and nothing is sent or stored.
Letters, digits, hex, base64 URL-safe, base32 or your own.
Up to 4,096 characters and 1,000 strings.
Add a prefix or suffix if you need one.
Random strings are the raw material of many small tasks: an API token, a unique id for a record, a coupon code, a temporary key, a test fixture, a cache-busting value, a salt or a filler value for a spreadsheet. Writing a script for each one is overkill, and typing what looks random by hand is not really random. This tool produces as many as you want from the set of characters you choose.
The randomness comes from your browser's cryptographic random number generator, and each character is picked without the bias that a simple remainder calculation introduces, so every character in the set is equally likely. The tool shows the number of bits of randomness in each string, which tells you how hard one would be to guess: a 16-character string from 62 characters has around 95 bits.
Add a prefix or suffix to make identifiers such as usr_ followed by the random part. Keep "No repeated strings" ticked to guarantee that every string in the list is different, useful for coupon codes and ids.
The strings are random but carry no meaning and no checksum. If you need passwords, use the password generator, which guarantees character types and rates strength, and for standard identifiers use the UUID generator. Nothing is stored or sent.
The values are random, so each run prints something different. The snippets below were run, and the comments show what they print.
import secrets
import string
print(secrets.token_urlsafe(16)) # 22 URL-safe characters, such as k3Qv0b8XhZ1uJ9wT4cNpRg
alphabet = string.ascii_letters + string.digits
print("".join(secrets.choice(alphabet) for _ in range(16))) # 16 letters and digits, such as 7fK2mQ9vXb4Lw8Ra
const bytes = new Uint8Array(16); crypto.getRandomValues(bytes); const token = btoa(String.fromCharCode(...bytes)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); console.log(token); // 22 URL-safe characters, such as k3Qv0b8XhZ1uJ9wT4cNpRg
secrets in Python and crypto.getRandomValues in JavaScript. Python's random module and Math.random() are not designed for security.secrets.token_urlsafe(16) returns 22 random URL-safe characters. For a chosen alphabet, "".join(secrets.choice(alphabet) for _ in range(16)). Use secrets, not random, when it must be unguessable.More utilities that also run without leaving your browser.