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 inputExpected local resultWhy
    ZZ73123456789012345678Unsupported countryZZ is absent from the supported profile, although MOD-97 passes
    DE24A23456789012345678Invalid BBAN structureGermany’s BBAN is numeric; the letter is illegal even with passing check digits
    TR7112345A1234567890123456Invalid BBAN structureA letter occupies Türkiye’s reserved field
    DE88370400440532013000Checksum failedThe supported shape passes but the check digits do not
    DE89370400440532013000Local format checks passedCountry, 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.

    CountryLengthBBAN fieldsFixed field
    Albania (AL)288n,16cNone in this profile
    Austria (AT)2016nNone in this profile
    Belgium (BE)1612nNone in this profile
    Bulgaria (BG)224a,6n,8cNone in this profile
    Switzerland (CH)215n,12cNone in this profile
    Cyprus (CY)288n,16cNone in this profile
    Czechia (CZ)2420nNone in this profile
    Germany (DE)2218nNone in this profile
    Denmark (DK)1814nNone in this profile
    Estonia (EE)2016nNone in this profile
    Spain (ES)2420nNone in this profile
    Finland (FI)1814nNone in this profile
    France (FR)2710n,11c,2nNone in this profile
    United Kingdom (GB)224a,14nNone in this profile
    Greece (GR)277n,16cNone in this profile
    Croatia (HR)2117nNone in this profile
    Hungary (HU)2824nNone in this profile
    Ireland (IE)224a,14nNone in this profile
    Iceland (IS)2622nNone in this profile
    Italy (IT)271a,10n,12cNone in this profile
    Lithuania (LT)2016nNone in this profile
    Luxembourg (LU)203n,13cNone in this profile
    Latvia (LV)214a,13cNone in this profile
    Malta (MT)314a,5n,18cNone in this profile
    Netherlands (NL)184a,10nNone in this profile
    Norway (NO)1511nNone in this profile
    Poland (PL)2824nNone in this profile
    Portugal (PT)2521nNone in this profile
    Romania (RO)244a,16cNone in this profile
    Sweden (SE)2420nNone in this profile
    Slovenia (SI)1915nNone in this profile
    Slovakia (SK)2420nNone in this profile
    Türkiye (TR)265n,1n,16cBBAN 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.

    Frequently Asked Questions

    Does a passing result prove that an account exists?
    No. The tool checks its supported country profile, total length, BBAN character layout and MOD-97. It does not check bank allocation, domestic checksums, account existence or transfer acceptance.
    Can generated values match real accounts?
    No lookup is made, so a coincidental match cannot be excluded. Use these values only in isolated format tests, never as transfer destinations.
    Why is an unknown country rejected before the checksum?
    A checksum alone does not establish an IBAN format. An unsupported country is reported as unsupported; the tool does not guess its length or BBAN rules.
    Why does a long IBAN require special arithmetic?
    Its expanded digits exceed ordinary JavaScript integer precision. The implementation streams the remainder digit by digit; tests independently check the result with BigInt.