Payments glossary Card payments & networks
What Is the Luhn Algorithm?
Definition
The Luhn algorithm is a modulus-10 checksum formula used to compute and validate the final check digit of a card number. It catches common copying errors, such as a single wrong digit, before a payment is submitted. Passing a Luhn check shows only that a number is well formed, not that the card exists or can be charged.
Also called: Luhn check, Luhn formula, mod 10 check, modulus 10 check digit
How it works and why it matters
Hans P. Luhn, an IBM engineer, filed the method in 1954 and received US Patent 2,950,048 for it in 1960. ISO/IEC 7812-1 makes it the normative way to calculate the PAN check digit (Annex B, the modulus-10 double-add-double formula). To validate a number, start at the rightmost digit (the check digit) and move left, doubling every second digit; when a doubled digit gives a two-digit result, add those two digits together. Sum everything. The number is valid if the total is a multiple of 10.
Checkout forms, billing platforms, and payment providers run a Luhn check before sending an authorization request, so a mistyped number is rejected instantly instead of reaching the issuer. For subscription merchants this matters most on card update pages: a customer fixing a failed renewal who mistypes one digit gets an immediate prompt rather than a second failed payment. The check says nothing about the account itself, so expired, closed, or blocked cards pass it and still decline at authorization.
Example
Take the patent's own example, 4872148. Moving left from the rightmost digit, double every second digit: 8 becomes 16 (1 + 6 = 7), 1 becomes 2, 7 becomes 14 (1 + 4 = 5), and 4 becomes 8. Adding these to the undoubled digits (4, 2, and 8) gives 36. The check digit brings the total to the next multiple of 10, so it is 4, and the full number is 48721484. Checking 48721484 the same way gives 40, so it passes.
Frequently asked questions
What is the Luhn Algorithm?
The Luhn algorithm is a modulus-10 checksum formula used to compute and validate the final check digit of a card number. It catches common copying errors, such as a single wrong digit, before a payment is submitted. Passing a Luhn check shows only that a number is well formed, not that the card exists or can be charged.
Does a valid Luhn check mean a card is real?
No. The Luhn algorithm only confirms that the digits are internally consistent. A number can pass and still belong to no account, or to a card that is expired, closed, or blocked. Only an authorization or a zero-amount account verification sent to the issuer confirms that a card can be charged.
Related terms
Related tools and guides
Sources
- ISO/IEC 7812-1:2017 Identification cards, Identification of issuers, Part 1: Numbering system (preview) (ISO/IEC)
- US Patent 2,950,048: Computer for verifying numbers (Google Patents)
Sources checked November 2026. Card network and scheme rules change; confirm current rules with your payment provider.
More card payments & networks terms
Losing subscription revenue to failed payments?
Slicker recovers failed recurring payments with smart retries driven by decline codes and Merchant Advice Codes, plus hyper-personalized emails when the customer has to act. It runs on your existing billing platform, and you only pay when it outperforms your current setup in a 50/50 test.