IBAN format fixtures
Generate country-shaped examples, or check country, length, BBAN structure and MOD-97 separately.
No bank/account lookup. National checksums and account existence are not checked. Do not send transfers to generated values.
Check a synthetic IBAN
An IBAN format check answers several questions. A MOD-97 remainder of one is only the final arithmetic check; it cannot establish whether a country code is supported or whether a letter belongs in a numeric field. This generator and checker share one versioned country profile.
Three inputs a checksum-only validator gets wrong
| Synthetic input | Expected local result | Why |
|---|---|---|
ZZ73123456789012345678 | Unsupported country | ZZ is absent from the supported profile, although MOD-97 passes |
DE24A23456789012345678 | Invalid BBAN structure | Germany’s BBAN is numeric; the letter is illegal even with passing check digits |
TR7112345A1234567890123456 | Invalid BBAN structure | A letter occupies Türkiye’s reserved field |
DE88370400440532013000 | Checksum failed | The supported shape passes but the check digits do not |
DE89370400440532013000 | Local format checks passed | Country, length, numeric BBAN and MOD-97 pass; no account check occurs |
These exact inputs are in the shared case file. The buttons above load the first three failure scenarios and a passing format. Lowercase ASCII letters are uppercased and spaces are removed; punctuation, line breaks and non-ASCII digits are rejected rather than silently repaired.
Country structure before arithmetic
The SWIFT IBAN Registry supplies country layouts. This tool includes 33 selected profiles; it does not cover every registered country. In the profile notation, n means ASCII digits, a uppercase letters and c either. Counts describe consecutive BBAN fields, after the four-character country/check-digit prefix.
| Country | Length | BBAN fields | Fixed field |
|---|---|---|---|
| Albania (AL) | 28 | 8n,16c | None in this profile |
| Austria (AT) | 20 | 16n | None in this profile |
| Belgium (BE) | 16 | 12n | None in this profile |
| Bulgaria (BG) | 22 | 4a,6n,8c | None in this profile |
| Switzerland (CH) | 21 | 5n,12c | None in this profile |
| Cyprus (CY) | 28 | 8n,16c | None in this profile |
| Czechia (CZ) | 24 | 20n | None in this profile |
| Germany (DE) | 22 | 18n | None in this profile |
| Denmark (DK) | 18 | 14n | None in this profile |
| Estonia (EE) | 20 | 16n | None in this profile |
| Spain (ES) | 24 | 20n | None in this profile |
| Finland (FI) | 18 | 14n | None in this profile |
| France (FR) | 27 | 10n,11c,2n | None in this profile |
| United Kingdom (GB) | 22 | 4a,14n | None in this profile |
| Greece (GR) | 27 | 7n,16c | None in this profile |
| Croatia (HR) | 21 | 17n | None in this profile |
| Hungary (HU) | 28 | 24n | None in this profile |
| Ireland (IE) | 22 | 4a,14n | None in this profile |
| Iceland (IS) | 26 | 22n | None in this profile |
| Italy (IT) | 27 | 1a,10n,12c | None in this profile |
| Lithuania (LT) | 20 | 16n | None in this profile |
| Luxembourg (LU) | 20 | 3n,13c | None in this profile |
| Latvia (LV) | 21 | 4a,13c | None in this profile |
| Malta (MT) | 31 | 4a,5n,18c | None in this profile |
| Netherlands (NL) | 18 | 4a,10n | None in this profile |
| Norway (NO) | 15 | 11n | None in this profile |
| Poland (PL) | 28 | 24n | None in this profile |
| Portugal (PT) | 25 | 21n | None in this profile |
| Romania (RO) | 24 | 4a,16c | None in this profile |
| Sweden (SE) | 24 | 20n | None in this profile |
| Slovenia (SI) | 19 | 15n | None in this profile |
| Slovakia (SK) | 24 | 20n | None in this profile |
| Türkiye (TR) | 26 | 5n,1n,16c | BBAN position 6 = 0 |
For Türkiye, the profile is five bank-code digits, a reserved zero and sixteen alphanumeric account characters. The Central Bank’s IBAN information shows that reserved field explicitly. The generator writes zero there and the checker rejects a different value.
The implementation checks the country and its BBAN before running MOD-97:
export function inspectIban(input, profile) {
if (typeof input !== 'string' || /[^A-Za-z0-9 \u00a0]/u.test(input)) return { status: 'characters' };
const value = input.replace(/[ \u00a0]/g, '').toUpperCase();
if (!value) return { status: 'empty' };
if (!/^[A-Z]{2}[0-9]{2}[A-Z0-9]+$/.test(value)) return { status: 'format' };
const code = value.slice(0, 2), rule = profile.countries[code];
if (!rule) return { status: 'unsupported-country', code };
if (value.length !== rule.length) return { status: 'length', country: rule.name, expected: rule.length, got: value.length };
const bban = value.slice(4);
if (!bbanPattern(rule).test(bban) || Object.entries(rule.fixed || {}).some(([index, char]) => bban[Number(index)] !== char)) {
return { status: 'bban', country: rule.name };
}
return { status: ibanRemainder(value) === 1 ? 'pass' : 'checksum', country: rule.name, value };
}bbanPattern and ibanRemainder, used by this excerpt, are supplied in the complete module. Domestic checksum rules embedded inside some BBANs are outside this tool’s scope. Generated random bank/account fields can therefore fail a banking system’s additional validation even when every local check passes.
Long values and export tests
Norway’s profile uses 15 characters; Malta’s uses 31. Test both ends of the form and database field, rather than assuming one universal length. The arithmetic rotates the first four characters, expands letters as A=10 through Z=35, and carries a remainder at each digit. It never converts the entire expanded value to a floating-point number.
The automated test generates 20 examples for each of the 33 countries. It checks length and structure, then computes the remainder independently using BigInt. Additional assertions protect numeric-only German BBANs and Türkiye’s reserved zero. CSV exports compact IBAN strings with their country codes; display grouping is not included in the stored identifier.
Download the IBAN cases and runnable project
and run node --test data-tools.test.mjs after extraction. The QA data guide explains how to pin these examples. For card-number checks use the card validator; card Luhn arithmetic and IBAN MOD-97 are different algorithms. The form-testing checklist separates format outcomes from application acceptance rules.
Updated 8 November 2026: country support and BBAN structure are now checked explicitly. Earlier claims that generated values could never coincide with real accounts have been removed.