How to use
- Choose Exact character count for a fixed-length string, or Random byte count for a specific amount of random data.
- Enter a whole-number length from 1 to 65,536.
- Choose an output format. Character mode supports alphanumeric, hexadecimal, Base64 and Base64url alphabets, or a custom alphabet. Byte mode supports hex, Base64, and Base64url encodings.
- Choose Generate string, or press Enter while editing an option.
- Choose Copy result when ready. Clear removes the output and custom alphabet from the page.
Worked example
For a URL-safe token with 256 random bits, choose Random byte count, enter 32, and select Base64url. The output will contain 43 characters with no = padding. Its value changes on every generation.
For an exact 20-character identifier using letters and numbers, choose Exact character count, enter 20, and select Alphanumeric. One possible result shape is aB7dE2gH9jK4mN6pQ8sT; this example is public and must not be used as a secret.
Characters, bytes, and security
Character mode samples each position independently and uniformly from the chosen alphabet. It does not guarantee that every character group appears; use the password generator if you need that behavior. Duplicate custom characters are removed so they do not skew the distribution.
A character is counted as a Unicode code point. An emoji may occupy more than one UTF-16 code unit, and a visible symbol made from multiple code points counts as multiple characters. Character count is not the encoded UTF-8 byte length.
In byte mode, each byte contributes eight random bits. Hex produces twice as many characters as bytes. Standard Base64 produces 4 × ceil(bytes / 3) characters including padding; unpadded Base64url produces ceil(bytes × 4 / 3). These encodings represent the same random bytes without increasing their entropy.
In character mode, the Base64 choices are simply 64-character alphabets: the result is not necessarily a valid encoding of whole bytes. Use byte mode when a receiving system expects decodable Base64 data.
Longer strings and larger alphabets increase the space of possible values. Secure randomness alone does not make a short string suitable as a secret, and random generation does not guarantee uniqueness. The size limit keeps generation responsive and fits the Web Crypto per-call byte quota.
Privacy
This tool runs entirely in your browser using cryptographic random values. Nothing you enter or generate is uploaded to any server or stored. Clipboard contents are managed by your device.