Credit Card Generator (Test Only)
This tool generates credit card numbers that satisfy the Luhn (mod-10) check for Visa, Mastercard, American Express, Discover, and JCB. It produces random but structurally correct numbers — including the right length, IIN (issuer identification number) prefix, and a correctly-calculated Luhn check digit — alongside a matching random expiry, CVV and cardholder name.
TEST ONLY — READ THIS
These numbers are NOT real credit cards. They are not linked to any bank, account, or payment processor. They exist solely for development and QA. Attempting to use a generated number for a real transaction will fail and may be fraud.
Using any credit card number you did not receive from a real issuer to purchase goods, services, or subscriptions is illegal in most jurisdictions. Don't.
What it's actually useful for
- Client-side form validation — build and test UI that checks card length and Luhn.
- Design mockups — show realistic-looking card numbers in screenshots without exposing real card data.
- Unit & integration tests — seed test databases with valid-shape card numbers.
- Teaching materials — demonstrate the Luhn algorithm with real-looking data.
- Payment gateway sandboxes — some sandboxes accept Luhn-valid numbers for smoke tests (many also require specific documented test numbers — check your provider).
How the generation works
- A brand-specific IIN prefix is chosen (e.g.
4for Visa,51–55or2221–2720for Mastercard,34/37for Amex,6011/65for Discover,3528–3589for JCB). - Random body digits are appended up to
total length − 1. - The Luhn check digit is computed and appended.
- Output is formatted with brand-appropriate spacing (
4-4-4-4for most brands,4-6-5for Amex).
Brands & lengths
| Brand | Prefixes | Length |
|---|---|---|
| Visa | 4 | 16 |
| Mastercard | 51-55 / 2221-2720 | 16 |
| American Express | 34, 37 | 15 |
| Discover | 6011, 65 | 16 |
| JCB | 3528-3589 | 16 |
Again: use these numbers only in development environments. Never attempt a real purchase with a generated card.
Tiny Online Tools







