IBAN Structure: Country Formats and MOD 97 Check Digits
The International Bank Account Number (IBAN) identifies a bank account across borders. Every IBAN follows the same outline, but each country fixes its own length and layout, and two check digits catch most typing mistakes before a payment goes anywhere. This guide explains how an IBAN is built, how to read the country formats in the SWIFT IBAN Registry, how the MOD 97-10 check works with a central bank's worked example, and what a valid IBAN does not prove.
The Parts of an IBAN
An IBAN has three parts, always in the same order:
- Country code: two letters from ISO 3166, such as DE, FR or GB.
- Check digits: two digits calculated over the whole IBAN with ISO 7064 MOD 97-10.
- BBAN (Basic Bank Account Number): the national account number, usually including a bank code and sometimes a branch code and national check digits.
The standard is ISO 13616. SWIFT is its registration authority: each country registers the length and layout of its IBAN, and SWIFT publishes them in the IBAN Registry. Release 103 (September 2026) lists 89 countries, and it is the source of the formats in the LeedyBox validator.
Formats of Some Countries
| Country | Length | Registry format | Registry example |
|---|---|---|---|
| Norway (shortest) | 15 | NO2!n4!n6!n1!n | NO93 8601 1117 947 |
| Netherlands | 18 | NL2!n4!a10!n | NL91 ABNA 0417 1643 00 |
| Germany | 22 | DE2!n8!n10!n | DE89 3704 0044 0532 0130 00 |
| United Kingdom | 22 | GB2!n4!a6!n8!n | GB29 NWBK 6016 1331 9268 19 |
| Spain | 24 | ES2!n4!n4!n1!n1!n10!n | ES91 2100 0418 4502 0005 1332 |
| France | 27 | FR2!n5!n5!n11!c2!n | FR14 2004 1010 0505 0001 3M02 606 |
| Italy | 27 | IT2!n1!a5!n5!n12!c | IT60 X054 2811 1010 0000 0123 456 |
| Brazil | 29 | BR2!n8!c5!n10!n1!c1!c | BR66 9999 9A03 0000 1000 9795 493C 1 |
| Russia (longest) | 33 | RU2!n9!n5!n15!c | RU03 0445 2522 5408 1781 0538 0913 1041 9 |
The validator's country list shows the format, example, bank and branch positions and the registry dates for all 89 countries.
Reading the Registry Notation
The registry describes each part with a length and a character type:
n: digits 0–9a: capital letters A–Zc: letters or digits!after the length: the length is fixed.4!ais exactly four capital letters.
So GB2!n4!a6!n8!n means GB, two check digits, four letters (the bank), six digits (the sort code) and eight digits (the account number), 22 characters in all. Because every country's format has a fixed length, a validator can reject a wrong length or a letter in the wrong place before it even looks at the check digits.
Validating the Check Digits, Step by Step
The Central Bank of the Republic of Türkiye's IBAN Communiqué describes the MOD 97-10 check with this example, TR47 0000 1001 0000 0350 9300 01:
- Remove the spaces and move the first four characters (TR47) to the end:
TR470000100100000350930001becomes0000100100000350930001TR47. - Replace each letter with two digits: A = 10, B = 11 … Z = 35. T = 29 and R = 27, giving
0000100100000350930001292747. - Divide that number by 97. For a valid IBAN the remainder is 1.
The number has 28 digits, too long for ordinary integer or floating-point arithmetic. The Communiqué shows how to do it in pieces: the remainder of the first nine digits, 000010010, divided by 97 is 19; put 19 in front of the next digits, 19000035093, and the remainder is 43; then 430001292747 leaves 1. Any piece size works as long as the remainder is carried forward, and a program can simply process one character at a time.
Calculating New Check Digits
- Write the BBAN, then the country code, then 00: for Germany's example,
370400440532013000+DE+00. - Replace the letters (D = 13, E = 14):
370400440532013000131400. - Take the remainder after dividing by 97 (here 9) and subtract it from 98: 98 − 9 = 89. Results below 10 get a leading zero.
The IBAN is DE89 3704 0044 0532 0130 00. Banks calculate IBANs for their customers; developers mainly need this step to build test data, and the validator's generator does exactly this for random BBANs.
What the Check Catches, and What It Does Not
- Caught every time: one wrong digit, and two neighbouring digits swapped. Because 97 is a prime larger than any difference these mistakes can make, the remainder always changes.
- Caught by the format: a wrong length, or a letter where the country expects a digit. This is why the validator checks the registry format first.
- Not checked: national check digits inside the BBAN, such as Spain's two control digits, Italy's CIN letter or the French RIB key. A bank may still reject an IBAN that passes MOD 97.
- Not knowable from the number: whether the account exists, is open, can receive payments or belongs to the person you expect.
Writing an IBAN
On paper an IBAN is written in groups of four characters from the left, separated by spaces; the last group can be shorter. In electronic payment messages it is written without spaces. The Central Bank of the UAE gives the example AE07 0331 2345 6789 0123 456 for print. Both forms are the same IBAN, so a form should accept either and store one.
IBANs in Software
- Strip spaces and hyphens, convert to capitals and store the electronic form; show the print form to people.
- Check the country code against the registry, then the length and layout, then MOD 97. Give a specific message for each failure: "22 characters expected" is more useful than "invalid".
- Do not convert the IBAN to a floating-point number. Compute the remainder piece by piece or with arbitrary-precision integers.
- SWIFT publishes new registry releases when countries join or change formats. Keep a copy of the registry with its release number and update it.
- Treat IBANs as personal data: keep them out of URLs, logs and analytics, and use generated test IBANs in development.
Frequently Asked Questions
Is an IBAN the same as a SWIFT/BIC code?
No. The IBAN identifies an account; the BIC (often called the SWIFT code) identifies a bank. Some payments need both.
Why does my country not appear in the validator?
The validator lists the 89 countries of SWIFT IBAN Registry release 103. Countries such as the United States, Canada, China, Japan and South Korea are not in the registry and use other account formats.
Can I work out an IBAN from a bank code and account number myself?
The check digits can be calculated, but some countries have special conversion rules for certain banks. Take the IBAN from a bank statement or online banking rather than building it yourself.
Does the validator send my IBAN anywhere?
No. The check runs in your browser; only the registry data file is loaded from LeedyBox.
Sources
Source: SWIFT: IBAN Registry, Release 103 (September 2026) · Last checked:
Source: Central Bank of the Republic of Türkiye: Communiqué on the International Bank Account Number (No. 2008/6) · Last checked:
Source: Central Bank of the UAE: IBAN · Last checked: