Generate single or bulk unique promo codes — brand-prefixed, collision-safe, with CSV export. Securely in your browser.
This free discount code generator builds one code or a whole batch of unique, non-guessable promo codes right in your browser — for sitewide sales, influencer drops, gift cards, and giveaways. Add a brand prefix, pick the random length and character set, exclude look-alike characters, and export a clean CSV ready to import into Shopify, WooCommerce, BigCommerce and more. Codes are generated with your device's cryptographic random generator; nothing is sent anywhere or stored.
SUMMER) and/or a suffix (e.g. -2026).You ask for 1,000 codes, prefix SUMMER, random length 6, character set
A–Z + 0–9 with ambiguous characters excluded. Excluding 0, O, 1, I, L from the
36-character upper+digit set leaves an alphabet size of N = 31. The keyspace is
K = 316 = 887,503,681 possible random parts (about 887.5 million). Entropy is
6 × log2(31) = 29.7 bits. Pre-dedup, the expected number of duplicates across the batch is
E = 1000 × 999 / (2 × K) ≈ 0.000563, and the chance of any collision is
P = 1 − e−0.000563 ≈ 0.0563%. Because the tool deduplicates into a Set, the
delivered 1,000 codes are unique by construction — you get codes like SUMMER-7K9F2Q.
The alphabet size (N) is how many distinct characters your random part can use after exclusions. Keyspace (K = NL) is the total number of possible random parts. Entropy (L × log2(N)) is a guessability indicator: Weak below 25 bits, Okay 25 to under 30, Strong 30 and above. The collision figures use the birthday-problem approximation and are advisory only.
Don't use a spreadsheet's RANDBETWEEN/CONCAT — it recalculates (codes change) on every edit, has no real dedup,
and is biased toward certain characters. Don't rely on mixed case for strength on case-insensitive platforms like Shopify.
Keep total length under ~12 characters (dash it if longer) to cut typing errors, and remember collision risk scales with the
square of the batch size — doubling the codes quadruples the collision risk, so use 6+ random characters for bulk runs.
Finally, always set per-code and per-customer usage limits in your store: even unique, high-entropy codes get
screenshotted and shared if redemption isn't capped.
Uniqueness: guaranteed only within ONE generation run in this browser session. Importing multiple batches into the same store can still collide — dedup across your full code list at import time.
Collision math: E and P use the birthday-problem approximation P = 1 − exp(−n(n−1)/2K), accurate when n is much smaller than K. Near saturation it understates risk, but the Set-based dedup makes the delivered batch exactly unique regardless.
Entropy: a guessability indicator, not a cryptographic guarantee. Promo codes are not passwords — pair high entropy with platform usage limits.
Case sensitivity: most platforms (e.g. Shopify) are case-insensitive on redemption, so mixed-case "strength" is illusory there. Prefer uppercase + digits.
Randomness: uses the browser's crypto.getRandomValues (a CSPRNG) with rejection sampling to avoid modulo bias — not Math.random.
No business rules: the tool does not set discount value, expiry, usage limits, or product scope, and does not check against your existing store codes. Set those in your platform on import.
No persistence: 100% client-side, no account, nothing logged or stored.
Within a single run, yes — each random part goes into a Set and any duplicate is regenerated until the requested quantity of distinct codes is reached. The collision odds shown are advisory (the risk had dedup not run). Codes from separate runs are NOT checked against each other; dedup your full list at import time.
Every character is drawn from crypto.getRandomValues (a CSPRNG) with rejection sampling to avoid modulo bias. Math.random is predictable and intentionally not used. Everything is client-side — no network call, no account, nothing stored.
Look-alikes cause mis-entry, especially on mobile and when read aloud in videos. Excluding them slightly shrinks the alphabet but sharply cuts failed redemptions and support tickets. It's on by default.
Entropy (L × log2(N)) estimates how hard the random part is to guess. 30+ bits is strong for promo use. It's a guessability indicator, not a cryptographic guarantee — pair it with platform usage limits.
Most platforms (e.g. Shopify) treat codes as case-insensitive on redemption, so mixed-case strength is illusory there. Entropy is computed on the literal alphabet you choose, so prefer uppercase + digits.
Yes — Download CSV gives a UTF-8, RFC-4180 quoted file with code, discount_value, prefix, length and generated_at columns. Set discount rules (value, expiry, limits, scope) in your platform on import. The tool doesn't check codes against your existing store inventory.
Generated entirely in your browser. Nothing is sent, stored, or logged. No account needed.