Quick answer
A credit card check format is a layout rule for the digits on a payment card. It covers the card number, the expiry date, and the security code. A format check finds typos. It does not prove that an account is open or that a card is valid.
credit card verification scheme
Card number layout
Most card numbers use 16 digits. Some use 13 to 19. The first six to eight digits form the issuer identification number (IIN). The next digits identify the account. The last digit is a check digit.
- Visa: 16 digits, starts with 4.
- Mastercard: 16 digits, starts with 51-55 or 2221-2720.
- American Express: 15 digits, starts with 34 or 37.
- Discover: 16 digits, starts with 6011, 622126-622925, 644-649, or 65.
These prefixes follow ISO/IEC 7812. The standard sets the numbering system for payment cards.
Luhn check digit
The final digit of the card number is a Luhn checksum. The Luhn formula doubles every second digit from the right. It subtracts 9 from any result above 9. It sums all digits. A valid number has a total that ends in 0.
Card Check Routine: How to Verify a Payment Card in 5 Steps
The Luhn check catches single-digit errors and most transpositions. It does not catch every error. A number can pass Luhn and still belong to no account.
Expiry and security code format
Expiry dates use MM/YY. The month is 01 to 12. The year is two digits. Security codes have different lengths by network. Visa, Mastercard, and Discover use a 3-digit CVV2. American Express uses a 4-digit CID.
PCI DSS treats the security code as sensitive authentication data. Merchants must not store it after authorization. A format check that reads or stores a CVV outside an authorization request conflicts with PCI DSS.
What a format check does not prove
A format check tests digit count, prefix, expiry shape, and checksum. It does not test the issuer's authorization system. It does not confirm a billing address. It does not confirm that the card is active.
Card networks run authorization checks. A merchant sees an approval or decline code. A local format check is a first filter.
Common format errors
- Too few digits for the network prefix.
- Expiry month outside 01-12.
- Expiry year in the past.
- Security code length that does not match the network.
- Spaces or hyphens left in a stored card number.