Mod 10
Background

Every card number carries its own check digit.

Type one in. The Luhn algorithm adds the digits up in a particular way, and a real card number always lands on a multiple of ten. No bank, no network: nothing leaves this page.

Card numbers have 12 to 19 digits.

Try a sample number:

Practice Bank Card network
CardholderStudent name Valid thru12/29

The last digit is the check digit. It is chosen so the total works out.

How the check works

  1. Start at the right. Leave the last digit alone, then double every second digit moving left.
  2. Fold big numbers. If doubling gives 10 or more, subtract 9. A doubled 8 is 16, so it counts as 7.
  3. Add everything. If the total ends in 0, the number passes. One mistyped digit or two swapped neighbours almost always breaks it.

Type a number above to see each digit worked through.