Test Credit Card Generator
Generate valid test credit card numbers for development. Visa, Mastercard, Amex, Discover. Luhn-valid numbers for payment testing. Free fake card generator
A "fake" credit card number for testing has a specific meaning: it passes structural validation (Luhn checksum, correct prefix for the card brand) but is not actually issued to any real account. This generator produces structurally-valid Visa, Mastercard, Amex, Discover, and JCB test numbers — for testing payment forms, schema validation, and integration without touching real cards. For end-to-end payment-processor testing, use the processor's OFFICIAL test cards (Stripe, Adyen, Braintree publish them) — those are integrated with the gateway test environment.
How card numbers are structured
- Issuer Identification Number (IIN, first 6 digits) — identifies the issuer. Visa: 4xxx. Mastercard: 51-55 or 2221-2720. Amex: 34 or 37. Discover: 6011 or 65. JCB: 35.
- Account number (digits 7 through 15 for 16-digit cards) — individual account identifier.
- Check digit (last digit) — computed via Luhn algorithm. Detects most single-digit typos.
- Length — 16 digits for most (Visa, MC, Discover, JCB); 15 for Amex; 13 or 19 for some legacy or extended formats.
- The Luhn check: double every other digit from right (skipping the check digit itself), sum digits of each result, add to non-doubled digits, total must be a multiple of 10.
Working example
Input
Generate: 1 Visa test card
Output
Card number: 4111 1111 1111 1111
Luhn valid: ✓ (the famous "Visa test number")
IIN: 411111 (in real life, Citibank Visa)
Length: 16 ✓
Expiry: 12/27
CVV: 123
Name: TEST USER
IMPORTANT:
- This is a STRUCTURALLY valid card number.
- It does NOT work for payment processing — gateways reject it because
no account is bound to it.
- For end-to-end payment testing, use Stripe's test card:
4242 4242 4242 4242
or Adyen's, Braintree's, etc. Those go through the test environment
where charges succeed without real money.
- For SCA testing (3D Secure), specific cards trigger challenge flows:
Stripe: 4000 0027 6000 3184Random generation can accidentally produce numbers that match real cards. For testing form validation, structurally-valid is fine. For testing payment flow end-to-end, ALWAYS use processor-published test cards — they are in the test database and behave correctly.
When and how to use these numbers
- Form validation — does your input accept 16-digit numbers? Does it format with spaces? Does it reject letters? Use these.
- Database / schema testing — does your schema correctly store credit card data (without storing CVV)? Use these.
- UI integration tests (Cypress, Playwright) — fill in checkout form, see if validation passes. Use these.
- Backend Luhn validation tests — does your validator accept and reject correctly? Use these.
- End-to-end payment tests — use the payment processor's official test cards (Stripe, Adyen, etc.), not random fakes. Those are in the test environment.
- Anywhere money actually changes hands — use real cards or test cards in the test environment, never random fakes.
What this tool absolutely will not do
- These cards do NOT charge real cards. They are not "free money" — payment gateways reject them in production because no account binding exists.
- Attempting to use these on real merchants is fraud. Penalties under EU Payment Services Directive and US 18 USC 1029 include prison time. Do not use in any production context, even briefly.
- These numbers are NOT for any "testing your bank account" use. Banks do not "test" your account number this way; do not believe any social engineering that claims otherwise.
Generated cards are for development testing in your own systems — testing form validation, Luhn algorithm, payment-flow scaffolding. They never touch a payment network.
Frequently asked questions
Why doesn't this work to pay for something online?
Payment gateways check the number against bank records, not just the Luhn algorithm. The bank says "no account exists for this number" → transaction declined. Fraud detection systems flag the attempt. Persistent attempts lead to your IP being blocked.
What is the difference between "test card" and "fake card"?
"Test card" = a card number registered in the payment processor's test environment that behaves correctly (Stripe: 4242 4242 4242 4242 succeeds). "Fake card" = any structurally-valid number not registered anywhere; gateways reject. Always use test cards for E2E payment testing.
How does the Luhn algorithm work?
Multiply every other digit from right by 2 (skipping check digit). For each result, if >9, sum its digits (12 → 1+2=3). Sum all results plus the non-doubled digits. The check digit is whatever makes the total a multiple of 10.
What test cards do common processors use?
Stripe: 4242 4242 4242 4242 (Visa success), 4000 0000 0000 0002 (decline), 4000 0027 6000 3184 (3DS challenge). Adyen: 4111 1111 1111 1111. PayPal: 4032 0341 9111 0036. Each processor has comprehensive test card pages — bookmark them.
Is generating fake credit cards legal?
Generating random Luhn-valid numbers for legitimate testing: yes. Using them to make a transaction or impersonate a real cardholder: criminal fraud in nearly every jurisdiction (US 18 USC 1029, EU Cybercrime Convention Art. 7).
Why is CVV 3 digits for most cards but 4 for Amex?
Historical decision. Amex (American Express) chose 4-digit CID (Card Identification Number) printed on the front of the card; Visa/MC chose 3-digit CVV2 printed on the back. Both serve the same anti-fraud purpose; the format difference is brand-specific convention.
Related tools
Generate fake names, emails, addresses, phone numbers for testing. Create realistic test data in JSON/CSV. Free mock data generator online
Validate International Bank Account Numbers (IBAN). Check format, country, checksum. Identify bank from IBAN. Support for 80+ countries
Validate Polish NIP (tax ID) and PESEL (personal ID) numbers. Extract birth date, gender, and age from PESEL. Check NIP checksum. Free online validator
Create professional PDF invoices with logo, line items, taxes, and totals. Free online invoice maker, no registration required. Export to PDF instantly
Decode Vehicle Identification Numbers (VIN). Find manufacturer, country, model year, plant code, serial number. Free online VIN lookup and validator
Last updated · E-Utils editorial team