Random String Generator
Generate random strings with a selectable character set.
Your result will appear here…
How to use Random String Generator
- Enter a length from 1 to 1024, or leave it empty for 24.
- Choose a character set.
- Select Generate and copy the string.
Example
Input / settings:
16
Output:
717546c6a517d0bd
Character set: Hexadecimal. This is one real run; every run produces a different string.
When to use
- Create placeholder identifiers for tests and fixtures.
- Make throwaway tokens for local development.
- Generate sample data of a known length and character set.
Overview
Random String Generator builds a string of 1 to 1024 characters from one of four character sets: letters and numbers, lowercase letters, digits, or hexadecimal. Each character is picked from the browser's Web Crypto random source. The tool generates text only; it does not check uniqueness, store results or judge whether a string is strong enough for your purpose.
Supported input
length and character set
Output details
random string
Common mistakes
- Length alone does not measure strength. Entropy is length × log2(character-set size): 16 hexadecimal characters carry 64 bits, while 8 digits carry about 26.6 bits.
- Hexadecimal output uses only 16 symbols, so it is much weaker per character than letters and numbers (62 symbols, about 5.95 bits each).
- Strings are not checked for uniqueness. Two runs can match; that is very unlikely for long strings but easy to hit with a few digits.
- The length is read as a JavaScript number and must be a whole number from 1 to 1024. 0, 1025, -5, 1.5 and abc are rejected, but 1e1, 16.0, +16 and 0x10 are accepted (0x10 gives 16 characters).
Practical tips
- Use UUID Generator when you need identifiers whose format others can recognize.
- For a long-lived secret, create it in the system that will store and rotate it.
Privacy and security
This tool runs entirely in your browser. Your input is never uploaded to our servers. Characters are chosen with crypto.getRandomValues. Bytes at or above the largest multiple of the character-set size are discarded, so no character is favored by a modulo effect. Generated strings are displayed only on this page and are not sent anywhere.
References
Frequently asked questions
How long can the generated string be?
From 1 to 1024 characters. An empty length field uses 24. The value is read as a JavaScript number, so forms such as 1e1 or 16.0 also work, while 0, 1025, 1.5 and abc are rejected.
How many bits of randomness does a string have?
Multiply its length by log2 of the character-set size. For 24 letters and numbers that is about 143 bits; for 12 lowercase letters it is about 56 bits.
Are the generated strings guaranteed to be unique?
No. Each string is generated independently, and the tool does not remember earlier results.