ibanchecker.cash
IBAN FundamentalsJune 1, 2026 · 6 min read

How IBAN Check Digits Work (MOD-97 Algorithm Explained)

A technical deep dive into the MOD-97-10 check digit algorithm — how it detects transcription errors and why a single digit change invalidates the IBAN.

Share

Every IBAN contains two check digits immediately after the country code. These digits are not random — they're calculated using a specific mathematical algorithm that can detect whether the IBAN has been mistyped. Understanding how this works reveals why IBAN validation is so reliable at catching transcription errors.

What Are Check Digits?

Check digits are a form of redundancy built into a number to detect errors. The idea is simple: when you compute the check digits correctly from the rest of the number, the full number has a specific mathematical property. If anyone changes a digit by mistake, that property breaks, and you can immediately tell something is wrong.

IBANs use the MOD-97-10algorithm, defined in ISO 7064. The “97” is the modulus — the divisor used in the calculation. The “10” refers to the fact that it operates on base-10 (decimal) numbers.

The MOD-97 Algorithm

Validating an IBAN with MOD-97 takes four steps:

  1. Rearrange: Move the first four characters (country code + check digits) to the end. GB29NWBK60161331926819 becomes NWBK60161331926819GB29.
  2. Replace letters: Convert each letter to a number where A=10, B=11, …, Z=35. N=23, W=32, B=11, K=20, G=16, B=11. The string becomes a long integer: 2332112060161331926819161129.
  3. Compute modulo 97:Divide this large number by 97 and find the remainder. Because JavaScript and most languages can't handle 30-digit integers natively, this is done in chunks.
  4. Check the result: If the remainder is 1, the IBAN is valid. Any other remainder means the IBAN contains an error.

Why Remainder = 1?

When constructing an IBAN, the check digits are chosen so that the full rearranged number gives a remainder of 1 when divided by 97. Specifically, the two check digits are calculated as 98 − (numeric_value_with_00_check_digits mod 97).

This means valid IBANs satisfy the identity: numeric_value mod 97 = 1. If a single digit is changed anywhere in the IBAN, this identity almost certainly breaks.

What Errors Does MOD-97 Catch?

The algorithm reliably detects:

  • Single-character errors: Changing any one digit or letter — caught with certainty for all digits, and near-certainty for letter substitutions.
  • Transpositions: Swapping two adjacent characters (writing 29 instead of 92) — caught in all cases.
  • Twin errors: Changing a pair of identical digits (aa → bb) — caught in almost all cases.

The algorithm does not guarantee detection of all possible multi-character errors. Two changes might cancel each other out mathematically. But for real-world transcription errors — misreading a digit, swapping two digits — MOD-97 is highly effective.

Implementing MOD-97 in JavaScript

Large IBAN numbers exceed JavaScript's safe integer range. The standard solution is to compute the modulo in chunks:

function mod97(iban) {
  const rearranged = iban.slice(4) + iban.slice(0, 4);
  const numeric = rearranged.split('').map(c =>
    c >= 'A' ? String(c.charCodeAt(0) - 55) : c
  ).join('');

  let remainder = 0;
  for (let i = 0; i < numeric.length; i += 7) {
    remainder = parseInt(remainder + numeric.slice(i, i + 7), 10) % 97;
  }
  return remainder; // Valid if === 1
}

Each chunk prepends the current remainder to the next 7 digits, keeping the number small enough for safe integer arithmetic throughout.

Check Digit Limitations

A passing MOD-97 check means the IBAN is formatted correctly. It does not mean:

  • The account exists at the named bank
  • The account belongs to the person you intend to pay
  • The bank is still operating

For payment safety, complement MOD-97 validation with bank confirmation (asking your bank to verify the payee name matches the account) and Confirmation of Payee services where available.

Validate an IBAN instantly

Free IBAN checker — MOD-97 verification, bank lookup, and SEPA status across 84 countries.

Open IBAN Checker →

Related Articles