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.
The MOD-97 algorithm — step by step
We'll use a German IBAN as our example: DE89370400440532013000
Take the country code and check digits from the front and append them to the end.
After: 370400440532013000DE89
A=10, B=11, C=12 … Z=35. Digits stay as-is.
Divide the resulting number by 97. The remainder must equal 1.
Because the number is too large for standard integer types, this is done iteratively by processing chunks of ~9 digits at a time.
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:
- Write the IBAN with "00" as the check digits: DE00370400440532013000
- Move first 4 to end: 370400440532013000DE00
- Replace letters: 37040044053201300013140000
- Compute: 98 − (number mod 97) = check digits
- 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.