Free Developer Tool

Credit Card Generator

Generate Luhn-valid test card numbers for Visa, Mastercard, JCB, American Express, UnionPay, Discover, and Diners Club — or from a custom BIN. Built for payment engineers and QA. For testing only; these are not real cards.

No numbers yet. Fill the form above and click Generate.

Built for payment testing

Every generated number is structurally valid: correct length, correct IIN prefix for the chosen scheme, and a valid Luhn check digit. That makes them drop-in replacements for real cards when you're testing client-side validation, card-brand detection from BIN, PAN formatting in checkout forms, or anywhere your code needs a well-formed card number without the compliance overhead of using a real one.

They are not real cards. They will be declined by any live processor and will not work in gateway sandboxes that publish their own fixed test numbers (Stripe, Adyen, Braintree, etc.).

Supported card schemes

Seven of the most commonly tested networks. Prefix and length follow the ISO/IEC 7812 assignments published by each issuer.

SchemeIIN prefixLengthGrouping
Visa416 digits4-4-4-4
Mastercard51–55, 2221–272016 digits4-4-4-4
JCB3528–358916 digits4-4-4-4
American Express34, 3715 digits4-6-5
UnionPay6216 digits4-4-4-4
Discover6011, 644–649, 6516 digits4-4-4-4
Diners Club30, 36, 38, 3914 digits4-6-4

Frequently asked questions

What is a Luhn-valid credit card number?
The Luhn algorithm is a mod-10 checksum that every major card network uses to catch typos in a card number. A Luhn-valid number passes this checksum but says nothing about whether the underlying account actually exists. Every number this tool produces is Luhn-valid.
Are these real credit cards? Can they be charged?
No. The numbers are structurally correct — right length, right IIN prefix for each scheme, valid Luhn check digit — but the accounts they describe are not issued by any bank. They cannot be charged and will be declined by any real payment processor.
Will these work in the Stripe, Adyen, or Braintree sandbox?
Usually no. Sandbox gateways publish their own fixed test numbers (Stripe's 4242 4242 4242 4242, for example) and only those produce successful authorizations. Use this generator to exercise your own validation, formatting, and BIN-detection logic — not to hit a sandbox gateway.
What's the difference between random mode and BIN mode?
Random mode picks a prefix valid for the scheme you select and fills the rest. BIN mode takes a specific 6- or 8-digit BIN (Bank Identification Number) and generates numbers that start with that exact prefix — useful when you want to test how your code handles a particular issuer or co-branded card range.
Which card schemes are supported?
Visa (prefix 4, 16 digits), Mastercard (51–55 or 2221–2720, 16 digits), JCB (3528–3589, 16 digits), American Express (34 or 37, 15 digits), UnionPay (62, 16 digits), Discover (6011, 644–649, 65; 16 digits), and Diners Club International (30, 36, 38, 39; 14 digits).
Is anything stored or sent to a server?
No. The tool is frontend-only — there is no backend, no database, no analytics on the numbers you generate. Everything runs in your browser and the page works offline after it has loaded.
Can I use this to test card-brand detection?
Yes — that's a common use case. Generate a batch per scheme in Random mode (or per BIN in BIN mode) and feed the numbers into the code that infers brand from prefix. Because the numbers are Luhn-valid, they also exercise any downstream checksum validation in the same call.