Random String Generator

Generate random alphanumeric strings, letter-only or digit-only strings, hex strings or strings from your own character set, at any length.

What you can do here

How to generate a random string

Choose a preset or tick the character sets you want, set the string length and how many strings you need, then press Generate. Every character is drawn independently from the chosen set with equal probability. Copy puts the whole list on your clipboard, one string per line.

Random alphanumeric generator

The default Alphanumeric preset mixes uppercase letters, lowercase letters and digits (62 characters), for example k7QpZ2mW9xLc4TbR. Pick Lowercase alphanumeric for case-insensitive IDs such as q3m8x0kz7p2w, or Uppercase alphanumeric for voucher and reference codes such as 7KQ2M9ZT4X. Tick Exclude look-alikes when people will read or type the code by hand.

Custom character sets

Type any characters into the custom box and only those are used. 0123456789abcdef gives hex strings, ACGT gives DNA-style sequences and 01 gives binary strings.

Entropy by length

Character setCharactersBits per character16 characters
Digits103.3~53 bits
Lowercase letters264.7~75 bits
Lowercase alphanumeric365.2~83 bits
Alphanumeric (mixed case)625.95~95 bits
Alphanumeric + symbols876.4~103 bits

Common uses

Random strings work as test-database keys, unique IDs, coupon codes, cache-busting suffixes, file names, placeholder usernames and fixture values in unit tests. Everything runs in your browser; nothing is uploaded or stored.

Generate random data from a regex

Choose Strings matching a regex pattern and type a regular expression: the generator builds random strings that match it. It supports literals and escapes, \d \w \s and their negations, character classes such as [A-Z0-9_] and [^aeiou], the dot, groups with alternation (cat|dog), and quantifiers * + ? {n} {n,} {n,m}; unbounded repeats stop at the maximum you set. Every result is re-checked against the pattern with the browser's own regex engine.

[A-Z]{3}-\d{4}                   ->  QXB-3071
[a-z]{5,10}\d{2}@(gmail|example)\.com  ->  mervola58@example.com
#[0-9A-F]{6}                    ->  #3FA2C9

Lookaheads and backreferences are ignored, so keep patterns to what a form or database field accepts: licence plates, SKUs, order IDs, postcodes and codes for fuzzing validators.

Generate random bytes

Choose Random bytes, set the number of bytes and pick the encoding: a hex string, spaced hex bytes, Base64, URL-safe Base64url, a C or C++ array, a JavaScript Uint8Array, a Python bytes literal, decimal values or binary. Bytes come straight from crypto.getRandomValues, so 16 bytes give 128 bits and 32 bytes give 256 bits, the usual sizes for salts, nonces, test keys and session IDs.

16 bytes, hex:     9f1c07e2a45b3d88c6f0217be94a5d13
16 bytes, Base64:  nxwH4qRbPYjG8CF76UpdEw==
4 bytes, C array:  {0x9F, 0x1C, 0x07, 0xE2}

Generate a random bitmap

Choose Random bitmap for a grid of random black and white pixels up to 128 x 128, with a live preview. Set the share of black pixels, tick Mirror left to right for symmetric identicon-style patterns, and output a 0/1 grid, ASCII art, a PBM (P1) image file you can open in GIMP or convert with ImageMagick, or each row packed into hex bytes for LED matrices and embedded displays.

Frequently asked questions

Can it generate strings that match a regex, or random bytes?

Yes. Choose Strings matching a regex pattern and enter a pattern such as [A-Z]{3}-\d{4}; classes, groups, alternation and quantifiers are supported. Or choose Random bytes for hex, Base64, Base64url, C, JavaScript or Python arrays.

How do I generate a random alphanumeric string?

Keep the Alphanumeric preset (A-Z, a-z and 0-9), set the length and press Generate. Choose Lowercase alphanumeric for a-z and 0-9 only.

Can I choose which characters are used?

Yes. Tick any mix of lowercase, uppercase, digits and symbols, or type your own characters in the custom box to use only those, for example hex digits.

How long can the random string be?

From 1 to 4,096 characters, and you can generate up to 1,000 strings at once. Strings in one batch never repeat.

Are the strings secure enough for passwords or tokens?

They use crypto.getRandomValues with unbiased sampling, so they are unpredictable. For passwords, a length of 16 or more alphanumeric characters with symbols is a good choice, or use the Password Generator.

Is anything sent to a server?

No. Strings are built in your browser and are not uploaded, logged or stored.

Related tools

Password GeneratorUUID GeneratorRandom BytesRandom Hex NumbersRandom Letter GeneratorRandom Number Generator