Coupon Code Generator
Set a seed, length and count to generate coupon codes.
Result
How it is calculated
Nothing here is random in the usual sense. For code number i the tool starts a small linear congruential generator from crc32(seed + "#" + i), discards its first value, then draws length characters from the 32-character alphabet ABCDEFGHJKLMNPQRSTUVWXYZ23456789, which leaves out 0, 1, I and O so hand-typed codes are not misread. The optional prefix is put in front of each code and is not counted in the length. Because every code depends only on the seed and its position, the same seed, length and count always give the same list, and asking for 4 codes returns the first 3 unchanged plus one more. A code that would repeat one already in the list is drawn again, so a batch has no repeats unless the length is too short to hold it: 1 character gives only 32 different codes. Length is capped at 64 and count at 1000. With 8 characters there are 328, about 1.1 trillion, possible codes, but the generator is predictable and is not meant for security.
Worked example
Seed SUMMER, length 8, count 3 and prefix SAVE-. Code 0 is seeded from crc32("SUMMER#0"), code 1 from crc32("SUMMER#1") and code 2 from crc32("SUMMER#2"). Eight characters are drawn for each and the prefix is added. The output is:SAVE-MH9NZYE3SAVE-76RDD6FGSAVE-ZHEUPTC9
The tool also states 3 codes and 8 chars. Running it again with the same inputs gives exactly these codes, and a count of 4 adds SAVE-E772LTZC at the end.
Common mistakes
- Treating the codes as secret: anyone who knows or guesses the seed, length and count can regenerate every code, so these are labels for tracking, not protection against guessing.
- Reusing the same seed for two campaigns; the lists are identical, so give each campaign its own seed.
- Expecting the length to include the prefix: SAVE- is added on top of the 8 characters, so each full code is 13 characters long.
- Looking for 0, 1, I or O in a code, or typing them by hand into a validation list; they are never produced, so a code containing them did not come from this tool.
- Requesting more than 1000 codes or a length above 64 and expecting the full amount; both values are cut to those limits without a warning.
About this calculator
This generator produces a batch of codes deterministically from a text seed — the same seed, length, and count will always reproduce the exact same codes, which is useful for regenerating a lost batch or reconciling codes across systems. Characters are drawn from an unambiguous set that excludes easily confused pairs like 0/O and 1/I/l, so customers typing a code by hand are less likely to mistype it.
E-commerce marketers, growth teams, and loyalty-program managers use it to create batches of promo, discount, or gift codes with an optional shared prefix (e.g. SAVE- or SUMMER-) for campaign tracking, without needing a backend service to generate and store random strings.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Length decides how many codes a batch can hold. Repeats inside a batch are drawn again, so 1,000 codes at length 2 all come out different, but 1 character offers only 32 codes and a larger batch must repeat. Short codes are also easy to hit by guessing, so for a real campaign use at least 6 characters and keep the generated list for validation. Which promotion format are you building, and how many codes do you need?