User Rating 0.0
Total Usage 0 times
Generate between 1 and 50 cards

Select a network and click Generate

Is this tool helpful?

Your feedback helps us improve.

About

Payment gateway integration requires valid test card numbers that pass automated checksum verification. Using arbitrary digit strings causes silent failures in Stripe, PayPal, and Braintree sandboxes, wasting debugging hours on data that was invalid from the start. This generator produces syntactically correct Primary Account Numbers (PANs) by implementing the ISO/IEC 7812 standard: correct Issuer Identification Number (IIN) prefixes per network, proper length constraints (15 digits for AmEx, 16 for others), and a mathematically valid check digit computed via the Luhn Mod-10 algorithm. Every generated number will pass any checksum validator. The accompanying expiry dates, CVVs, and cardholder names are structurally realistic but entirely fictional.

These numbers cannot be used for real transactions. No bank account is linked. No issuer has allocated these PANs. The tool exists solely for software testing, form validation development, and educational demonstration of how payment card numbering works. Note: some gateways maintain internal blocklists of known test prefixes. If a generated number is rejected in a sandbox, try a different IIN range within the same network.

credit card generator luhn algorithm test credit card dummy card number fake credit card mod10 checksum card number validator

Formulas

Every generated PAN must satisfy the Luhn algorithm (ISO/IEC 7812-1). The check digit d0 is computed so the full number passes this test:

ni=0 f(di, i) 0 (mod 10)

where the transformation function f operates on each digit di (indexed from the rightmost digit, i = 0):

f(d, i) = {
d if i is even2d 9 if 2d > 9, else 2d

The generator works in reverse: it fills positions dn through d1 with the IIN prefix followed by random digits, then computes d0 as:

d0 = (10 (ni=1 f(di, i) mod 10)) mod 10

Where di = digit at position i from the right, n = total number of digits (15 or 16), d0 = check digit (rightmost), and f = Luhn doubling function.

Reference Data

Card NetworkIIN / BIN Prefix(es)PAN LengthCVV DigitsMarket Share (2024)ISO Standard
Visa4163~39%ISO/IEC 7812
MasterCard51 - 55, 2221 - 2720163~24%ISO/IEC 7812
American Express34, 37154~11%ISO/IEC 7812
Discover6011, 644 - 649, 65163~9%ISO/IEC 7812
JCB3528 - 3589163~3%ISO/IEC 7812
Diners Club Intl.3614 - 193<1%ISO/IEC 7812
UnionPay6216 - 193~45% (China)ISO/IEC 7812
Maestro (legacy)5018, 5020, 503812 - 193Discontinued 2023ISO/IEC 7812
RuPay60, 65, 81, 82163~60% (India)ISO/IEC 7812
Elo636368, 438935163~25% (Brazil)ISO/IEC 7812
Luhn Check DigitApplied to ALL networks. Sum of alternating doubled digits 0 (mod 10)
IIN RangeFirst 6 - 8 digits identify issuer. Remaining digits are account number + check digit.

Frequently Asked Questions

No. These numbers satisfy the Luhn checksum but are not linked to any bank account or credit line. They will be rejected by any payment processor during the authorization step. The IIN prefixes used are structurally valid but the account numbers are randomly generated, meaning no issuing bank has allocated them. They are strictly for testing form validation, sandbox environments, and educational purposes.
The Luhn algorithm catches all single-digit errors and most transposition errors. It works by doubling every second digit from the right, subtracting 9 if the result exceeds 9, then summing all digits. If the total is divisible by 10, the number is valid. This means changing any single digit will break the checksum. It catches approximately 95% of random input errors but cannot detect all permutations - for example, swapping 09 with 90 passes undetected.
American Express adopted its 15-digit format in the 1950s before the ISO/IEC 7812 standard fully converged on 16 digits. AmEx uses a 2-digit IIN prefix (34 or 37), a shorter account number field, and a 4-digit CVV (called CID) instead of the standard 3-digit CVV. Visa, MasterCard, Discover, and JCB all use 16-digit PANs per the modern standard. The ISO specification allows lengths from 8 to 19 digits, but 16 became the de facto standard.
PAN (Primary Account Number) is the full card number. IIN (Issuer Identification Number) is the first 6-8 digits that identify the card network and issuing bank - it was formerly called BIN (Bank Identification Number). The remaining digits before the check digit form the individual account identifier. ISO updated the terminology from BIN to IIN in 2017, extending the prefix from 6 to 8 digits to accommodate growing demand.
Payment sandboxes typically maintain whitelists of specific test numbers (e.g., Stripe accepts 4242 4242 4242 4242). Numbers from this generator pass Luhn validation but may not be on those whitelists. They are most useful for testing your own form validation logic, regex patterns, and client-side checksum verification before data reaches the payment API. For gateway-specific sandbox testing, consult the provider's documentation for their designated test numbers.
CVV values are generated as random 3-digit numbers (100-999) for Visa, MasterCard, Discover, and JCB. American Express uses a 4-digit CID (1000-9999). Expiry dates are generated as random future dates between 1 and 5 years from the current month. Real CVVs are derived cryptographically from the PAN and expiry using the issuer's secret DES keys - our generated CVVs are purely random since no issuer key exists for these test numbers.