Map Extract
Free tool

Generate unique discount and voucher codes

One shared code such as SPRING10 ends up on voucher websites within days. Unique codes, one per customer, stockist or printed card, are harder to pass around and tell you exactly which went out and which came back. Choose a prefix, a length and how many you need, and download them ready to import into your shop or till system.

Runs in your browser. Nothing you enter is uploaded.

Making a batch of codes

  1. Set a prefix

    Up to 12 letters or digits, such as SPRING or BURY, so staff and customers can see what the code is for. Leave it empty for purely random codes. Prefixes are converted to capitals.

  2. Choose the length

    From 4 to 16 random characters after the prefix. Longer codes are harder to guess.

  3. Choose how many

    Anything from 1 to 5,000 codes in one batch. Every code in the batch is different.

  4. Pick the options

    Hyphen after the prefix makes codes easier to read. Leave out look-alike characters drops 0, O, 1, I and L, which are easy to mistype from a printed card.

  5. Generate and export

    Press Generate codes, then Copy all or Download CSV, a single code column ready to import into your ecommerce platform, booking system or till.

Example: codes for stockist counter cards

A bakery supplier wanted each of its stockists to hand out a first-order discount for its trade account, with a different code per card so it could see which shop sent each new customer. It used the prefix bury, six random characters, a hyphen and no look-alike characters.

The prefix came out in capitals and every code used only easy-to-read characters. A second batch with no prefix and look-alikes allowed shows the difference: codes such as F1MMC7I5 mix 1 and I, which is exactly what the option avoids.

Input
Prefix: bury   Random characters: 6   How many: 5
Hyphen after the prefix: on   Leave out look-alike characters: on
Result
5 unique codes
BURY-SUDHQS
BURY-C6VPJ3
BURY-XCSHXE
BURY-USFB89
BURY-DQ8FPU

(No prefix, 8 characters, look-alikes allowed: YKG9QITL, F1MMC7I5, QIVO1XEI)

How many possible codes?

Without look-alikes, each random character is one of 31 letters and digits; with them, one of 36. The number of possible codes grows quickly with length, which is what makes guessing impractical.

Random charactersPossible codes, no look-alikesPossible codes, all characters
4923,5211,679,616
6887,503,6812,176,782,336
8About 852 billionAbout 2.8 trillion

Making the codes work

The generator only produces the codes. They do nothing until you import them into the system that applies the discount, with the rules you want: amount or percentage, minimum spend, expiry date and one use per code. Most ecommerce platforms and many till systems can import a list of codes from a CSV.

Keep a record of which code went to whom, or to which batch of printed cards, so you can measure the campaign afterwards. If a discount is advertised, make the terms clear, including expiry and any minimum spend, so customers are not misled.

Questions people ask

How do I create unique discount codes?

Choose a prefix, a length and how many codes you need, generate them here, and download the CSV. Then import the list into your shop or till system and set the discount rules there, such as the amount, expiry date and one use per code. Each customer or card gets a different code.

Are the codes truly random?

Yes. Each character is chosen with your browser's cryptographic random number generator, the same source used for security keys, and the batch is checked so no code appears twice. That makes codes hard to guess, provided they are long enough for the size of the batch.

Why leave out 0, O, 1, I and L?

On printed cards and receipts they are easy to confuse, so customers type the wrong code and the discount fails at checkout. Leaving them out costs very little in the number of possible codes and saves support emails.

How long should a discount code be?

Long enough that codes cannot be guessed from one another, short enough to type comfortably. For small batches handed out in person, six random characters after a short prefix is usually plenty. For large or high-value campaigns, use eight or more.

Where your data goes

Codes are generated in your browser and never sent anywhere, so nobody else sees them before you load them into your shop.

Checked against the tool on

Top