IBAN Validator & Generator
How to use this IBAN validator and generator
This page helps you do two common tasks with an IBAN (International Bank Account Number): generate the two check digits for a country code plus a BBAN, and validate an existing IBAN against both the registered length for its country and the ISO 7064 MOD 97-10 checksum. Everything runs client-side in your browser, so the values you type are never sent to a server.
What you can do here
- Generate an IBAN from a two-letter country code (for example
DE) and a BBAN, the domestic account format for that country. - Validate an IBAN: the tool cleans up spaces and hyphens, checks the alphabet, compares the length against the registered length for the country, verifies that the check digits fall in the legal range 02 to 98, and finally runs the MOD 97-10 test.
- Read the remainder: the result panel prints the rearranged numeric string and the actual remainder, so a failing IBAN tells you how far off it is rather than just saying "invalid".
- Copy the result to your clipboard with the "Copy Result" button once a valid IBAN is on screen.
IBAN structure under ISO 13616
An IBAN is made of a country code (two letters, from ISO 3166-1 alpha-2), two check digits, and the BBAN (the country-specific account details, which may contain a bank code, a branch code, an account number and sometimes a national check character). The total length is fixed for each country and never exceeds 34 characters. Norway uses the shortest IBAN at 15 characters; Malta uses one of the longest at 31. The check digits are always characters three and four, and they always fall between 02 and 98 because the generating formula subtracts a remainder in the range 0 to 96 from 98.
The MOD 97-10 formula behind IBAN validation
IBAN validation is defined by ISO 13616-1, which applies the MOD 97-10 procedure from ISO 7064. The steps are:
- Remove spaces and punctuation, then uppercase the IBAN.
- Move the first four characters (country code plus check digits) to the end of the string.
- Replace every letter with a two-digit number using A=10, B=11, …, Z=35; digits stay as they are.
- Interpret the result as one large integer and compute its remainder modulo 97.
The IBAN is mathematically valid when that remainder equals one: . N mod 97 equals 1
When generating check digits the same machinery runs in reverse: take
BBAN + country + "00", convert letters to numbers, compute the remainder, then set
checkDigits = 98 − (N mod 97) and left-pad the answer to two digits. Because the integer can be
forty digits long, both directions are computed with Horner's method, folding the string a few digits at a time
and taking the remainder at each step so no value ever exceeds the range a browser can hold exactly.
Worked example: generating the check digits for a German BBAN
Take the German BBAN 370400440532013000 with country code DE. Append the country code
and the placeholder digits to get 370400440532013000DE00, then transliterate
D to 13 and E to 14, giving 370400440532013000131400. Dividing that
24-digit integer by 97 leaves a remainder of 9, so the check digits are
and the IBAN is DE89 3704 0044 0532 0130 00. Paste that into the validator: it is 22 characters,
which matches the registered German length, and the rearranged string
370400440532013000131489 leaves a remainder of exactly 1.
Assumptions and limitations of this IBAN tool
- Checksum and length only: passing both tests means the IBAN is structurally well formed, not that the account exists or can receive payments.
- Registry coverage: the built-in length table covers the countries listed below plus the rest of the SEPA area. For a country code outside the table the tool still runs MOD 97-10 but reports that the length could not be confirmed.
- No BBAN sub-structure: national bank-code and branch-code layouts, and the extra national check characters used by countries such as France, Italy, Spain and Belgium, are not validated here.
- Allowed characters: inputs must be letters A–Z and digits 0–9. Spaces, hyphens and full stops are stripped from the IBAN field before checking, and lower case is upper-cased.
Introduction: understanding the International Bank Account Number
The International Bank Account Number, or IBAN, is a standardized method for identifying bank accounts across national borders. Developed by the International Organization for Standardization and the European Committee for Banking Standards, it simplifies cross-border transactions by providing a consistent format recognized in over seventy countries. An IBAN is composed of a two-letter country code, two check digits, and a Basic Bank Account Number (BBAN) containing domestic routing information. Because banks have different account structures, the BBAN portion can vary in length and content, but the presence of a unified country code and checksum ensures that any IBAN can be validated in a predictable way. This standardization reduces errors, speeds up payments, and helps financial institutions meet anti-fraud obligations.
At the heart of IBAN verification lies a simple modular arithmetic trick known as the MOD97 algorithm. The algorithm converts the entire IBAN into a large integer, moves the four initial characters to the end, and computes the remainder when dividing by ninety-seven. If the resulting value equals one, the IBAN is mathematically valid. This approach is surprisingly efficient: even though an IBAN can consist of up to thirty-four alphanumeric characters, computers can handle the calculation quickly because it proceeds digit by digit rather than attempting to hold the massive number in memory. When generating an IBAN, the process runs in reverse. The country code and a placeholder of "00" for check digits are appended to the BBAN, the modulo operation is performed, and the check digits are set to . This ensures that any subsequent validation will return the required remainder of one.
Because IBAN implementations differ by country, knowing the expected length is crucial. Germany uses twenty-two characters, France uses twenty-seven, and the United Kingdom uses twenty-two as well. The table below lists several commonly used countries, their registered IBAN lengths and the shape of their BBAN as published in the SWIFT IBAN Registry. If a user enters an IBAN of the wrong length for a given country, the validation routine should immediately flag the error before even running the checksum, because a length error tells you something the checksum cannot: which country rule was broken. This tool performs such a check, offering a first line of defense against truncated or duplicated characters. Consistency in length also aids data entry systems, allowing them to allocate the correct number of input fields or enforce character limits without consulting external databases.
| Country | Code | IBAN length | BBAN shape | Example IBAN |
|---|---|---|---|---|
| Norway | NO | 15 | 11 digits | NO93 8601 1117 947 |
| Belgium | BE | 16 | 12 digits | BE68 5390 0754 7034 |
| Netherlands | NL | 18 | 4 letters + 10 digits | NL91 ABNA 0417 1643 00 |
| Austria | AT | 20 | 16 digits | AT61 1904 3002 3457 3201 |
| Switzerland | CH | 21 | 5 digits + 12 alphanumeric | CH93 0076 2011 6238 5295 7 |
| Germany | DE | 22 | 18 digits | DE89 3704 0044 0532 0130 00 |
| United Kingdom | GB | 22 | 4 letters + 14 digits | GB29 NWBK 6016 1331 9268 19 |
| Spain | ES | 24 | 20 digits | ES91 2100 0418 4502 0005 1332 |
| Saudi Arabia | SA | 24 | 2 digits + 18 alphanumeric | SA03 8000 0000 6080 1016 7519 |
| France | FR | 27 | 10 digits + 11 alphanumeric + 2 digits | FR14 2004 1010 0505 0001 3M02 606 |
| Poland | PL | 28 | 24 digits | PL61 1090 1014 0000 0712 1981 2874 |
The MOD97 algorithm’s elegance can be shown in a compact equation. Let denote the numeric representation obtained after rearranging and converting letters to numbers. Validation checks that . When generating check digits, we compute , and pad the result with a leading zero if necessary. The algorithm relies on the property that the numeric conversion of letters uses the mapping A=10, B=11, ..., Z=35. Because modular arithmetic is associative, we can process the digits sequentially, taking the remainder at each step to avoid handling huge intermediate numbers. This is especially important in browser-based tools where the integer size is limited; iteratively reducing ensures accuracy without requiring special libraries.
Consider a German bank account with BBAN 370400440532013000. To generate its IBAN, we start by appending the country code "DE" and placeholder check digits "00" to the end of the BBAN, yielding 370400440532013000DE00. Replacing letters with numbers gives 370400440532013000131400. We then compute the remainder when dividing this number by ninety-seven. The remainder is . The check digits are , so the final IBAN becomes DE89 3704 0044 0532 0130 00. Entering this result into the validator will confirm its correctness. Each step is deterministic, meaning two people following the same procedure will always derive identical check digits, a property essential for global banking networks that must interoperate without ambiguity.
It is worth noting that an IBAN validates only the structure of an account number, not its existence. A fictitious account could still produce a correct checksum, so banks combine IBAN checks with other verification processes such as account name matching and transaction histories. In the European Union the Instant Payments Regulation now obliges payment service providers to run a verification-of-payee check that compares the account name against the IBAN before a transfer is confirmed, precisely because the checksum alone cannot catch a well-formed number that belongs to the wrong person. Nonetheless, the checksum catches many common errors, especially those introduced during manual data entry. In regions where IBAN is mandatory for domestic transfers, customers become accustomed to supplying the full number, which has the side benefit of reducing misdirected payments.
From a programming perspective, IBAN validation serves as a gentle introduction to algorithmic thinking. Developers must manipulate strings, map characters to numbers, and handle large integer operations efficiently. The browser-based implementation here demonstrates that such tasks do not require server-side processing; modern JavaScript is fully capable of executing the necessary calculations. By keeping everything client-side, this tool respects privacy and allows experimentation without transmitting sensitive data. Users can safely validate account numbers offline or within secure intranet environments. The use of plain HTML, CSS, and JavaScript also ensures compatibility with a wide range of devices.
While the core logic is compact, real-world IBAN processing involves additional subtleties. Some countries include alphanumeric characters in their BBAN, requiring the same letter-to-number conversion used for the country code. Others embed branch codes or national check digits inside the BBAN: the French RIB key, the Spanish two-digit control, the Italian CIN letter and the Belgian modulo-97 tail are all separate checks that survive inside the IBAN and are not tested by MOD 97-10. This utility keeps things generic, accepting any alphanumeric BBAN and deferring those country-specific rules to the user. If you plan to embed IBAN generation into a production system, consult the official registry maintained by SWIFT, which specifies exact structures for each participating nation. Nonetheless, the MOD97 checksum remains universal, making it the cornerstone of every implementation.
Security-conscious developers sometimes worry that exposing IBAN calculation logic could aid fraudsters. However, the algorithm has been publicly known for decades, and obscurity offers little protection. The real defense lies in authentication, authorization, and monitoring of transactions. By validating IBANs at the point of data entry, banks and businesses can reduce clerical errors that might otherwise be exploited. Education is also vital: encouraging users to double-check their numbers and providing user-friendly tools like this one fosters a culture of accuracy. In international commerce, where payments may cross several intermediaries, getting the IBAN right from the start prevents costly delays.
Finally, it is fascinating to observe how a simple mathematical rule underpins trillions of dollars in global finance. The MOD97 algorithm has no secret ingredients, yet it reliably detects every single-character error and every transposition of two adjacent characters. Its power stems from the same principles that make checksums useful in data transmission and cryptography: a tiny amount of extra information enables robust validation. In the context of IBANs, that extra information comes in the form of two check digits that encode a relationship among all the other characters. Whether you are a software engineer building payment infrastructure or an individual verifying a single account, understanding this mechanism provides insight into the broader world of financial technology. Armed with this knowledge, you can confidently navigate the complexities of international banking.
Mod-97 Conveyor: practising the checksum as a routing decision
The mini-game below turns the algorithm into a clearing-house belt. IBANs ride a conveyor toward a validation gate, and you route each one to the accept chute or the reject chute before it arrives. While a number travels, the canvas performs the real ISO 13616 check on it in slow motion: the first four characters lift off the front and rotate to the tail, letters transliterate to their two-digit values, and the digit string is fed into a remainder wheel a chunk at a time. The wheel is the running value of , and it only settles on its final position shortly before the gate. Decide early on the shape of the number and you score more; wait for the wheel and you score less. The faults are the ones that actually happen at a keyboard.
| Fault | What was changed | Fastest tell |
|---|---|---|
| Clean | Nothing; the check digits were generated for this BBAN | Length matches the badge and the wheel lands on 1 |
| Wrong length | One BBAN character dropped or duplicated | Character count differs from the registered length shown on the crate |
| Bad check pair | The two check digits replaced by another legal-looking pair | Length is right, so only the wheel can tell; watch for a final remainder far from 1 |
| Single typo | One BBAN character swapped for another of the same class | Nothing visual; MOD 97-10 catches every single-character error |
| Adjacent transposition | Two neighbouring characters swapped | Nothing visual; the wheel always leaves 1 when two adjacent characters swap |
| Distant transposition | Two characters four to six places apart swapped | Nothing visual; the near-miss case that makes late levels hard |
Tips for accurate IBAN entry
For best results, paste the IBAN exactly as provided by your bank. Spaces, hyphens and full stops are optional here; the tool strips them. If you are generating an IBAN, make sure your BBAN is already in the correct domestic format for the selected country. Many countries require fixed-length BBANs with specific subfields such as bank code, branch code and account number. If your BBAN is missing digits the generator will still produce mathematically consistent check digits, but the result will not match any real account, which is why the tool warns you when the BBAN length does not match the registered structure for that country code.
Privacy note
This calculator performs all computations in JavaScript on your device. No network requests are required for validation or generation. Still, treat bank details as sensitive: avoid sharing screenshots or copying results into untrusted apps.
IBAN validation questions answered
How does the MOD 97-10 checksum validate an IBAN?
Move the first four characters to the end of the IBAN, replace each letter with a two-digit number (A is 10 through Z is 35), and read the result as one large integer. The IBAN is valid when that integer leaves a remainder of 1 after division by 97. The calculator does this digit by digit so it never has to hold the full number.
How are the two check digits generated?
Put the country code and the placeholder 00 after the BBAN, convert letters to numbers, and take the remainder modulo 97. The check digits are 98 minus that remainder, padded to two digits. For the German BBAN 370400440532013000 the remainder is 9, so the check digits are 89 and the IBAN is DE89 3704 0044 0532 0130 00.
Does a valid IBAN mean the bank account exists?
No. Passing the MOD 97 check only proves the number is structurally well formed and free of common typing errors. The account may not exist or may be closed, so banks pair the checksum with account-name matching and other verification before sending money.
Why does this page also check the IBAN length?
Every country registers a fixed IBAN length in the SWIFT IBAN Registry, from 15 characters in Norway to 31 in Malta. A number can pass MOD 97 and still be the wrong length for its country code, so length is checked first. When the country code is not in the built-in registry the tool reports the checksum result and says the length could not be confirmed.
Is my data sent anywhere when I use this tool?
No. All validation and generation run in JavaScript on your device, and no network request is made. Still, treat bank details as sensitive and avoid pasting results into untrusted apps or sharing screenshots.
Sources: the IBAN format is defined by ISO 13616-1 and the check-character system it uses is MOD 97-10 from ISO 7064. Country codes, registered IBAN lengths and BBAN structures come from the SWIFT IBAN Registry, which is the official registration authority. Payment-scheme usage in Europe follows the European Payments Council SEPA credit transfer scheme.
Mod-97 Conveyor: route the IBANs before the gate
A clearing-house belt feeds IBANs toward a validation gate. Send each one to the accept chute or the reject chute before it reaches the gate. The canvas runs the real ISO 13616 check on the selected crate as it travels: the leading four characters rotate to the tail, letters transliterate to numbers, and the digit string is consumed a chunk at a time by a remainder wheel that spins toward N mod 97. Landing on 1 means valid, and the length badge on the crate must match the registered length for its country. Route early for more points; wait for the wheel and score less.
Press "Start the belt" and then use the keyboard or the pads on the canvas.
- Up Down pick which crate on the belt the remainder wheel is analysing.
- Left arms the reject chute, Right arms the accept chute. A and R do the same, and pressing the same key twice confirms.
- Enter or Space confirms the armed route. P pauses and resumes.
- Pointer or touch: tap a crate to analyse it, tap the ACCEPT or REJECT pad to route it, or drag a crate up to accept and down to reject.
