About Random String Generator
This tool makes 1 to 50 random strings at a time, each 4 to 128 characters long, from one of six alphabets: letters and numbers (62 characters), letters only, lowercase letters and numbers, digits only, hexadecimal, or Base58. The default is five 24-character alphanumeric strings. You can put a fixed prefix such as sk_test_ in front of every string, and a Details panel reports the alphabet size, the entropy in bits and the total length. The strings are made by a fast pseudo-random generator, not a cryptographic one, so they suit test data, sample codes, placeholder keys and filenames. Do not use them as real passwords, API keys or session tokens.
Entropy of a random string by length and alphabet
These are the Entropy figures the Details panel shows for each setting. Higher means more possible strings: every extra bit doubles the count.
| Length | Letters and numbers (62) | Lowercase and numbers (36) | Base58 (58) | Hexadecimal (16) | Digits only (10) |
|---|---|---|---|---|---|
| 4 | 23.8 bits | 20.7 bits | 23.4 bits | 16 bits | 13.3 bits |
| 6 | 35.7 bits | 31 bits | 35.1 bits | 24 bits | 19.9 bits |
| 8 | 47.6 bits | 41.4 bits | 46.9 bits | 32 bits | 26.6 bits |
| 10 | 59.5 bits | 51.7 bits | 58.6 bits | 40 bits | 33.2 bits |
| 12 | 71.5 bits | 62 bits | 70.3 bits | 48 bits | 39.9 bits |
| 16 | 95.3 bits | 82.7 bits | 93.7 bits | 64 bits | 53.2 bits |
| 22 | 131 bits | 113.7 bits | 128.9 bits | 88 bits | 73.1 bits |
| 24 | 142.9 bits | 124.1 bits | 140.6 bits | 96 bits | 79.7 bits |
| 32 | 190.5 bits | 165.4 bits | 187.5 bits | 128 bits | 106.3 bits |
| 64 | 381.1 bits | 330.9 bits | 374.9 bits | 256 bits | 212.6 bits |
| 128 | 762.1 bits | 661.8 bits | 749.8 bits | 512 bits | 425.2 bits |
Letters only (52 characters) gives 45.6 bits at length 8, 68.4 bits at 12 and 91.2 bits at 16. The figure describes the settings, not the quality of the randomness behind them.
Sample output for common settings
Each row is real output from the tool for those settings. Your strings will be different every time you press Generate.
6-character alphanumeric codes
Length 6, How many 3, Alphabet: Letters and numbers
8TeyfV, Ev9zc6, 38mPdS
Entropy 35.7 bits. These three happen to mix letters and digits, but nothing forces a mix; a string can come out as letters only.
10-character lowercase codes
Length 10, How many 3, Alphabet: Lowercase letters and numbers
9lr3smc193, q868wirk15, x22xqclh1d
Entropy 51.7 bits. Useful where capital letters are a nuisance, such as coupon codes people type by hand.
32-character hex strings
Length 32, How many 2, Alphabet: Hexadecimal
f47d851cfd7fefa374cdacca7153c141, ae530ac09be09e9d7448b41d6e202c6b
Entropy 128 bits. Same shape as an MD5 digest or a UUID without hyphens.
16-digit number strings
Length 16, How many 2, Alphabet: Digits only
9348530798498962, 4378677640327120
Entropy 53.2 bits. Digit strings may begin with 0, so keep them as text in a spreadsheet.
Base58 share codes
Length 10, How many 3, Alphabet: Base58 (no 0 O I l)
yJVpWM5mzp, TwtydFUJms, enneT5KCk6
Entropy 58.6 bits. None of the look-alike characters 0, O, I or l can appear.
Placeholder API key with a prefix
Length 24, How many 1, Alphabet: Letters and numbers, Prefix: sk_test_
sk_test_8TeyfVEv9zc638mPdSv1owwo
Random length 24, Total length 32, Entropy 142.9 bits. The prefix adds length but no entropy.
The six alphabets and what each contains
| Alphabet option | Characters used | Alphabet size | Bits per character |
|---|---|---|---|
| Letters and numbers | A-Z, a-z, 0-9 | 62 | 5.95 |
| Letters only | A-Z, a-z | 52 | 5.70 |
| Lowercase letters and numbers | a-z, 0-9 | 36 | 5.17 |
| Digits only | 0-9 | 10 | 3.32 |
| Hexadecimal | 0-9, a-f (lowercase) | 16 | 4.00 |
| Base58 (no 0 O I l) | 1-9, A-Z without I and O, a-z without l | 58 | 5.86 |
There is no option for symbols, uppercase-only strings or a custom character list.
How the entropy figure is calculated
entropy in bits = length x log2(alphabet size)
Each character is chosen independently, so every position multiplies the number of possible strings by the alphabet size. Twelve characters from 62 gives 62^12 possible strings, and log2 of that is 12 x 5.954 = 71.5 bits. Length matters more than alphabet: going from hex to letters and numbers adds under 2 bits per character, while one extra character adds between 3.3 and 6 bits, depending on the alphabet. The prefix is a fixed, known value, so it is left out of the calculation and only counted in Total length.
How random these strings are, and where to use them
Every press of Generate starts a small pseudo-random generator called Mulberry32 from a seed between 0 and 999,999, then draws one character at a time from the chosen alphabet. The output looks uniformly random and passes for it in any test fixture, but two things follow from that design. The generator is not cryptographically secure, and for any given settings there are at most a million different batches the tool can produce, however long the strings are.
That is fine for the jobs people usually want a quick string for: filling a database column in a staging environment, sample order or ticket references, dummy tokens in documentation, unique-looking filenames, raffle or classroom codes, and test input for form validation. It is not acceptable for anything an attacker would gain from guessing. For those, generate the value in your own code with a cryptographic source: crypto.getRandomValues in a browser, crypto.randomBytes in Node.js, secrets.token_hex or secrets.token_urlsafe in Python.
Limits worth knowing before you generate
- Length runs from 4 to 128 characters. The slider stops at both ends.
- One run produces at most 50 strings. Press Generate again for another set.
- Strings in a batch are not checked against each other. Long strings will not repeat in practice, but 4-digit strings can, because only 10,000 exist.
- A string is not guaranteed to contain both letters and digits. Each character is an independent draw from the whole alphabet.
- Hex output is lowercase. Convert the case separately if you need capitals.
- Base64 is not one of the alphabets. Letters and numbers is the closest match: it is the Base64 character set without +, / and = padding.
How to use it
- 1
Drag Length to the number of random characters you want in each string, from 4 to 128.
- 2
Set How many to the number of strings you need, from 1 to 50.
- 3
Choose an Alphabet: Letters and numbers, Letters only, Lowercase letters and numbers, Digits only, Hexadecimal, or Base58 (no 0 O I l).
- 4
Optionally type a Prefix that will be placed at the start of every string.
- 5
Press Generate. Copy the strings or download them as strings.txt, and press Generate again for a new set.