Unbiased picks
Rejection sampling over the browser's secure random source, so no character in the set comes up more often than another.
Generate random strings and short IDs from URL-safe, hex, digit or your own characters, every character equally likely. Made in your browser.
Choose a character set or type your own in the box
Set the length and how many strings you need
Copy or download the list
A random string is the plain tool behind many everyday jobs: a short ID for a database row, a token in an invite link, a file name that will not collide, a coupon code, or a test value. Pick the characters, the length and how many you need.
The box starts with the URL-safe set: A to Z, a to z, 0 to 9, hyphen and underscore. It is the alphabet RFC 4648 defines for base64 that goes in a URL or a file name, so a string from it never needs escaping. The other presets are letters and digits, lowercase letters and digits, hexadecimal and digits only. To use your own set, type the characters in the box and choose “The characters in the box”. Leaving out characters that look alike, such as 0, O, 1, l and I, makes codes easier to read aloud or copy by hand.
The summary gives the strength of each string in bits: the length times the log base 2 of the number of characters to choose from. Each extra bit doubles the number of possible strings. With the URL-safe set, 21 characters give 126 bits, and 16 hex characters give 64 bits. Strings can be 1 to 256 characters long, and up to 1,000 can be made at once.
Taking a random number and keeping the remainder after dividing by the size of the set favours the first few characters slightly. Here a number that falls in that uneven part of the range is discarded and drawn again, so every character, and so every string, is equally likely.
For passwords with a guaranteed mix of character types, use the Password generator, and for standard identifiers, the UUID generator.
Nothing is uploaded. The strings are made in this tab.
Rejection sampling over the browser's secure random source, so no character in the set comes up more often than another.
URL-safe, letters and digits, lowercase, hex or digits, or exactly the characters you type in the box.
Each run reports the bits per string, so you can tell whether an ID is long enough before you use it.
Nothing uploaded: open the Network panel while it runs and check.
No daily limits or watermarks: free batches take up to 20 images.
Works offline: once the page has loaded, on any current browser.
Yes. Each character is picked with rejection sampling, so a draw that would favour the first characters of the set is thrown away and drawn again. The draws come from the browser's cryptographic random source.
The summary gives the bits in each string, which is length times the log base 2 of the number of characters. 21 URL-safe characters give 126 bits, a little more than the 122 random bits of a version 4 UUID.
Yes. Choose "The characters in the box" and type them. Each character counts once however often you type it, and spaces and line breaks are left out. Emoji and accented letters count as one character each.
No. They are made in this browser tab and are gone when you close it, so save the ones you keep.