What IBAN check digits are doing
An IBAN includes two check digits (characters 3–4) that are calculated using the MOD-97 algorithm. Their job is simple: detect accidental errors like mistyped characters, swapped digits, or copy/paste mistakes.
If a system says “invalid IBAN,” the most common cause is that the checksum doesn’t match the rest of the characters.
MOD-97 in plain language
At a high level, the IBAN is transformed into a very large number. If that number mod 97 equals 1, the IBAN passes checksum validation.
The transformation has three key steps:
- Move the first 4 characters to the end.
- Convert letters A–Z into numbers 10–35.
- Compute the remainder when dividing by 97.
Why it catches most mistakes
Checksums are designed for error detection, not security. MOD-97 is strong against common data entry errors, including:
- Single-character errors (one wrong digit/letter)
- Many adjacent transpositions (swapping two neighbors)
- Common copy/paste corruption (extra whitespace isn’t a problem if normalized)
It does not prove the account exists, is open, or belongs to the intended recipient. It only proves internal consistency.
How check digits are calculated (the “98 minus remainder” rule)
To calculate check digits for a country + BBAN:
- Start with: COUNTRY + 00 + BBAN
- Rearrange + letter-to-number conversion
- Compute remainder = mod 97
- Check digits = 98 - remainder (left-pad to 2 digits)
This is why you’ll sometimes see “check digits are 98 - (mod 97)” in specs.
Troubleshooting: why a checksum might fail
1) Wrong country code (or copied from a template)
If the first two letters are wrong, the entire checksum changes. This happens when someone copies a sample IBAN and only edits the “account number” portion.
2) Wrong length for the country
Each IBAN country has a fixed length. If the length is wrong, the IBAN is invalid even before checksum. Use IBAN Country Lookup to confirm the expected length.
3) Letter O vs number 0 (and similar lookalikes)
Some characters are easy to confuse. O/0 and I/1 are common. A checksum failure is often your first signal that one character is wrong.
4) Mixed whitespace / hidden characters
Most validators normalize whitespace, but not all payment forms do. If one system accepts the IBAN and another rejects it, try electronic format (no spaces) via IBAN Formatter.
How to fix a failing IBAN (without guessing)
- Run it through IBAN Validator to see whether the issue is length, format, or checksum.
- If you trust the BBAN portion and country code, use Check Digit Calculator to compute the expected check digits and compare.
- If you need to sanity-check which substring is “bank/branch/account,” use IBAN Parser (but only after validation).
What MOD-97 can’t protect you from
- Valid-but-wrong account: you can change multiple characters and still produce a valid checksum if you also change the check digits accordingly.
- Fraud/social engineering: checksums don’t validate the recipient identity.
- Policy/compliance blocks: banks may reject transfers for reasons unrelated to the IBAN.
FAQs
Does MOD-97 guarantee the IBAN is real?
No. It guarantees the IBAN is internally consistent. It doesn’t verify account existence or ownership.
Why is “mod 97 = 1” the rule?
That’s the ISO 13616 specification. The check digits are chosen so that the transformed numeric representation yields a remainder of 1 when divided by 97.
Can two different IBANs both be valid?
Yes. Many different values can be valid; validity is about structure and checksum, not uniqueness or ownership.
What’s the fastest way to calculate check digits?
Use the Check Digit Calculator. It calculates the correct digits from the country + BBAN and can show the steps.
Why does my bank app accept an IBAN but a form rejects it?
Often it’s formatting. Some forms don’t normalize whitespace or expect uppercase. Convert to electronic format with IBAN Formatter.
Do I need to validate IBANs before saving them?
If the IBAN is used for payments, yes—validate at entry time to catch typos. Store the normalized value (no spaces) and display a formatted version for humans.