What is an IBAN and how to validate it: structure, mod 97 and its limits
An IBAN is the standard number that identifies a bank account without ambiguity in cross-border transfers. It contains a checksum that catches typing mistakes. This article shows the structure and how that check is calculated.
The parts of an IBAN
Every IBAN starts in this order:
- Two letters: the country code (TR for Turkey).
- Two digits: the check digits.
- The rest: account details that vary by country (bank code and account number).
A Turkish IBAN
A Turkish IBAN is 26 characters long:
TR33 0006 1005 1978 6457 8413 26
TR country code
33 check digits
00061 bank code (5 digits)
0 reserved digit
0519786457841326 account number (16 digits)
This is a general example used to show the format. We do not claim it represents a real account.
Length depends on the country
Each country has a fixed IBAN length. For example Germany is 22, the United Kingdom 22, France 27 and the Netherlands 18 characters. If the length is wrong, the IBAN is invalid before the checksum is even looked at.
How the mod 97 check works
An IBAN is tested in these steps:
- Move the first four characters (country code and check digits) to the end of the IBAN.
- Convert letters to numbers: A=10, B=11, ... Z=35.
- Find the remainder of dividing the resulting large number by 97.
- If the remainder is 1, the IBAN is valid.
Example
For the widely used United Kingdom example GB82 WEST 1234 5698 7654 32:
moved : WEST12345698765432GB82
letter → num : W=32 E=14 S=28 T=29 G=16 B=11
number : 3214282912345698765432161182
3214282912345698765432161182 mod 97 = 1 ✓ valid
What this check does not show
The checksum only catches typing mistakes (wrong or swapped digits). A valid result does not show that the IBAN belongs to an account, that the account is open or who owns it.
Before sending money, check the recipient's name on your bank's own screen.
Try it yourself
Type an IBAN with or without spaces into the IBAN validator: the characters, the length for the country and the mod 97 check are shown separately. For Turkish IBANs the bank code is shown too. Your IBAN never leaves your browser.
This article is general information, not financial advice.