A number and letter generator builds random codes from digits and letters. Set a length (8 characters gives codes like K7QM29XB) or a pattern such as LLL-DDDD (letters, then digits, like QHT-4827), choose upper or lower case, and generate up to 500 codes at once. The generator uses your browser's cryptographic random source (crypto.getRandomValues), so every character is equally likely and nothing is sent to a server.
The first code rolls into place on the split-flap tiles, the strength bar shows how many bits of randomness each code has, and the full list is ready to copy or save as a .txt file. Look-alike characters (0, O, 1, I, l) are skipped by default so codes are easy to read and type.
How number and letter generator works?
To make random codes, the number and letter generator picks each character with the browser's cryptographic random source. The generator builds a character pool from your options, draws each character with crypto.getRandomValues (rejecting biased values), fills the length or pattern, and reports the strength in bits. 12 characters from A–Z and 0–9 give 62 bits.
- Set the options
Length or pattern, quantity, uppercase, lowercase, digits, and look-alike filter.
12 · A–Z 0–9 - Build the pool
The chosen character sets are joined. Look-alikes 0 O 1 I l can be removed.
36 characters - Draw characters
Each character is a fresh random draw, with no modulo bias.
K7Q2M9XA4T1C - Score the code
Bits = length × log₂(pool size).
12 × log₂ 36 = 62.0 bits
Codes are made in your browser and never sent to a server. Save .txt downloads the list.
Number and letter generator formula
The number and letter generator strength formula is bits = L × log₂(N), where L is the code length and N is the pool size. Each extra bit doubles the guesses needed.
Formula
Where
- L
- number of random characters
- N
- pool size: 10, 26, 36, 52, or 62
- ni
- pool for position i in a pattern
Worked example
The US National Institute of Standards and Technology (NIST) SP 800-63B treats 6 random digits (19.9 bits) as the floor for one-time codes.
Number and letter generator conversion chart
The number and letter generator conversion chart shows the strength of random codes by length and pool. Each A–Z and 0–9 character adds 5.17 bits, and each a–z, A–Z, 0–9 character adds 5.95 bits.
| Length | Digits (3.32 bits each) | A–Z + 0–9 (5.17 bits each) | a–z, A–Z, 0–9 (5.95 bits each) |
|---|---|---|---|
| 4 | 13.3 bits | 20.7 bits | 23.8 bits |
| 6 | 19.9 bits | 31.0 bits | 35.7 bits |
| 8 | 26.6 bits | 41.4 bits | 47.6 bits |
| 10 | 33.2 bits | 51.7 bits | 59.5 bits |
| 12 | 39.9 bits | 62.0 bits | 71.5 bits |
| 16 | 53.2 bits | 82.7 bits | 95.3 bits |
| 20 | 66.4 bits | 103.4 bits | 119.1 bits |
| 24 | 79.7 bits | 124.1 bits | 142.9 bits |
| Code | Characters | Bits | Good for |
|---|---|---|---|
| 6 digits | 10 | 19.9 | One-time login codes |
| 8 × A–Z, 0–9 | 36 | 41.4 | Coupon, voucher, and invite codes |
| 12 × A–Z, 0–9 | 36 | 62.0 | Licence keys, order references |
| 16 × a–z, A–Z, 0–9 | 62 | 95.3 | Passwords and API tokens |
Bits = length × log2(number of characters). Each extra bit doubles the number of possible codes. Security guidance such as NIST SP 800-63B favours long random secrets over short complex ones.
Patterns for codes
- L = letter, D = digit, X = letter or digit.
- Any other character stays as typed:
INV-DDDDDDgives INV-482913. - Licence plate style:
LLL-DDDD. Gift card style:XXXX-XXXX-XXXX. Product SKU:LL-DDD-X.
To see how many codes a pattern can produce before you use it, try the combinations calculator.
Why skip look-alike characters
0 and O, and 1, I, and l, look alike in many fonts, especially on printed cards and receipts. Skipping them removes up to 5 characters, which costs about 0.2 bits per character but saves support tickets from customers who mistype a code. Turn the option off when every character must be available.
Frequently asked questions
Is this random generator secure?
It uses crypto.getRandomValues, the browser's cryptographic random number source, and nothing leaves your device.
Can I get unique codes?
Collisions are very unlikely for long codes. With 8 characters from 32 symbols, 500 codes have less than a 0.01% chance of any repeat. Check for duplicates before using codes as unique IDs.
How do I generate a code like ABC-1234?
Choose Pattern and type LLL-DDDD.
What length should a random password be?
At least 16 characters from letters and digits gives about 95 bits, enough for most accounts.
What is the formula for code strength in bits?
Bits = length × log₂(pool size). 8 characters from A–Z and 0–9 give 8 × 5.17 = 41.4 bits.
How many bits is a 6-digit code?
A 6-digit code has 19.9 bits (1,000,000 options).
How many random codes can a pattern make?
Multiply the pool sizes of each position. LLL-DDDD makes 26³ × 10⁴ = 175,760,000 codes.
More number and letter tools