Reference · Validation

Check-digit algorithms explained.

Which numbers use which checksum, how each is calculated by hand, and what a passing check does and does not prove.

Advertisement

Which checksum does what

Check-digit algorithms for common identifiers.
NumberAlgorithmWeights and modulusPassing means
Payment card number, Canadian SIN, Ontario health card numberLuhnDouble every second digit from the right, subtract 9 from any result over 9, sum, total must be divisible by 10Well-formed. Not that an account or person exists.
ISBN-10Mod 11Weights 10 down to 1; X stands for 10; total divisible by 11Well-formed ISBN-10
ISBN-13 and EAN-13 barcodesMod 10Weights alternate 1 and 3 across all 13 digits; total divisible by 10Well-formed ISBN-13 or EAN-13
IBANISO 7064 mod 97-10Move the first four characters to the end, turn letters into numbers (A=10 to Z=35), remainder after dividing by 97 must be 1Well-formed IBAN. Not that the account is open.
BC Personal Health NumberMod 11Weights 2, 4, 8, 5, 10, 9, 7, 3 on digits 2 to 9Well-formed PHN

A check digit is designed to catch typing errors such as a single wrong digit or two swapped neighbours. It is not a security feature and says nothing about whether the number was ever issued.

Luhn, step by step

Take 79927398713. Work from the right-hand digit, which is not doubled, and double every second digit moving left. Any doubled result above 9 has 9 subtracted.

  1. Digits right to left: 3, 1, 7, 8, 9, 3, 7, 2, 9, 9, 7.
  2. Double every second digit (positions 2, 4, 6, 8, 10): 1×2=2, 8×2=16→7, 3×2=6, 2×2=4, 9×2=18→9.
  3. Sum all digits with those replacements: 70.
  4. 70 is divisible by 10, so the number passes.

Two more passes you can verify the same way: the SIN example 046 454 286 totals 50 and the standard Visa test number 4111 1111 1111 1111 totals 30. Neither is a real account or person.

ISBN-10

Multiply the digits of 0306406152 by 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 and add the products: the total is 132, and 132 ÷ 11 = 12, so it passes. If the last character is X it counts as 10.

ISBN-13 and EAN-13

Multiply the digits of 9780306406157 alternately by 1 and 3 from the left and add: the total is 100, divisible by 10, so it passes. This is the same check GS1 uses for EAN-13 retail barcodes.

IBAN mod 97

Take GB82WEST12345698765432, a widely published example IBAN (not a real account). Move the first four characters to the end to give WEST12345698765432GB82. Replace letters with numbers (W=32, E=14, S=28, T=29, G=16, B=11) to get 3214282912345698765432161182. The remainder when that 28-digit number is divided by 97 is 1. A remainder of 1 means the IBAN is well-formed. Divide in chunks, because the number is too large for ordinary integers in many languages.

What a checksum cannot tell you

Passing proves the digits are internally consistent, so a typo is likely to be caught. It does not prove the card, account, ISBN or person exists. Roughly one random number in ten passes a mod 10 check, and about one in eleven passes a mod 11 check, so only the issuer can confirm a real number. Use the validators below to run each check in your browser; nothing is sent to a server.

Sources

Every figure above is copied from the primary source linked here. Check the source before relying on a number for a filing, a payroll run or a legal decision; governments revise these tables.

Cite this page

You are welcome to quote or link this table. A suggested citation:

TNAADO Tools. "Check-Digit Algorithms Explained: Luhn, ISBN, EAN and IBAN." tools.tnaado.ca, data as of 1 October 2026, published 1 October 2026. https://tools.tnaado.ca/canadian/check-digit-algorithms-explained/
Advertisement
Advertisement