Coupon Code Generator
BetaMake a batch of unique coupon codes from your own pattern: a prefix, a length, a character set and groups. Copy them or download a CSV for your shop.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
PatternEvery code is the prefix plus random characters, split into groups.
Optional. Added to the front of every code.
The letters and digits codes are drawn from
Characters after the prefix, 1 to 32
0 keeps the code in one piece
Placed between groups
Up to 10,000 per batch
PatternXXXX-XXXX
This pattern allows 852,891,037,441 different codes (31⁸: 31 characters, length 8).
Codes
Set the pattern and press Generate.
On this page, the codes are made in your browser and are not uploaded.
How the pattern works
Prefix and groups
The prefix goes first and is never split. The random part is cut into groups of the size you choose, joined by the separator.
Look-alike characters
With the toggle on, 0, O, 1, I and L are left out, so a code read aloud or typed from a receipt is not mistaken for another.
Combinations
The number of different codes is the size of the character set to the power of the length. Ask for more than that and the tool says so.
How to generate coupon codes
-
Set the pattern
Type a prefix if you want one, choose the character set, the code length and the group size. Keep No look-alike characters on for codes people will type. -
Choose how many
Enter how many codes to make, up to 10,000. The line under the pattern shows how many different codes it allows. -
Generate and export
Press Generate codes. Copy all puts every code on your clipboard, one per line, and Download CSV saves them as a file.
Common use cases
Single-use discount codes
Gift cards and vouchers
Event tickets and invitations
Test data
Why use a coupon code generator?
The Coupon Code Generator makes up to 10,000 unique random codes at a time from a pattern you set: an optional prefix, a random part of 1 to 32 characters, a character set (uppercase and digits, uppercase, digits, lowercase and digits, or your own), and optional groups joined by a hyphen, an underscore or a dot. No look-alike characters removes 0, O, 1, I and L so codes are not misread. Random characters come from crypto.getRandomValues with unbiased sampling, and the tool refuses a batch larger than the number of codes the pattern allows.
Copy every code at once or download them as a CSV. On this page, the codes are made in your browser and are not uploaded. The same function is available as the MCP tool coupon_code_generator and on the REST API.
Related tools: make unique identifiers with the UUID Generator, put a code on a flyer with the QR Code Generator or the Barcode Generator, and draw a winner with the Random Picker.
Tips
- Groups of four with a hyphen are easier to read aloud than one long string.
- Keep the prefix short; it is the same in every code, so it adds nothing to how hard a code is to guess.
- Make one batch for each campaign, so the prefix tells you where a code came from.