Typo-Proof Code Generator
Generate coupon, invite, serial and booking codes that survive being read aloud, handwritten or mistyped: Crockford Base32, a no-look-alike set, digits or short words, with a check character that catches typos. Validate typed codes, see the entropy and the chance of duplicates.
How to Use
- Choose an alphabet: Crockford Base32 for short codes, No look-alikes for handwriting, Digits for phone keypads, or Words for codes read over the phone.
- Set the length, the group size (4 gives
XXXX-XXXX), an optional prefix such asINV, and the check character. - Enter how many codes you need and press Generate. Repeats are thrown away and redrawn, so every code in the batch is unique.
- Read the readout: entropy per code, the chance of a duplicate before deduplication, and the odds that a random guess hits a real code.
- Use Copy all or Download CSV. To check codes customers typed, switch to Validate and paste them, one per line.
Worked Example
A coupon with 7 random Crockford Base32 characters, 7K3M9QX, plus a mod-37 check symbol.
Each character has a value: 7=7, K=19, 3=3, M=20, 9=9, Q=23, X=29. Read the code as one base-32 number and keep only the remainder after dividing by 37, one character at a time: r = (r × 32 + value) mod 37 gives 7 → 21 → 9 → 12 → 23 → 19 → 8. Symbol 8 is the digit 8, so the coupon is 7K3M-9QX8.
Now a customer types it wrong. Swapping Q and X (7K3M-9XQ8) gives a remainder of 9, not 8; typing N for M (7K3N-9QX8) gives Z. Both are rejected on the spot. Typing 7k3m 9qx8 in lower case with a space is fine: case and separators are ignored. Seven characters carry 7 × log2(32) = 35 bits, so there are 34,359,738,368 possible codes.
The common mistake: trusting “a million possible codes” to keep random codes unique. Draw 1,000 random 6-digit booking references and the chance that two are the same is 1 − e^(−1000 × 999 / 2,000,000) = 39.3%. Collisions arrive around the square root of the code space, not near its size, so always deduplicate (this tool does) or use longer codes.
Show Work
Formulas and Check Characters
Where These Check Digits Came From
Hans Peter Luhn, an IBM engineer, patented his check-digit method in 1960; it is the reason a payment form can reject a mistyped card number before contacting the bank. It is cheap enough to do in your head, but because it adds digits without regard to their order two places apart, a few swaps slip through.
Jacobus Verhoeff published a scheme in 1969 based on the dihedral group D5 that catches every single-digit error and every swap of neighbouring digits. H. Michael Damm reached the same guarantees in 2004 with a single 10 × 10 table, a totally anti-symmetric quasigroup. Douglas Crockford’s Base32 took the human side: a 32-symbol alphabet without I, L, O and U, decoding rules that forgive the common confusions, and an optional mod-37 check symbol.
About This Tool
This tool makes batches of up to 10,000 unique codes from four alphabets — Crockford Base32, a 19-symbol set with no visual look-alikes, digits and a 61-word list — with grouping, a prefix, and a check character chosen to suit the alphabet: Crockford’s mod 37, weighted mod 19 or mod 61, Luhn, Damm or Verhoeff. Validate mode cleans up what people type (case, spaces, hyphens, I/L/O look-alikes, misspelt words) and tells you whether the check still holds.
Show Work gives the alphabet size, bits per character, entropy, the duplicate chance and the full check-character calculation for the first code, or every normalisation step for a validated code. Codes are drawn with crypto.getRandomValues and rejection sampling, in your browser; none are sent anywhere.
Related tools: Password Generator, UUID Generator, and Checksum Calculator.
Frequently Asked Questions
Why leave letters out of a code alphabet?
Because people confuse them. Crockford Base32 drops I, L, O and U and reads a typed I or L as 1 and O as 0, so lFOR-7ZKE is accepted as 1F0R-7ZKE. The no-look-alike set here goes further and drops whole families — 0 O D Q, 1 I L, 2 Z, 5 S, 6 G, 8 B and U V — leaving 19 symbols that are hard to misread in handwriting.
Which check digit catches which typos?
All of them catch every single wrong character. Luhn misses one adjacent swap, 09 ↔ 90, and every swap of characters two apart (abc → cba). Damm and Verhoeff catch every adjacent swap. Crockford’s mod-37 symbol and the weighted mod-19 and mod-61 checks used here also catch every adjacent swap and every swap two apart; this tool verified each claim by trying every such error on thousands of codes.
How long should a coupon code be?
Long enough that guessing is hopeless. 10,000 codes of 7 Crockford characters (35 bits) leave 1 valid code in 3,435,974 possible ones, so a random guess almost never works. Add a character for every factor of 32 you want to add; add rate limiting on the redeem form either way.
What is the duplicate chance in the readout?
The birthday-problem chance that a batch drawn at random would contain at least one repeat: p ≈ 1 − e^(−n(n−1)/2N). It is larger than intuition suggests: 1,000 random 6-digit codes have a 39.3% chance of a repeat even though there are a million possible codes. The generator removes repeats anyway, so the batch you download is always unique.
Is the randomness good enough for vouchers?
Each character is drawn from crypto.getRandomValues, the browser’s cryptographic random source, with rejection sampling so no symbol is more likely than another. Nothing is sent to a server. Store the codes you issue and check redemptions against that list; the check character only catches typos, it is not a secret.
How do I use the Typo-Proof Code Generator?
Simply pick your options and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Is it free? Does it work without internet?
Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.
Where does my data go?
Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.
Common Use Cases
Coupon codes
7 Crockford characters plus a check symbol give codes like 7K3M-9QX8: 35 bits each, and a mistyped character is rejected before any database lookup.
Event invites
Nine no-look-alike symbols plus a check, grouped in fives (AA4WY-P4RCR), survive being copied off a printed card by hand.
Booking references
Six digits plus a Damm check digit fit a phone keypad and catch every single wrong digit and every swapped pair a caller reads back.
Gift card numbers
15 random digits plus a Luhn digit make the familiar 16-digit 4-4-4-4 layout that payment forms already validate.
Phone support codes
Three words plus a check word, like tiger-river-mango-comet, are easy to say and hear; “tigr” is still recognised as tiger.
Last updated: