Checking a number
Pick or type a test number
Tap one of the common test numbers in the table, or paste one from your payment provider's testing documentation. Spaces are ignored.
Read the format check
Passes means the length suits the network and the Luhn checksum is right. Fails means one of those is wrong.
Look at the detail
The network, the Luhn result and the length are shown separately, so you can see which part failed.
Use it to test your form
If your own form rejects a number that passes here, or accepts one that fails, your validation needs another look.
Example: testing a booking form's card field
A developer building an online booking form for a salon wants to check its card field handles good and bad input. She takes a Visa debit test number from her payment provider's documentation, which passes: Visa, Luhn correct, 16 digits.
She then changes the last digit from 6 to 7 to simulate a typing mistake. The network is still Visa and the length is still fine, but the Luhn checksum is now wrong, so the format check fails. Her form should catch the same mistake before it reaches the payment provider.
4000 0566 5566 5556 4000 0566 5566 5557
Passes: Visa, Luhn checksum correct, 16 digits (OK) Fails: Visa, Luhn checksum wrong, 16 digits (OK)
What the Luhn check does
The Luhn algorithm is a simple checksum built into card numbers. Starting from the right, every second digit is doubled, digits over 9 have 9 taken off, and everything is added up. A valid number gives a total that divides exactly by 10. It catches most single-digit typing errors and swapped neighbouring digits.
Passing the check only means the number is well formed. Whether a card exists, is in date or can pay is something only the card network and issuer can say, through a real payment request.
Questions people ask
Can this tell me if a card is real or has funds?
No. It only checks the format: the network prefix, the length and the Luhn checksum. Real validity, expiry and available funds can only be confirmed by the card issuer through a genuine payment authorisation, which no format checker can do.
What is the Luhn algorithm?
A checksum formula used in card numbers. Every second digit from the right is doubled, nine is subtracted from any result above nine, and all digits are summed. If the total ends in zero the number passes. It is designed to catch accidental typing errors, not fraud.
How does it know the card network?
From the first few digits, known as the issuer identification number. For example, numbers starting with 4 are Visa, and 34 or 37 are American Express. The tool also checks that the length matches what that network uses, such as 15 digits for American Express.
Where do I get test card numbers?
From your payment provider's testing documentation. Providers publish numbers that pass format checks but cannot be charged, often with variations to simulate declines. The table under the tool lists four widely published examples for Visa, Mastercard, American Express and Discover.
Where your data goes
The number you type is checked by script on this page and is not transmitted or saved. Even so, only use published test numbers here, never a real card.
Checked against the tool on