How IBAN Checksums Work

The MOD-97 algorithm explained — what the two check digits actually do and how to verify them yourself.

What are the check digits?

Every IBAN contains two check digits in positions 3 and 4 (right after the two-letter country code). These digits are calculated from the rest of the IBAN using the ISO 7064 MOD-97-10 algorithm.

The purpose is simple: catch typos. If you mistype a single character in an IBAN, the check digits will almost certainly not match — giving a 98% error detection rate for single-digit errors.

DE89 3704 0044 0532 0130 00
Country code Check digits

The MOD-97 algorithm — step by step

We'll use a German IBAN as our example: DE89370400440532013000

1
Move the first 4 characters to the end

Take the country code and check digits from the front and append them to the end.

Start: DE89370400440532013000
After: 370400440532013000DE89
2
Replace letters with numbers

A=10, B=11, C=12 … Z=35. Digits stay as-is.

37040044053201300011311489 (D=13, E=14)
3
Compute MOD 97

Divide the resulting number by 97. The remainder must equal 1.

370400440532013000131489 mod 97 = 1

Because the number is too large for standard integer types, this is done iteratively by processing chunks of ~9 digits at a time.

Result = 1 → Valid. If the result is anything other than 1, the IBAN is invalid.

How check digits are calculated (when generating an IBAN)

When creating a new IBAN, the check digits start as "00" and are computed like this:

  1. Write the IBAN with "00" as the check digits: DE00370400440532013000
  2. Move first 4 to end: 370400440532013000DE00
  3. Replace letters: 37040044053201300013140000
  4. Compute: 98 − (number mod 97) = check digits
  5. If result is a single digit, prefix with 0 (e.g. 5 → 05)

Limitations of checksum validation

The MOD-97 checksum catches most typos, but it cannot verify:

  • Whether the account actually exists at that bank
  • Whether the bank code is a real, active bank
  • Whether you're sending to the right person
  • The extremely rare case of two different IBANs with the same check digits

Always double-check the recipient's details before sending money. A valid checksum confirms the IBAN is correctly formatted — not that funds will reach the intended person.