BankCheck
HomeIBANRouting NumberSort CodeGuides
Home
IBAN
Routing Number
Sort Code
Guides

BankCheck

Validate any bank number instantly. Free and 100% client-side.

Your data never leaves the browser

Formats

IBAN40+ countriesRouting NumberUnited StatesSort CodeUK & Ireland

Info

GuidesCompareAlternativesAboutPrivacy PolicyTerms of UseAPI Docs

BankCheck checks whether a number could be valid based on format, length, and checksum rules. It does not verify that an account exists or confirm who it belongs to. Always confirm account details with your bank before making a payment.

© 2026 BankCheck

How to Calculate IBAN Check Digits

7 min read|Updated March 11, 2026

Every IBAN contains two check digits (positions 3 and 4) that act as a built-in error-detection mechanism. These digits are calculated using the MOD-97 algorithm defined in ISO 7064. The checksum catches over 99% of transcription errors — including transposed digits, missing characters, and single-digit mistakes — before a payment is even sent. This guide walks through the algorithm step by step, explains why MOD-97 was chosen over simpler alternatives, provides multiple worked examples, and covers edge cases you should know about. For background on IBANs themselves, see our guide on what an IBAN is and how it works.

Why MOD-97 Instead of Simpler Checksums?

You might wonder why the IBAN standard uses MOD-97 rather than something simpler like the Luhn algorithm (MOD-10), which is used for credit card numbers. The answer comes down to error detection capability. Simpler checksums have significant blind spots:

  • The Luhn algorithm (MOD-10) catches all single-digit substitution errors and most transposition errors of adjacent digits, but it cannot reliably detect transpositions of non-adjacent digits or more complex multi-digit errors. Its detection rate for random errors is approximately 90%.
  • MOD-97, by contrast, catches all single-character substitution errors, all transposition errors of two adjacent characters, and approximately 99% of all other error patterns. The false-negative rate is roughly 1 in 97, or about 1.03%.

The designers of the IBAN system, working under ISO 13616, chose MOD-97 specifically because international bank transfers involve large sums of money and even a single misdirected payment can be costly and time-consuming to recover. The higher detection rate justifies the slightly more complex arithmetic. Additionally, MOD-97 works naturally with the alphanumeric characters in IBANs (country codes contain letters), whereas MOD-10 is designed strictly for numeric strings.

Error Detection Capabilities in Detail

The MOD-97 check digit system provides the following guarantees:

Single substitution errors — 100% detection

If any single character in the IBAN is changed to a different character (for example, a 5 becomes a 6, or an A becomes a B), the MOD-97 check will always detect the error. This is the most common type of transcription mistake.

Transposition of adjacent characters — 100% detection

If two adjacent characters are accidentally swapped (for example, 34 becomes 43), the MOD-97 check will always catch it. This is the second most common error when manually typing or reading an IBAN.

Other errors — approximately 99% detection

For more complex errors — such as multiple character substitutions, non-adjacent transpositions, insertions, or deletions — the detection rate is approximately 99 out of 100. The probability that a random error produces a valid checksum by coincidence is about 1 in 97.

The MOD-97 Algorithm Step by Step

Let's walk through the algorithm using the German IBAN DE89 3704 0044 0532 0130 00 as an example.

Step 1: Rearrange the IBAN

Move the first four characters (country code + check digits) to the end of the string. Remove all spaces.

3704 0044 0532 0130 00 DE89

Step 2: Convert letters to numbers

Replace each letter with its position in the alphabet plus 9. A = 10, B = 11, C = 12, … Z = 35. This conversion is defined by the ISO 13616 standard and ensures that every character in the IBAN can be represented as a number for the modular arithmetic that follows.

D = 13, E = 14 → 3704 0044 0532 0130 00 131489

Step 3: Compute MOD 97

Treat the entire numeric string as a single integer and calculate the remainder when divided by 97. For very large numbers, you can process the number in chunks — take the first 9 digits, compute MOD 97, prepend the result to the next chunk, and repeat.

370400440532013000131489 MOD 97 = 1

Step 4: Verify the result

If the remainder equals 1, the IBAN is valid. Any other result means the IBAN contains an error.

The Chunking Method Explained

The numeric string produced by an IBAN can easily exceed 30 digits, which is far too large for standard integer types in most programming languages (a 64-bit integer can hold at most 19 digits). The solution is the chunking method, which processes the number in manageable pieces. Here is how it works in pseudocode:

remainder = ""
for each chunk of up to 9 digits in the numeric string:
  number = integer(remainder + chunk)
  remainder = string(number MOD 97)
result = integer(remainder)

Let's apply this to our German IBAN example. The full numeric string is 370400440532013000131489:

  • First chunk: 370400440 → 370400440 MOD 97 = 29
  • Prepend 29, next chunk: 295320130 → 295320130 MOD 97 = 70
  • Prepend 70, next chunk: 700013148 → 700013148 MOD 97 = 72
  • Prepend 72, final chunk: 729 → 729 MOD 97 = 1

The final remainder is 1, confirming the IBAN is valid. This chunking approach works in any programming language using basic integer arithmetic — no big-number library needed.

Second Worked Example: French IBAN

Let's verify the French IBAN FR76 3000 6000 0112 3456 789P 185. French IBANs are 27 characters long and may contain a letter in the account number portion. For a full reference on country-specific formats, see our guide on IBAN format by country.

Step 1: Rearrange

Move FR76 to the end:

3000600001123456789P185FR76

Step 2: Convert letters

P = 25, F = 15, R = 27. The numeric string becomes:

300060000112345678925185152776

Step 3: Compute MOD 97 using chunking

Process in chunks of 9 digits, carrying the remainder forward each time. The final result:

300060000112345678925185152776 MOD 97 = 1

Step 4: Verify

The remainder is 1 — the French IBAN is valid. Note how the letter P in the account number was converted to 25 during step 2. This demonstrates that the algorithm handles alphanumeric IBANs seamlessly.

Generating Check Digits for a New IBAN

When a bank generates a new IBAN, it follows a similar process:

  • Start with the country code, replace check digits with 00, and append the BBAN (bank + account number).
  • Rearrange and convert letters to numbers as above.
  • Compute: check digits = 98 – (numeric string MOD 97).
  • If the result is a single digit, pad with a leading zero (e.g., 6 becomes 06).

For example, to generate check digits for a German account, a bank would start with DE00370400440532013000, rearrange to 370400440532013000131400, compute 370400440532013000131400 MOD 97 = 9, and then calculate 98 – 9 = 89. The check digits are 89, giving us the final IBAN DE89 3704 0044 0532 0130 00.

Edge Cases: Leading Zeros and Special Values

There are several edge cases worth understanding when working with IBAN check digits:

Can check digits be 00?

No. Valid check digits range from 02 to 98. The formula is 98 – (numeric string MOD 97). Since MOD 97 produces a remainder between 0 and 96, the check digit result ranges from 2 (when the remainder is 96) to 98 (when the remainder is 0). A check digit of 00 or 01 is impossible under the standard and should be treated as an immediate validation failure.

Leading zeros in check digits

When the calculated check digit value is a single digit (2 through 9), it must be left-padded with a zero. For example, a check value of 6 becomes 06. The check digit field is always exactly two characters wide. Some common IBANs with leading-zero check digits include certain Belgian IBANs (country code BE) and Danish IBANs (country code DK).

Check digit 97 and 98

The values 97 and 98 are both valid check digits. A check digit of 98 occurs when the BBAN portion, after rearrangement and letter conversion, happens to be exactly divisible by 97 (remainder = 0). A check digit of 97 occurs when the remainder is 1. Both are perfectly normal.

How Banks Implement This in Software

In practice, every bank and payment processor implements IBAN validation as an automated check at the point of entry. When you type or paste an IBAN into a banking application, the software runs the MOD-97 validation before the payment instruction is even submitted. This provides immediate feedback, preventing common data-entry errors from ever reaching the payment processing system.

The implementation typically involves three layers of validation:

  • Format check: Verify the country code is recognized and the total length matches the expected length for that country. For example, a German IBAN must be exactly 22 characters, a French IBAN exactly 27 characters.
  • Structure check: Verify that each position contains the expected character type (letter vs. digit) according to the country's BBAN format specification in the SWIFT IBAN Registry.
  • Checksum check: Run the MOD-97 algorithm. If the result is not 1, the IBAN is invalid.

Most modern banking software runs all three checks in under a millisecond. Languages with native big-integer support (such as Python or JavaScript with BigInt) can compute the MOD-97 directly on the full numeric string. Languages without native support for arbitrarily large integers use the chunking method described above, which requires only standard 32-bit or 64-bit integer arithmetic.

It is important to note that IBAN validation confirms the format and checksum are correct — it does not confirm that the account actually exists at the specified bank. A valid IBAN could refer to a closed account or a non-existent account number that happens to produce a correct checksum. Account existence verification requires a separate check against the bank's internal systems, which is typically performed only during payment processing.

Why This Matters

The MOD-97 checksum detects all single-character errors and nearly all transposition errors (two adjacent characters swapped). It is far more robust than simpler check-digit schemes. This is why banks can reject invalid IBANs before processing, saving time and preventing costly misdirected payments. According to European banking industry estimates, IBAN validation prevents millions of erroneous payment instructions from entering the clearing system each year, saving significant costs in manual investigation and fund recovery.

Frequently Asked Questions

Can check digits be 00?
No. The formula 98 – (value MOD 97) produces results between 2 and 98, inclusive. Check digits of 00 and 01 are mathematically impossible under the ISO 13616 standard. If you encounter an IBAN with check digits of 00 or 01, it is invalid regardless of what the rest of the string looks like.
What if my IBAN fails the check?
If an IBAN fails MOD-97 validation, it contains an error. The most common causes are: a digit was mistyped (substitution), two adjacent digits were swapped (transposition), a character was accidentally added or removed, or the IBAN was truncated when copied. Double-check the IBAN against the original source document. If you received it verbally, ask the sender to confirm it in writing. Our IBAN validator will tell you exactly what went wrong, including whether the length or structure is incorrect for the given country.
Is MOD-97 the same as MOD-10 (Luhn)?
No. They are fundamentally different algorithms. The Luhn algorithm (MOD-10) is used for credit card numbers and some other identifiers. It works only on numeric strings and has a detection rate of about 90% for random errors. MOD-97 works on alphanumeric strings (letters are converted to numbers), uses a much larger modulus, and achieves a detection rate of approximately 99%. MOD-97 was specifically chosen for IBANs because of its superior error detection, which is critical for high-value financial transactions.
Do banks check IBANs automatically?
Yes. Virtually all banks and payment processors validate IBANs automatically when you enter them into online banking, mobile apps, or payment forms. The validation runs instantly on the client side (in your browser or app) and again on the server side when the payment instruction is submitted. If the IBAN fails validation, the system rejects it before the payment is even initiated, preventing the error from propagating through the clearing network.

Validate Instantly

You do not need to calculate check digits manually. Paste any IBAN into our IBAN validator and the tool runs the MOD-97 check automatically, showing you whether the IBAN is valid along with a full breakdown of its components.

Related Guides

What Is an IBAN?

8 min read

IBAN Format by Country

7 min read

Back to all guides.