Promo Code Generator

Create unique, easy-to-read promo, discount and voucher codes with your own prefix, suffix and grouping. See how hard they are to guess, check codes you already have, and export your batch as TXT, CSV or JSON, all directly in your browser.
100% client-side · Web Crypto API · Nothing is stored or sent

Quick presets

Characters

Your promo codes
Export

How hard are the codes to guess?

Guess resistance-

-
Possible codes
-
Odds a guess hits
-
Entropy

Promo codes are not secrets. Check them on your server and limit failed attempts at checkout.

How Promo Codes Work

A promo code is a short random string that stands for a discount in your shop’s database. Because customers type it by hand, the alphabet leaves out characters that look alike, and long codes are broken into groups such as K7QM-X2PB. Because attackers can try codes at checkout, the length decides how often a random guess succeeds: every extra character multiplies the number of possible codes by the size of the alphabet.

This page chooses each character with the Web Crypto API, throws away any duplicate so every code in a batch is different, and shows the number of possible codes and the chance that one random guess hits one of yours.

Truly Random Codes

Every character comes from the Web Crypto API, with no modulo bias, so each is equally likely

Always Unique

Every code in a batch is different, and the page refuses settings that cannot make enough codes

Guess Odds, Not Guesswork

Shows how many codes are possible and the chance a random guess hits one of yours

Easy to Read and Type

No 0, 1, I or O, one letter case, optional no-vowel mode, and grouping such as XXXX-XXXX

Code Checker

Compares a code with your settings, flags probable typos and applies common checkout rules

Safe Export

TXT, CSV and JSON, with CSV protected against spreadsheet formulas, and nothing stored or sent

Frequently Asked Questions

1. What is a promo code generator?

A promo code generator creates the codes that customers type at checkout to get a discount, free shipping or a gift. Good codes are easy to read and type, different from each other, and hard to guess. This page makes them in your browser with the Web Crypto API and shows how hard they are to guess.

2. How are the codes made, and which characters are used?

Each character is chosen with the browser’s cryptographically secure random generator, using rejection sampling so that every character is equally likely. Letters and digits come from an alphabet without look-alikes: the letters I and O and the digits 0 and 1 are left out. With uppercase letters and numbers that leaves exactly 32 symbols, which is 5 bits per character. Special characters are optional, and many checkouts reject them.

3. Are the codes unique?

Within one batch, yes: every code is checked against the others and duplicates are discarded, so you always get exactly the number you ask for. Different batches are independent, so compare new codes with the ones you issued earlier. The old version of this page generated every code independently, and a batch of 1,000 four-character codes contained a duplicate roughly four times in ten.

4. How long should a promo code be?

Length is about guessing, not secrecy. The page shows the chance that one random guess hits one of your codes. With 8 characters from 32 symbols there are about 1.1 trillion codes, so 1,000 live codes would be hit by a guess about once in 1.1 billion tries. 6 characters gives about a billion codes and is fine for a short flash sale. Whatever the length, limit failed attempts at checkout and validate codes on your server.

5. Why are there no mixed-case codes, and why avoid look-alike characters?

Most shops treat codes as case-insensitive, so a code with both upper and lower case letters could clash with another code that differs only in case. Choose one letter case instead. Look-alikes such as 0 and O, or 1 and I, cause failed redemptions when customers type a code from a screenshot or a printed card.

6. What does Avoid vowels do?

It removes the vowels A, E, I, O and U from the letters, so random codes cannot spell words, which also means they cannot accidentally spell something rude. It reduces the number of possible codes, and the guess odds shown take that into account.

7. What does the Check tab tell me?

It compares a code with your current settings (prefix, suffix, grouping, length and characters) and applies the rules most checkouts use: no spaces, no unusual characters, a sensible length and no easily misread characters. It points out a probable typo, such as a zero where the generator would use the letter O. It cannot tell whether a code has been issued or is still valid, because that depends on your shop.

8. Is my data stored or sent anywhere?

No. Codes are generated in your browser, the page’s content security policy blocks outgoing network requests, and nothing is saved except your language choice. Earlier versions of this page loaded a script from an outside server, ignored the prefix, suffix and format in bulk mode, and rejected some of the page’s own codes in the validator.