What algorithm is commonly used to validate whether a payment-card number has a plausible check digit?

The story behind the answer

The Luhn algorithm is commonly used to validate whether a payment-card number has a plausible check digit.

Also called the modulus 10 algorithm, it processes the digits of a number from right to left. Alternating digits are doubled, and digits above nine are reduced by subtracting nine; the total is then checked for divisibility by 10.

Payment systems can use this calculation to catch common typing or scanning errors before a transaction is sent for authorization. It does not determine whether an account exists, whether a card is active, or whether a purchase will be approved.

The algorithm was developed by IBM scientist Hans Peter Luhn and was patented in 1960. It is also used in some identification numbers, so it is not exclusively a credit-card technique.

Source: Wikipedia · fact-checked Sept. 2026

Add question to a list

Choose a list to keep this question in: