IBAN validation: how does the checksum work?
The IBAN contains a built-in error-detection mechanism. Understanding how the mod-97 checksum works helps you detect errors before they block your payments.
What is an IBAN?
The IBAN (International Bank Account Number) is an internationally standardized bank account number defined by ISO 13616. It is used across the SEPA zone and in over 80 countries to uniquely identify a bank account.
An IBAN consists of: a 2-letter country code, a 2-digit check number (checksum), and a Basic Bank Account Number (BBAN) whose format varies by country. For example, a Belgian IBAN has 16 characters: BE68539007547034.
The check digits (positions 3-4) are computed using the mod-97 algorithm, ensuring that transcription errors can be detected before a payment is submitted to the banking network.
How the mod-97 checksum works
The IBAN checksum uses the modulo-97 algorithm (ISO 7064). To verify an IBAN:
- 1Move the first 4 characters to the end of the string
- 2Replace each letter with its numeric equivalent (A=10, B=11, ..., Z=35)
- 3Calculate the remainder of this number divided by 97
- 4The IBAN is valid if the remainder equals 1
This simple mathematical check catches 98% of single-character transcription errors — making it one of the most effective validation mechanisms in financial systems.
Common IBAN errors
These are the most frequent mistakes encountered in SEPA payment files:
Invalid checksum
A typo in the account number changes the mod-97 result. Even a single digit error is detected.
Wrong country format
Each country has a fixed IBAN length. A Belgian IBAN always has 16 characters, a French IBAN 27. A length mismatch is immediately invalid.
Spaces and formatting
IBANs are sometimes written with spaces every 4 characters for readability (BE68 5390 0754 7034). In payment files, they must be sent without any spaces.
Missing or extra characters
IBANs have a fixed length per country. Adding or removing a character always breaks the checksum.
Lowercase letters
The IBAN standard uses uppercase only. Some systems reject lowercase IBANs even though the checksum would be identical.
Confusing O/0 or I/1
The letter O and digit 0, or I and 1, are commonly swapped. The checksum detects this but the error message may not be obvious.
IBAN formats by country
Each SEPA country has its own IBAN length and BBAN structure. The table below shows the most common European formats:
| Country | Code | Length | BBAN format | Example |
|---|---|---|---|---|
| Belgium | BE | 16 | 3n 7n 2n | BE68 5390 0754 7034 |
| France | FR | 27 | 5n 5n 11c 2n | FR76 3000 6000 0112 3456 7890 189 |
| Germany | DE | 22 | 8n 10n | DE89 3704 0044 0532 0130 00 |
| Netherlands | NL | 18 | 4a 10n | NL91 ABNA 0417 1643 00 |
| Spain | ES | 24 | 4n 4n 1n 1n 10n | ES91 2100 0418 4502 0005 1332 |
| Italy | IT | 27 | 1a 5n 5n 12c | IT60 X054 2811 1010 0000 0123 456 |
| Portugal | PT | 25 | 4n 4n 11n 2n | PT50 0002 0123 1234 5678 9015 4 |
| Austria | AT | 20 | 5n 11n | AT61 1904 3002 3457 3201 |
| Luxembourg | LU | 20 | 3n 13c | LU28 0019 4006 4475 0000 |
| Ireland | IE | 22 | 4a 6n 8n | IE29 AIBK 9311 5212 3456 78 |
| Finland | FI | 18 | 3n 11n | FI21 1234 5600 0007 85 |
| Poland | PL | 28 | 8n 16n | PL61 1090 1014 0000 0712 1981 2874 |
| Switzerland | CH | 21 | 5n 12c | CH93 0076 2011 6238 5295 7 |
| Sweden | SE | 24 | 3n 16n 1n | SE45 5000 0000 0583 9825 7466 |
| Denmark | DK | 18 | 4n 9n 1n | DK50 0040 0440 1162 43 |
This list covers the main SEPA countries. For a complete reference, consult the SWIFT IBAN Registry published quarterly.
IBAN validation in SEPA payment files
When you generate SEPA XML files (pain.001 or pain.008), every IBAN in the file must pass the mod-97 check. Banks will reject the entire batch if a single IBAN is invalid.
This is why pre-validating IBANs before generating your payment file is critical. ValidateFin's SEPA converter validates every IBAN automatically during CSV import.
Beyond the checksum, some banks also verify that the BBAN portion matches their internal routing structure. This second-level check is bank-specific and cannot be done with mod-97 alone.
Validate your IBANs for free
Our IBAN validator checks the mod-97 checksum, the country format, and the length — instantly, without sending any data to a server.
Open the IBAN ValidatorFrequently Asked Questions
How does the mod-97 IBAN checksum algorithm work?
The mod-97 algorithm validates an IBAN by: moving the first 4 characters (country code + check digits) to the end, converting all letters to numbers (A=10, B=11...Z=35), then computing the remainder when divided by 97. A valid IBAN always produces a remainder of 1.
Which countries use IBAN and what are the different formats?
Over 80 countries use IBAN, with all 36 SEPA countries requiring it. Formats vary: Belgian IBANs have 16 characters, French IBANs 27 characters, German IBANs 22 characters, and Dutch IBANs 18 characters. Each country has specific BBAN structure rules.
Can an IBAN pass checksum validation but still be invalid?
Yes. The mod-97 checksum verifies mathematical integrity but cannot confirm the account exists at a real bank. For payment processing, always complement checksum validation with your bank's pre-validation service.
Why does my IBAN fail validation even though it looks correct?
Common causes include: invisible characters (non-breaking spaces, tabs), wrong country code, mixed case letters, or a copy-paste error that changed a digit. Try removing all spaces and re-checking the checksum.
Is IBAN validation enough to ensure a payment will succeed?
No. IBAN validation confirms mathematical integrity, but the account may be closed, frozen, or belong to a different person. For high-value payments, ask the beneficiary to confirm their IBAN through a verified channel.
What happens if I submit a SEPA file with an invalid IBAN?
The bank will reject the entire payment file or the individual transaction depending on the error. Most banks validate IBANs at submission time and return a pain.002 (status report) indicating the rejection reason.
Can I validate IBANs in bulk?
Yes. ValidateFin's IBAN validator accepts multiple IBANs at once. You can also use the CSV to SEPA converter which validates all IBANs automatically during import.
Do all countries use the same IBAN format?
No. Each country defines its own IBAN length and BBAN structure. Belgian IBANs have 16 characters, French 27, German 22, and so on. The first two letters are always the ISO country code.
Is the BIC required alongside the IBAN?
Within the SEPA zone, the BIC is generally optional for domestic transfers since 2016. However, it remains mandatory for cross-border payments to non-SEPA countries and may be required by some banks.
What is the difference between IBAN and BBAN?
BBAN (Basic Bank Account Number) is the national account number format. IBAN wraps the BBAN with a country code and 2 check digits, creating an internationally standardized format. The BBAN is always the part after the first 4 characters of an IBAN.