Introduction to IBAN
The International Bank Account Number (IBAN) is a standardized format for identifying bank accounts internationally. It was developed to facilitate cross-border transactions and reduce errors in account identification.
An IBAN typically includes:
Country Code: A 2-letter code that identifies the country (e.g., DE for Germany).
Check Digits: Two digits used to validate the IBAN.
Basic Bank Account Information: This varies by country but usually includes the bank code, branch code, and account number.
How to Check the Validity of an IBAN
1. Verify the Length
Each country has a specific length for its IBANs. First, ensure that the provided IBAN matches the required length for the country. For example, a German IBAN should be 22 characters long.
2. Rearrange the Characters
Move the first four characters (the country code and check digits) to the end of the string. For example, if the IBAN is DE44 5001 0517 0445 6789 01, it becomes 500105170445678901DE44.
3. Convert Letters to Numbers
Convert all letters to their corresponding numerical values. According to the ISO 7064 Mod 97-10 standard, A=10, B=11, ..., Z=35. For example, DE would be converted to 1314.
4. Perform the Modulo Operation
Treat the rearranged and converted string as a large integer and perform a modulo 97 operation. If the result is 1, the IBAN is valid; otherwise, it is invalid.
Example
Let's verify the following IBAN: DE44 5001 0517 0445 6789 01
Rearrange: 500105170445678901DE44
Convert Letters: 500105170445678901131444
Treat as Integer: 500105170445678901131444
Modulo 97-10 Calculation: Calculate 500105170445678901131444 mod 97,
The result should be 1, If the result is 1, the IBAN is valid.
By following these steps, you can ensure that the provided IBAN is correct, which helps avoid issues during international transactions.