How does credit card number validation work?
A credit card number is valid in format when its digits pass the Luhn algorithm, a checksum that catches most typing mistakes, and when its length and prefix match a card network such as Visa, Mastercard, American Express, Elo or Hipercard. This validator performs both checks instantly in your browser and lists official sandbox card numbers from payment providers for testing checkout flows. It cannot tell whether a card is real, active or has funds.
How to validate a credit card number
- 1
Type or paste a card number. Spaces and dashes are ignored.
- 2
Read the Luhn result, the detected brand and whether the length matches that brand.
- 3
For development, pick a number from the test cards table and press Check or Copy.
- 4
Use only test numbers in your software; never enter a real card number on a site you do not trust.
Key features
Luhn checksum
Verifies the check digit defined in ISO/IEC 7812, which detects any single wrong digit and most swapped digits.
Brand detection
Recognizes Visa, Mastercard, American Express, Discover, Diners Club, JCB, UnionPay, Maestro, Mir and the Brazilian brands Elo and Hipercard from the leading digits.
Official test numbers
A reference list of sandbox card numbers published in the documentation of Stripe, PayPal/Braintree, Adyen and Mercado Pago for QA and development.
Runs locally
The number is never stored or transmitted. Validation uses only math on your device.
Frequently asked questions
What is the Luhn algorithm?
The Luhn algorithm doubles every second digit from the right, adds all digits and checks that the total is divisible by 10. It detects typing errors but offers no security, because anyone can produce numbers that pass it.
Does a valid result mean the card is real?
No. This tool only checks that the number is well formed. It cannot know whether the card exists, is active, has funds or belongs to someone.
How can I tell the card brand from the number?
The first digits identify the network: Visa starts with 4, Mastercard with 51–55 or 2221–2720, American Express with 34 or 37 and Discover with 6011 or 65. Elo and Hipercard use specific six-digit ranges.
Which card numbers can I use to test payments?
Use the sandbox numbers from your payment provider, such as 4242 4242 4242 4242 for Stripe test mode. They work only in test environments and any future expiry date and any CVC are normally accepted.
Does this tool generate card numbers?
No. It does not generate card numbers. The table only lists the public test numbers that payment providers document for developers.