Numbers
Custom Format Code Generator
Used by developers, writers, and creators worldwide.
The custom format code generator lets you build random codes in any pattern you define — paste in a structure like AAA-#### or PROMO-****-**** and get a clean batch in seconds. Type # for a digit, A for a letter, or * for either; everything else passes through as a literal, so dashes, dots, and fixed prefixes stay exactly where you put them. You control three inputs: the pattern, how many codes to produce (up to 100 per run), and whether letters come out uppercase, lowercase, or mixed. Uppercase is easier to read aloud from a printed receipt; lowercase fits cleaner in URLs. A four-letter, four-digit pattern like AAAA-#### already yields over 45 million combinations, which covers most voucher and serial-number campaigns without a script.
Loading usage…
Free forever — no account required
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Type your desired pattern into the Pattern field using # for digits, A for letters, and * for either — keep any separators like dashes or slashes exactly as you want them to appear.
- Set the count field to the number of codes you need, up to 100 per run.
- Choose Uppercase, Lowercase, or Mixed from the Letter Case dropdown to control how letter placeholders are rendered.
- Click Generate to produce the full list of codes instantly.
- Select all generated codes, copy them, and paste directly into your spreadsheet, email tool, or database.
Use Cases
- •Generating 100 uppercase discount codes like SAVE-A4X9 for a Shopify flash sale
- •Producing booking references in format BK-AAA-#### for an event ticketing platform
- •Creating license keys in AAAA-####-AAAA-#### format for a software product launch
- •Seeding a Postgres staging database with realistic mock user IDs in a fixed schema
- •Building alphanumeric referral codes in mixed case for a WooCommerce affiliate campaign
Tips
- →Prefix your codes with a campaign tag like SUMMER-*** so you can identify the source without a database lookup.
- →Avoid patterns shorter than six placeholders for any public-facing code — short patterns are easy to guess by brute force.
- →Use the * wildcard instead of all A or all # when you want codes that feel more random and less like a simple number sequence.
- →For phone-number-shaped test data, use a pattern like (###) ###-#### — the punctuation is preserved automatically without any extra steps.
- →When creating codes for printed materials, set Letter Case to Uppercase and avoid the * wildcard to prevent visually confusing characters like 0 vs O appearing together.
- →Generate a batch of 100, paste into Excel or Google Sheets, and use the COUNTIF function on the column to catch any duplicates before distributing.
FAQ
how do I create a voucher code with a fixed prefix like PROMO-
Type the prefix directly into the pattern field, for example PROMO-####-AAAA. Any character that isn't #, A, or * is treated as a literal and appears in every code. Set letter case to Uppercase if you want the letter segments capitalised.
what's the difference between # A and * in the pattern
# outputs a random digit (0–9), A outputs a random letter, and * outputs either with equal probability. Use * when you want maximum entropy at a position and don't care about character type — useful for short codes where every extra combination counts.
are the generated codes guaranteed unique
Uniqueness is not enforced, so duplicates are theoretically possible. For high-stakes uses like paid vouchers, paste the batch into a spreadsheet and run a duplicate check before distributing. Longer patterns with more placeholders make collisions statistically rare.