← All Tools

Coupon Code Generator

Generate a batch of unique, cryptographically-random codes for promos, vouchers, gift cards, invite links, licence keys, or beta signups. Everything runs in your browser — no server round-trip, no code ever leaves the page. Pick an alphabet (defaults to a no-confusables set that skips 0/O, 1/I/L and the like so hand-typed codes don't collide), a chunk layout like XXXX-XXXX-XXXX, and optionally sign each code with a check digit for typo-detection at redemption time.

Generator settings

Verify a code's check digit

Paste one code below — the tool checks it against the current alphabet, pattern, and check-digit rule.

Entropy & collision guidance

Every random alphabet character contributes log₂(alphabet size) bits of entropy. A 12-char code from the default 32-symbol no-confusables alphabet gives 5 × 12 = 60 bits, which by the birthday bound means a 50 % chance of collision after roughly √(2 · 2⁶⁰) ≈ 1.5 × 10⁹ codes — plenty for even a huge promo campaign. If you're worried, generate more codes than you need and reject duplicates (this tool does that when unique is checked). For anti-abuse guessing resistance (an attacker submitting random codes to your redemption API), aim for ≥ 50 bits; at that point they'd need ~10¹⁵ tries to expect one hit — impractical if your endpoint rate-limits at even a modest 10 rps.

Check-digit reference

Mod-N over alphabet — treat each alphabet character as its index (A→0, B→1, …), sum indices, take sum mod N, output that alphabet character as the last position. Any single-char typo, any single-digit change, and most transpositions are caught. Simple to implement in any language.

Luhn — the classic credit-card algorithm (mod-10 doubled-alternate). Only works when the alphabet is digits 0-9. It catches every single-digit error and most adjacent transpositions.

Neither — plain random. Redeemer has to look up the exact string; no client-side typo hint. Use this when you want the code to look clean and the redemption endpoint already de-dupes at the DB layer.

Alphabet presets in detail
PresetSymbolsSizeBits/char
No-confusablesABCDEFGHJKMNPQRSTVWXYZ2345678930~4.91
Crockford Base320123456789ABCDEFGHJKMNPQRSTVWXYZ325.00
Uppercase A-ZA…Z26~4.70
Uppercase + digitsA…Z 0-936~5.17
AlphanumericA…Z a…z 0-962~5.95
Digits0-910~3.32
Hex0-9 A-F164.00
URL-safe base64A…Z a…z 0-9 - _646.00