Spain’s IBAN is a 24-character, fully numeric format built directly on the Código Cuenta Cliente (CCC), the 20-digit domestic account identifier Spaniards used long before SEPA. The BBAN pattern is ^[0-9]{20}$.
Layout of an ES IBAN
The registry example ES91 2100 0418 4502 0005 1332 (a published test value from the SWIFT registry, not a live account) breaks down as:
ES91- country code plus IBAN check digits2100- entidad, the 4-digit bank code (2100 belongs to CaixaBank in this example)0418- oficina, the 4-digit branch code45- the two dígitos de control, Spain’s domestic check digits0200051332- the 10-digit account number
A double layer of checking
Spain is notable for embedding two independent domestic check digits in the middle of the BBAN rather than at the end. The first control digit validates the entidad and oficina fields; the second validates the 10-digit account number. Both use a weighted modulo-11 scheme that any CCC-aware validator can recompute. Combined with the IBAN’s MOD-97 check digits, a Spanish IBAN offers three separate integrity checks, which makes accidental transposition errors very unlikely to slip through.
Domestic format and SEPA
The CCC (banco-sucursal-DC-cuenta, written 4-4-2-10) is still how many Spanish forms and older systems present account details; prefixing ES plus two check digits converts it to the IBAN with no reordering. Spain has been in SEPA from the start, so ES IBANs work throughout the euro payments area for credit transfers and direct debits.
One practical caution: Spain’s banking sector has consolidated heavily, and thousands of entidad and oficina codes have been merged or retired. An IBAN that passes every mathematical check may still point at a bank code that no longer exists. Formal validity is a statement about structure, not existence - the account behind a well-formed ES IBAN may be closed or fictitious, which is exactly why EU payment providers run Verification of Payee before executing transfers. For safe testing, use the generator on this page rather than inventing numbers.