Illustration for IBAN Formula Explained with Examples (MOD-97 Guide) - DigiToolkit

IBAN Formula Explained with Examples (MOD-97 Guide)

The exact IBAN formula (ISO 7064 MOD-97) broken down with worked examples across 4 countries — written for Indian developers and remitters.

Quick Answer: The IBAN formula is the ISO 7064 MOD-97-10 algorithm: rearrange the BBAN with the country code and “00” appended, convert letters to numbers (A=10–Z=35), divide by 97, then compute 98 minus the remainder to get the two check digits. A valid existing IBAN always produces a remainder of exactly 1.

Key takeaways:

  • The IBAN formula is officially called ISO 7064 MOD-97-10.
  • It has five steps: build the BBAN, rearrange, convert letters to numbers, divide by 97, derive check digits.
  • 97 is used because it’s the largest two-digit prime number.
  • The same formula applies globally; only each country’s BBAN structure differs.
  • India’s IFSC code uses structural validation, not a mathematical checksum like IBAN.

Ask ten people how an IBAN’s check digits are generated, and most will shrug. The formula behind it is public and well-documented. This guide walks through the exact IBAN formula step by step, with worked examples, so you can verify an IBAN by hand or understand what a calculator does behind the scenes.

What Problem Does the IBAN Formula Actually Solve?

Cross-border payments involve manually typed or dictated account numbers across language and alphabet barriers. A single transposed digit can send money to a stranger’s account. The IBAN formula — ISO 7064 MOD-97-10 — catches these errors automatically before a bank processes the payment.

Expert insight: This is the same design philosophy behind India’s Aadhaar number, which carries a Verhoeff checksum digit. Both systems embed a self-verifying digit because manual data entry is the biggest source of transaction errors in banking.

The IBAN Formula, Step by Step

Step 1 — Build the BBAN

Combine the bank code, branch code, and account number into the Basic Bank Account Number (BBAN).

Step 2 — Rearrange and Append

Move the country code and “00” from the front to the end: DE00370400440532013000 becomes 370400440532013000DE00.

Step 3 — Letter-to-Number Conversion

Convert letters using A=10, B=11 … Z=35. DE becomes 1314.

Step 4 — The MOD-97 Division

Treat the string as one large integer and compute its remainder when divided by 97, using chunked modulo arithmetic for big numbers.

Step 5 — Deriving the Check Digits

  • To validate: the remainder must equal exactly 1.
  • To generate: compute 98 − remainder, left-padded to two digits.

Worked Examples Across Countries

Germany

BBAN: 370400440532013000 → Result: DE89 3704 0044 0532 0130 00

United Kingdom

BBAN: NWBK60161331926819 → Result: GB29 NWBK 6016 1331 9268 19

France

BBAN: 20041010050500013M02606 → Result: FR14 2004 1010 0505 0001 3M02 606

UAE

BBAN: 0331234567890123456 → Result: AE07 0331 2345 6789 0123 456

Each follows the exact same five-step formula — only the BBAN structure differs by country.

IBAN Formula for Developers (Pseudocode)

function calculateCheckDigits(countryCode, bban):
    rearranged = bban + countryCode + "00"
    numeric = convertLettersToNumbers(rearranged)
    remainder = mod97(numeric)
    checkDigits = 98 - remainder
    return padLeft(checkDigits, 2, "0")

function validateIBAN(iban):
    rearranged = iban[4:] + iban[0:4]
    numeric = convertLettersToNumbers(rearranged)
    return mod97(numeric) == 1

Key takeaway: The trickiest part isn’t the formula — it’s chunked modulo arithmetic for numbers with 20–30+ digits, requiring big-integer handling.

Why the Formula Uses 97 Specifically

97 is the largest two-digit prime number. Prime moduli distribute remainders evenly and reduce collisions — the same principle used in parts of India’s own Aadhaar and PAN verification logic.

How This Compares to India’s Own Verification Codes

System Country Checksum Method Purpose
IBAN EU, UK, Gulf, 86+ countries ISO 7064 MOD-97-10 Validate bank account identifiers
PAN India Alphanumeric structural check Validate tax ID format
Aadhaar India Verhoeff algorithm Validate identity number
IFSC India Structural check Validate bank branch identifier (no checksum digit)

India’s IFSC code does not carry a mathematical check digit the way IBAN does — it’s a structural identifier only.

Common Formula Mistakes to Avoid

  • Forgetting to move the country code to the end before conversion.
  • Using ASCII values instead of A=10…Z=35.
  • Applying standard modulo instead of chunked modulo, causing overflow errors.
  • Confusing “valid remainder = 1” with “remainder = 0.”

Skip the manual math: DigiToolkit’s free IBAN Calculator runs this exact MOD-97 formula instantly.

Conclusion

The IBAN formula is a well-defined, five-step process built on ISO 7064 MOD-97-10: rearrange, convert letters to numbers, divide by 97, derive two check digits that catch transcription errors. For Indian users and developers, this demystifies infrastructure that, unlike IFSC, embeds real mathematical error-detection into the number itself.

FAQs

What is the exact formula used to calculate IBAN check digits?
Check digits = 98 − (N mod 97).

Can I calculate the IBAN formula by hand?
Yes, but it’s tedious for long account numbers — most people use a calculator.

Why is 97 used in the IBAN formula?
It’s the largest two-digit prime number, giving strong error-detection.

Is the IBAN formula the same for every country?
Yes, only the BBAN structure changes by country.

Does India use a similar formula for IFSC codes?
No, IFSC is structural only, without a checksum digit.

Leave a Reply

Your email address will not be published. Required fields are marked *