IBAN generation is the process of converting domestic bank account details — such as a bank code, branch identifier, and account number — into a standardized International Bank Account Number. The process follows the rules defined in ISO 13616, which specifies the structure and check-digit calculation for IBANs worldwide. If you are unfamiliar with IBANs, our guide on what an IBAN is and how it works provides the essential background. This guide focuses specifically on how IBANs are assembled from their component parts, walks through a complete worked example, and covers country-specific considerations that affect the generation process.
A common misconception is that "generating an IBAN" means creating a new bank account. It does not. IBAN generation takes your existing domestic bank details and reformats them into the internationally recognized IBAN structure. Your bank code, branch identifier, and account number are preserved in their entirety — the process simply wraps them in a standardized envelope by prepending a two-letter country code and a two-digit checksum.
Think of it like converting a local postal address into an international mailing format. The underlying address does not change; it is simply presented in a way that postal systems around the world can process consistently. Similarly, your domestic bank details remain the same — the IBAN format just makes them universally readable by banking systems in over 80 countries.
The domestic portion of the IBAN is called the BBAN (Basic Bank Account Number). Each country defines its own BBAN structure — specifying which positions hold the bank code, which hold the branch code, and which hold the account number. The IBAN generation process assembles the BBAN according to these country-specific rules and then computes the check digits that protect against transcription errors.
Generating an IBAN from domestic bank details follows a precise sequence of steps. Each step must be performed correctly for the resulting IBAN to be valid.
DE for Germany, GB for the United Kingdom, or FR for France.Let's walk through the generation of the German IBAN DE89 3704 0044 0532 0130 00 from its domestic components: bank code 37040044 and account number 0532013000.
Step 1: Assemble the BBAN
Germany's BBAN format is 18 digits: 8-digit bank code (Bankleitzahl) followed by a 10-digit account number. Concatenate them:
BBAN = 370400440532013000
Step 2: Create the placeholder IBAN
Prepend the country code and temporary check digits 00 to the BBAN:
DE00370400440532013000
Step 3: Rearrange for MOD-97
Move the first four characters (DE00) to the end:
370400440532013000DE00
Step 4: Convert letters to numbers
Replace each letter with its numeric equivalent: D = 13, E = 14. The string becomes:
370400440532013000131400
Step 5: Compute MOD 97
Divide the numeric string by 97 and take the remainder. Using the chunking method (processing 9 digits at a time to stay within standard integer limits):
370400440 MOD 97 = 29295320130 MOD 97 = 70700013140 MOD 97 = 29290 MOD 97 = 9The remainder is 9.
Step 6: Calculate the check digits
Check digits = 98 – remainder = 98 – 9 = 89. Since the result is already two digits, no zero-padding is needed.
Final IBAN: DE89 3704 0044 0532 0130 00
You can verify this result by running the generated IBAN through the MOD-97 validation algorithm: rearrange, convert, and divide by 97 — the remainder should be exactly 1.
While the check-digit calculation is universal (MOD-97 per ISO 7064), the BBAN structure varies significantly between countries. Some countries also include national check digits within the BBAN, adding an extra layer of validation that must be computed correctly during generation.
France — RIB Key
French IBANs are 27 characters long. The BBAN contains a 5-digit bank code, a 5-digit branch code (code guichet), an 11-character account number (which may include letters), and a 2-digit RIB key. The RIB key is a national check digit calculated as 97 – ((bank code × 89 + branch code × 15 + account number × 3) MOD 97). This key must be computed and included in the BBAN before the IBAN check digits are calculated. An incorrect RIB key will produce an IBAN that passes MOD-97 validation but may be rejected by French banks during processing.
Spain — CCC Check Digits
Spanish IBANs are 24 characters long. The 20-digit BBAN includes a 4-digit bank code, a 4-digit branch code, a 2-digit national control code (the CCC check digits), and a 10-digit account number. The CCC check digits are calculated using a weighted modulus-11 algorithm applied separately to the bank/branch portion and the account number. Both national check digits must be correct before the IBAN's MOD-97 check digits are computed.
Belgium — MOD-97 National Check
Belgian IBANs are 16 characters long. The 12-digit BBAN comprises a 3-digit bank code, a 7-digit account number, and a 2-digit national check digit. The national check digit is calculated as the first 10 digits of the BBAN MOD 97 (with 00 replaced by 97 when the remainder is 0). This national check digit is independent of the IBAN-level MOD-97 check digits, meaning Belgian IBANs effectively have two layers of checksum protection.
When generating IBANs for countries with national check digits, you must compute those national digits first, then assemble the complete BBAN, and finally compute the IBAN-level check digits. Skipping the national check digit step will produce an IBAN that may pass basic MOD-97 validation but will fail country-specific validation at the receiving bank.
For practical purposes, using an IBAN generator tool is almost always the right choice. Generators eliminate human error in every step of the process — from looking up the correct BBAN length to computing check digits. A single misplaced digit or forgotten leading zero will produce an invalid IBAN, and manually computing MOD-97 on a 24-digit number is tedious and error-prone.
That said, understanding the manual process has real value. Developers building payment systems need to know how the algorithm works to implement it correctly, debug validation failures, and write meaningful tests. Compliance officers benefit from understanding the mechanics when auditing payment processing systems. And anyone who works with IBANs regularly will make fewer mistakes if they understand the structure behind the numbers.
The key distinction is: use a generator for production work and real transactions, but understand the manual process so you can verify results and troubleshoot problems when they arise.
Even with a solid understanding of the process, certain mistakes come up repeatedly. Being aware of them helps you avoid generating invalid IBANs:
532013000 (9 digits), it must be padded to 0532013000 (10 digits). Omitting the leading zero shifts every subsequent digit, producing an entirely different (and likely invalid) IBAN.06, not just 6.The following table shows the IBAN length and BBAN structure for commonly used countries. Refer to the SWIFT IBAN Registry for the complete list.
| Country | Code | IBAN Length | BBAN Format |
|---|---|---|---|
| Germany | DE | 22 | 8n bank + 10n account |
| United Kingdom | GB | 22 | 4a bank + 6n sort + 8n account |
| France | FR | 27 | 5n bank + 5n branch + 11c acct + 2n key |
| Spain | ES | 24 | 4n bank + 4n branch + 2n ctrl + 10n acct |
| Netherlands | NL | 18 | 4a bank + 10n account |
| Italy | IT | 27 | 1a ctrl + 5n bank + 5n branch + 12c acct |
| Norway | NO | 15 | 4n bank + 6n account + 1n ctrl |
In the BBAN format column, n indicates numeric digits, a indicates uppercase letters, and c indicates alphanumeric characters (letters or digits).
DE89 3704 0044 0532 0130 00, you can extract the bank code 37040044 (positions 5–12) and the account number 0532013000 (positions 13–22). Our IBAN validator performs this breakdown automatically.Ready to convert your domestic bank details into an IBAN? Use our IBAN generator to assemble a valid IBAN from your bank code and account number. The tool handles country-specific BBAN formats, national check digits, and MOD-97 calculation automatically. All processing runs entirely in your browser — no bank details are sent to any server.
Back to all guides.