Generate random strings and IDs

Generate random strings and short IDs from URL-safe, hex, digit or your own characters, every character equally likely. Made in your browser.

How to generate random strings

  1. 1

    Choose a character set or type your own in the box

  2. 2

    Set the length and how many strings you need

  3. 3

    Copy or download the list

Short random IDs with a stated strength, made on your device

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.

Character sets

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.

Length and strength

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.

Fair picks

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.

Everything you need

Unbiased picks

Rejection sampling over the browser's secure random source, so no character in the set comes up more often than another.

Any character set

URL-safe, letters and digits, lowercase, hex or digits, or exactly the characters you type in the box.

Strength shown

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.

Frequently asked questions

Is every character equally likely?

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.

How long should an ID be?

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.

Can I use my own characters?

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.

Are the strings sent or stored anywhere?

No. They are made in this browser tab and are gone when you close it, so save the ones you keep.

Sources

Related guides

Work with files privately and confidentlyPractical, sourced explanations for safer file conversion, sharing, and cleanup.