Test Credit Card Generator

Generate Luhn-valid card numbers for payment testing — clearly fictitious, never usable for real purchases.

For software testing only. The data generated here is random and does not belong to any real person or company. Using it for fraud or in bad faith is a crime.

How to use

  1. Pick a card brand (or leave "Any brand") and click "Generate".
  2. You get a number that passes the Luhn check, plus a clearly fictitious expiry date and CVV for filling test forms.
  3. Use the checker field to test whether any card number passes the Luhn algorithm — everything runs locally.

About this tool

Every payment form validates card numbers with the Luhn algorithm before contacting the payment gateway — it catches typos instantly, without a network round-trip. To test that validation, a developer needs numbers that pass the check without belonging to anyone. That is what this tool generates: mathematically valid sequences built on the public prefix ranges of each brand (4 for Visa, 51–55 for Mastercard, 34/37 for Amex).

A generated number cannot make a purchase. Real transactions are authorized by the card network and the issuing bank, which check whether the card actually exists, is active and has funds — a random Luhn-valid number fails all of that. The expiry date and CVV shown here are random values for form-filling only. For end-to-end payment tests, use the official test cards published by your payment provider (Stripe, Adyen, Cielo and others document theirs).

The checker applies the same Luhn algorithm to any number you paste: it doubles every second digit from the right, subtracts 9 from results above 9, sums everything and verifies the total is a multiple of 10. It is a math check, not a card lookup — a "valid" verdict means well-formed, not real.

The formula

Luhn check: starting from the rightmost digit, double every second digit; if doubling gives more than 9, subtract 9. Sum all digits — the number is valid when the sum is a multiple of 10.

Frequently asked questions

Can a generated card make a real purchase?

No. Real charges are authorized by the card network and the issuing bank, which verify that the card exists and has funds. A random Luhn-valid number is refused at that step.

Why does my checkout accept the number, then?

The front-end only runs the Luhn check to catch typos. Acceptance there just means the format is valid — the real verification happens at the gateway.

Which numbers should I use to test a payment gateway?

The official test cards published by your provider. Those numbers are recognized by the sandbox environment and produce predictable results (approved, declined, 3-DS required).

Are the expiry date and CVV real?

No. They are random values generated only so you can fill required form fields during tests.

Does any of this leave my browser?

No. Generation and the Luhn check run 100% in JavaScript on your device. Nothing is transmitted or stored.

Related tools

Long links? Shorten them for free

Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.

Vai.la is not responsible for how the tools are used or for decisions made based on their results.