Test credit card numbers

Generate fake card numbers that pass the Luhn check, for testing payment forms, validators and software under development.

⚠️ These numbers are FAKE: they do not belong to real cards, have no account behind them and can NOT be used for any payment. They are meant for developers and testers only. Using someone else's real card numbers is a crime.
    🔒 Everything is generated in your browser: nothing is saved or sent anywhere.

    How the Luhn algorithm works

    A card number isn't random: its last digit is a "check digit" computed with the Luhn algorithm (1954). Working from right to left, you double every second digit; whenever a doubled digit exceeds 9 you subtract 9; then you add everything up. The number is formally valid only if the total is a multiple of 10. This is the very same check that payment forms run before ever contacting the bank, so obvious typos get caught instantly.

    What test numbers are (and aren't) good for

    Anyone building an e-commerce checkout needs numbers that pass Luhn validation to test forms, input masks and error messages without touching a real card. This generator uses the typical network prefixes (4 for VISA, 5 for Mastercard, 34/37 for Amex) and computes the correct check digit, but the result is still a made-up number: passing Luhn doesn't mean the card exists. Any real transaction would be declined by the network, because the actual verification happens on the banking systems, together with the expiration date, CVV and 3-D Secure. For sandbox payments, use the official test cards from your payment provider (for example Stripe or PayPal).