Test Credit Card Generator

Runs in browser Test Data

Numbers pass Luhn validation and start with prefixes from well-known published test card numbers, followed by random digits, for payment-form and validation tests. For sandbox payments, use your gateway's own test cards. All generated values are synthetic TEST DATA ONLY and do not belong to real people. Never use real card data in tests.

TEST DATA ONLY — all generated names, contacts, identifiers and numbers are synthetic and do not belong to real people or accounts.
Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

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.

A 15-digit Amex test number is a published test-card prefix, random digits and one Luhn check digit: validators accept it, yet it is no specific gateway test card.

number from the example

Part 1:371449Part 2:98821723Part 3:8

  1. 1PrefixThe first 6 digits of a well-known published test card (3714 49…).From a test card
  2. 2Random digits8 digits, so the tool cannot guarantee the number was never issued.Random
  3. 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

  1. Pick a brand or Mixed.
  2. Enable expired or invalid cards if your tests need failures.
  3. Set the count and format and press Generate.
  4. 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: 1

Output:

{
  "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.

Luhn on the example: from the right, every second digit is doubled, starting left of the check digit; 9 comes off results above 9. The sum is 72, so the check digit is 8.

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 RegistrySWIFTThe official register of national IBAN formats (length, structure and check-digit rules per country), maintained under ISO 13616.
  • Personal Data Protection Law (English translation)Saudi Data & AI Authority (SDAIA) · 2023The Saudi law governing personal data — why test environments should use synthetic data rather than copies of real customer records.