FR76 in French IBANs

French IBANs are often prefixed with FR76

Some examples:

FR76 30056000480048161128019
FR76 30006000011234567890189
FR76 10096183230002533370166
FR76 10907005223602151301111

The value 76 represents the IBAN Check Digits (ICD), which validate the rest of the IBAN. Intuitively, one would expect the ICD to change with the rest of the IBAN, yet all four examples above have 76.

To understand this behaviour, we will look closely at how the check digits are generated.

IBAN structure - France

SWIFT [1] publishes the authoritative description of the structure. After the country code and check digits, it gives the French layout as 5!n 5!n 11!c 2!n. The IBAN has the following parts:

FR followed by two digits The digits are the ICD
5 numeric The bank code (code banque)
5 numeric The branch code (code guichet)
11 alphanumeric The account identifier. ACCOUNT_ID
2 numeric The French national check digits. NCD

The bank code and the branch code always appear together in what follows, so we combine them into one 10-digit BANK_ID.


Example

    ICD   BANK_ID       ACCOUNT_ID    NCD  
FR  76    10907 00522   36021513011   11

Rules and notation

  • Processing ignores all whitespace; examples use it only for readability.

  • If a generated ICD or NCD is a single digit, it is always left-padded with 0

  • The ⊕ symbol indicates string concatenation, for example: 12 ⊕ 00 = 1200

  • For any integer x we define m(x) = x mod 97, the remainder of x when divided by 97

  • Only the remainder of a matters when we multiply a by N and add b, so we have: m( a·N + b ) = m( m(a)·N + b )

The short version

The NCD is chosen so that BANK_ID ⊕ ACCOUNT_ID ⊕ NCD, the part of the IBAN following after the first four characters, is divisible by 97. The ICD check also works modulo 97, so the account details cancel out and only the country code is left. Assuming ACCOUNT_ID consists only of digits:

ICD = 98 - m(BANK_ID ⊕ ACCOUNT_ID ⊕ NCD ⊕ 152700)
    = 98 - m((BANK_ID ⊕ ACCOUNT_ID ⊕ NCD)·10^6 + 152700)
    = 98 - m(0·10^6 + 152700)
    = 98 - 22
    = 76

The rest of this post fills in the details: how NCD and ICD are generated, the same result worked out step by step, and why letters in ACCOUNT_ID break it.

NCD (national check digits) generation

ICD generation is common to all countries, but NCD generation national: France (and Monaco) use the algorithm below. Other countries generate NCD differently or, like Germany, have no separate check-digit field in the IBAN.

NCD = 97 - m(BANK_ID ⊕ ACCOUNT_ID ⊕ 00)

In our example we have

NCD = 97 - m(10907 00522 36021513011 00)
    = 97 - 86
    = 11

When ACCOUNT_ID contains letters, they are first converted to digits, using a table with a table shown later.

ICD (IBAN check digits) generation

Letters are replaced by digits. This is done by taking A ➔ 10, B ➔ 11, etc. In particular F ➔ 15 and R ➔ 27. For example FR00 ➔ 152700. Note that this is different from the conversion used for NCD.

The value 152700 is actually a constant in ICD generation. Following the standard mod 97 check [2], ICD for France becomes:

ICD = 98 - m(BANK_ID ⊕ ACCOUNT_ID ⊕ NCD ⊕ 152700)

In our example we have

ICD = 98 - m(10907 00522 36021513011 11 152700)
    = 98 - 22
    = 76

The long way

Here is the same result worked out step by step. We assume that ACCOUNT_ID consists only of digits, so that ICD and NCD generation see the same value. Because BANK_ID ⊕ ACCOUNT_ID appears in both, it is convenient to substitute X = BANK_ID ⊕ ACCOUNT_ID, which gives NCD = 97 - m(100X).

NCD is always two digits (see the padding rule above), so appending it to X is the same as multiplying X by 100 and adding NCD:

X ⊕ NCD = 100X + NCD
        = 100X + (97 - m(100X))
        ≡ 100X - m(100X)        (mod 97)
        ≡ 0                     (mod 97)

and finally, using m( a·N + b ) = m( m(a)·N + b ):

ICD = 98 - m((X ⊕ NCD) ⊕ 152700)
    = 98 - m((X ⊕ NCD)·10^6 + 152700)
    = 98 - m(m(X ⊕ NCD)·10^6 + 152700)
    = 98 - m(152700)
    = 98 - 22
    = 76

Why it isn’t always 76

From what we have seen so far, it may look like ICD should always be 76. To understand why this is sometimes not so, we need to revisit the way NCD is generated. Just like with ICD, during NCD generation, letters are converted to digits, but the way it is done is different from ICD (wikipedia):

   A  J    ➔  1 
   B  K  S ➔  2 
   C  L  T ➔  3 
   D  M  U ➔  4 
   E  N  V ➔  5 
   F  O  W ➔  6 
   G  P  X ➔  7 
   H  Q  Y ➔  8 
   I  R  Z ➔  9

Therefore, if ACCOUNT_ID contains letters, NCD and ICD generation process different values of ACCOUNT_ID.

Let X be BANK_ID ⊕ ACCOUNT_ID with letters converted the ICD way (A ➔ 10, …), and Y the same with the NCD table.

Instead of

ICD = 98 - m(X ⊕ (97 - m(X ⊕ 00)) ⊕ 152700)

we have

ICD = 98 - m(X ⊕ (97 - m(Y ⊕ 00)) ⊕ 152700)

and the terms don’t cancel out as before. The ICD can still come out as 76, but only by coincidence, about 1 time in 97.

A check: Monaco

Monaco uses the same approach to calculating NCD as France. With M ➔ 22 and C ➔ 12, the constant MC00 becomes 221200:

ICD = 98 - m(221200)
    = 98 - 40
    = 58

and indeed, Monaco IBANs with all-digit account values always start with MC58.

The bottom line is that whenever a French account number consists only of digits, the resulting ICD is 76.


Tags: iban  fr76 
Table of Contents