IBAN Generator and Validator - MOD 97 Check Tool
Generate valid test IBANs for 10 European countries or validate an IBAN with the MOD 97 check-digit formula. Runs in the browser with no data sent to a server.
IBAN Generator & Validator
Documentation
IBAN Generator and Validator Tool
An IBAN (International Bank Account Number) is a standard code that identifies a bank account for international payments. This tool generates random, correctly formatted test IBANs for ten European countries, and checks whether an existing IBAN is valid using the MOD 97 check-digit formula that banks use.
What is an IBAN?
Before IBANs existed, every country used its own bank account number format. Cross-border payments often failed because a number that was valid in one country meant nothing in another. The International Organization for Standardization (ISO) created the IBAN standard, ISO 13616, to fix this. Every IBAN carries a country code and two check digits that let a computer catch most typing errors before a payment is sent.
An IBAN has three parts:
- Country code: two letters, such as
DEfor Germany orGBfor the United Kingdom. - Check digits: two digits calculated with the MOD 97 formula, explained below.
- Basic Bank Account Number (BBAN): a country-specific block that usually contains a bank code, sometimes a branch code, and an account number.
IBANs can hold up to 34 characters, but most European ones are 16 to 28 characters long. The length and internal layout depend entirely on the country. A German IBAN is 22 characters; a French one is 27.
IBAN structure by country
| Country | Length | Structure | Example |
|---|---|---|---|
| Germany (DE) | 22 | DE2!n8!n10!n | DE89370400440532013000 |
| United Kingdom (GB) | 22 | GB2!n4!a6!n8!n | GB29NWBK60161331926819 |
| France (FR) | 27 | FR2!n5!n5!n11!c2!n | FR1420041010050500013M02606 |
| Spain (ES) | 24 | ES2!n4!n4!n1!n1!n10!n | ES9121000418450200051332 |
| Italy (IT) | 27 | IT2!n1!a5!n5!n12!c | IT60X0542811101000000123456 |
| Netherlands (NL) | 18 | NL2!n4!a10!n | NL91ABNA0417164300 |
| Switzerland (CH) | 21 | CH2!n5!n12!c | CH9300762011623852957 |
| Austria (AT) | 20 | AT2!n5!n11!n | AT611904300234573201 |
| Belgium (BE) | 16 | BE2!n3!n7!n2!n | BE68539007547034 |
| Poland (PL) | 28 | PL2!n8!n16!n | PL61109010140000071219812874 |
In the structure column, n means a digit, a means a letter, and c means either a letter or a digit. The number before each letter is how many characters that part uses. For example, 4!a6!n8!n in the UK format means four letters, then six digits, then eight digits.
How to calculate IBAN check digits (the MOD 97 formula)
The check digits are calculated with the algorithm from ISO 7064, known as MOD 97-10. To generate check digits for a new IBAN:
- Write the BBAN, followed by the country code, followed by the placeholder
00. - Replace each letter with a number: A = 10, B = 11, and so on through Z = 35. Digits stay as they are.
- Read the whole result as one long number and find the remainder when it is divided by 97.
- Subtract that remainder from 98. The result is the two check digits. If the result is a single digit, add a leading zero.
As a formula: check digits = 98 − (N mod 97), where N is the numeric string built in steps 1 and 2.
Example: calculating the check digits for a German IBAN
Take a German bank code 37040044 and account number 0532013000.
- BBAN + country +
00:370400440532013000+DE+00=370400440532013000DE00 - Replace letters: D = 13, E = 14, so the string becomes
370400440532013000131400. - That number divided by 97 leaves a remainder of 9.
- 98 − 9 = 89.
The check digits are 89, so the finished IBAN is DE89370400440532013000.
How to validate an IBAN
To check whether an existing IBAN is valid, the process runs in the other direction:
- Remove any spaces and move the first four characters (country code and check digits) to the end of the string.
- Replace each letter with a number using the same A = 10 to Z = 35 rule.
- Find the remainder when the resulting number is divided by 97.
- The IBAN is valid only if the remainder equals 1.
This one rule catches almost every common data-entry mistake, including a single wrong digit or two swapped digits, because changing any character almost always changes the remainder.
Before running the MOD 97 check, this tool also verifies that the country code is recognized, that the IBAN has the exact length required for that country, and that letters and digits appear only where the country's format allows them. Each check produces its own error message, so a failure points to the specific problem instead of a generic "invalid" result.
Using the tool
Generator tab: pick a country from the dropdown and click "Generate IBAN." The tool builds a random BBAN in the correct format for that country, calculates matching check digits, and displays the result with a breakdown of its parts. A "Copy to clipboard" button copies the finished IBAN.
Validator tab: type or paste an IBAN, with or without spaces. The tool checks it as you type and shows whether it is valid. For a valid IBAN, it displays the country code, check digits, bank code, branch code (where the country format includes one), and account number.
Because the country code sits in the first two characters, the validator does not need the country selected manually; it reads the code and applies the matching rules automatically.
Everything runs in the browser. No IBAN is sent to a server or stored anywhere.
Why this tool is useful for testing
Software that handles payments needs test data that behaves like a real IBAN but is not tied to a real account. A string of random digits usually fails the MOD 97 check, so tests built on it can fail for the wrong reason: bad test data, not a bug in the code being tested. Generating a properly formatted IBAN avoids that problem, because it passes the same validation a production system would run, while carrying no connection to any actual bank account.
Frequently asked questions
What is an IBAN used for? It identifies a specific bank account for international and domestic transfers, using a format that computers can check for errors before a payment is sent.
Are the IBANs this tool generates connected to real bank accounts? No. They are random numbers that follow the correct format and pass the MOD 97 check, but they do not correspond to any real account. They should be used only for testing, development, or education, never for actual transfers.
Why do IBANs have different lengths in different countries? Each country designed its own Basic Bank Account Number format before the IBAN standard combined them under one country code and check-digit system. ISO 13616 fixed the length for each country but did not force every country to use the same internal layout.
Do spaces in an IBAN matter?
No. IBANs are often shown in groups of four characters for readability, such as DE89 3704 0044 0532 0130 00, but the spaces have no effect on validation. DE89370400440532013000 is the same IBAN with the spaces removed.
Which countries does this tool support? Ten European countries: Germany, the United Kingdom, France, Spain, Italy, the Netherlands, Switzerland, Austria, Belgium, and Poland.
What is the difference between an IBAN and a SWIFT/BIC code? A SWIFT/BIC code identifies a bank or a bank branch. An IBAN identifies one specific account at that bank. International transfers often need both: the SWIFT/BIC code routes the payment to the right bank, and the IBAN routes it to the right account.
References
- ISO 13616-1:2007 — IBAN structure specification.
- SWIFT IBAN Registry — official country-by-country IBAN formats.
- ISO 7064:2003 — check character systems, including MOD 97-10.