UNDERSTANDING THE RIB / BBAN
Did you know your bank-account details hide a mathematical treasure? The French RIB, or BBAN, is more than a string of digits. Behind its austere structure lies elegant, highly effective mathematics.

Structure
• Bank code: five digits.
• Branch code: five digits.
• Account number: eleven characters.
• RIB check digits: two digits.
Example: 20041 01005 0500013M026 06.

Why letters in the account number?
A French banking tradition: A=10, B=11, …, M=22, N=23. When the bank sees M, it treats it as 22.

Calculating the check digits
Take the first 21 characters with letters converted.
Form the large number 200410100505000132226.
Calculate modulo 97, the remainder after division by 97.
If the remainder is zero, the key is 97; otherwise it is 97 minus the remainder.

Why modulo 97?
• It is the largest two-digit prime.
• It detects 99.99% of common input errors: swaps, substitutions and repetition.
• Adopted in 1976 following mathematician M. Veyrat's work.
• Still used today, including in international IBANs.

97 minus the remainder avoids 00, which could be ambiguous between a valid key and an error, ensuring keys from 01 to 97.

This algorithm illustrates how lasting innovation often joins pure mathematics with practical needs. A system designed almost 50 years ago still stands the test of time.

Did you know this hidden side of your account details? Share discoveries about the invisible validation systems shaping our digital lives.

PS: the French RIB is gradually being replaced by IBAN, but modulo 97 remains at the system's heart.

#Fintech #DigitalBanking #Banque #Innovation #HistoireTech #RIB #IBAN #TechForGood