The last digit is a built-in check

Most payment-card numbers include a check digit: a digit calculated from the others, rather than chosen independently. A common method, the Luhn algorithm, gives the number a simple mathematical self-check.

To test it, start at the right and move left, doubling every second digit. If a doubled value is greater than 9, subtract 9. Add those results to the digits that were not doubled. A correctly formed number produces a total divisible by 10. When a card number is created, its final digit is selected to make that work.

A typo leaves a mathematical fingerprint

Change one digit by mistake and the total will usually no longer be divisible by 10. That lets a checkout form or payment system flag many mistyped numbers immediately, before treating the number as a plausible card number.

The check is deliberately modest. Some errors can still pass, and a passing number does not prove that the card exists, is active, or belongs to the person using it. It only confirms that the digits fit a common pattern. That small test is useful because it catches many accidental slips without needing to contact the card issuer.