Anatomy of an IBAN: country code, check digits and BBAN
Every IBAN is built from the same three parts: a two-letter ISO country code, two check digits, and the BBAN — the Basic Bank Account Number whose length and internal layout each country defines for itself. Take GB29 NWBK 6016 1331 9268 19: GB identifies the United Kingdom, 29 are the check digits, and NWBK 6016 1331 9268 19 is the BBAN holding the bank identifier, sort code and account number.
When you paste an IBAN into the validator, it removes the spaces, converts everything to uppercase and splits the string at exactly these boundaries, showing the country code, check digits, BBAN and total character count. The format check then tests the generic IBAN pattern — two letters, two digits, then letters or digits — using the regular expression ^[A-Z]{2}[0-9]{2}[A-Z0-9]+$, while the length check compares the total against the official length registered for that country.