How are test IBANs and card numbers generated?
An IBAN follows a per-country structure from the SWIFT registry (SA: 24 characters, two check digits computed mod 97), and a card number passes the Luhn check digit and starts with a real issuer range. Test values are generated to satisfy exactly those rules — so validators accept them — while their account and card digits are random rather than copied from a real account or card.
number from the example
Part 1:371449Part 2:98821723Part 3:8
- 1PrefixThe first 6 digits of a well-known published test card (3714 49…).From a test card
- 2Random digits8 digits, so the tool cannot guarantee the number was never issued.Random
- 3Check digitChosen by the Luhn check so the number is Luhn-valid.Computed
The tool also returns the Amex number grouped 4-6-5, as formatted: 3714 499882 17238.
How to use Test Credit Card Generator
- Pick a brand or Mixed.
- Enable expired or invalid cards if your tests need failures.
- Set the count and format and press Generate.
- Use the numbers for payment-form and validation tests only; for sandbox payments use the test cards documented by your gateway.
Test Credit Card Generator features
- Visa, Mastercard, American Express, Discover, JCB, Diners Club, UnionPay and a Mada-style prefix
- Prefixes from well-known published test cards (4111 11…, 5555 55…, 3714 49…, 6011 11…) followed by random digits — for form and validation tests, not live payments
- Luhn-valid numbers with brand-specific lengths and CVV sizes
- Expiry dates in the future, or expired cards for negative tests
- Optional Luhn-invalid rows, flagged in a column
- Card holder names in English, Arabic or Hindi with an uppercase Latin holder line
- Formatted and masked variants for display tests
Test Credit Card Generator example
Amex test card
Input:
Brand: American Express · Cards: 1Output:
{
"brand": "American Express",
"number": "371449988217238",
"formatted": "3714 499882 17238",
"masked": "**** **** ***7 238",
"expiry": "01/28",
"cvv": "3200",
"holder": "LUCY FISHER",
"luhnValid": true
}Frequently asked questions about Test Credit Card Generator
Can these cards be charged?
They are not meant to be. The prefixes come from well-known published test card numbers (4111 11…, 5555 55…, 3714 49…, 6011 11…, 3530 11…), but the remaining digits are random, so a number is neither a specific gateway test card nor guaranteed never to have been issued. Use them for form and validation tests, use the test cards documented by your gateway for sandbox payments, and never submit them to a live gateway.
Do the numbers pass the Luhn check?
Yes, every generated number is Luhn-valid unless you enable "Luhn-invalid numbers" for negative tests, in which case every fourth row fails and is flagged.
What is the Mada-style option?
A 16-digit number starting with 400000 or 440000, shaped like a Saudi mada card for local payment-form tests. The prefix is not taken from a published mada BIN list, and the number is generated at random rather than issued by a bank.
Which brands and lengths are covered?
Visa (16), Mastercard (16), American Express (15, 4-digit CVV), Discover (16), JCB (16), Diners Club (14), UnionPay (16) and Mada-style (16), each with expiry and CVV.
Technical notes
The Luhn check digit is computed by doubling every second digit from the right, subtracting 9 from results above 9 and choosing the digit that makes the total divisible by 10. Only the prefix comes from published test card numbers and the rest is random, so the tool cannot guarantee that a number was never issued: keep the numbers away from live gateways and use the test cards documented by your payment provider for sandbox payments.
371449988217238 from the example, digit by digit
Digit
371449988217238
Doubled
14 8 18 16 4 14 6
Added to the sum (minus 9 above 9)
35184997841526
Sum, then the check digit
Σ = 72 8
With the check digit, the total is 72 + 8 = 80, a multiple of 10, so the whole number passes the Luhn check.
References
- IBAN RegistryThe official register of national IBAN formats (length, structure and check-digit rules per country), maintained under ISO 13616.
- Personal Data Protection Law (English translation)The Saudi law governing personal data — why test environments should use synthetic data rather than copies of real customer records.