IBAN format · ES
Spain IBAN format: 24 characters.
Spain IBANs have 24 characters: the country code ES, two check digits and a 20-character BBAN, the national account number, laid out as 4!n4!n1!n1!n10!n.
Spain IBAN structure
- Country code
- ES
- Check digits
- 91
- Bank code
- 2100
- Branch code
- 0418
- National check digits
- 45
- Account
- 0200051332
| Positions | Part | In the example |
|---|---|---|
| 1–2 | Country code | ES |
| 3–4 | Check digits | 91 |
| 5–8 | Bank code | 2100 |
| 9–12 | Branch code | 0418 |
| 13–14 | National check digits | 45 |
| 15–24 | Account | 0200051332 |
The BBAN, segment by segment
The registry writes the BBAN in SWIFT notation: n is a digit, a an upper-case letter, c a letter or digit, and the ! means a fixed length. 4!n4!n1!n1!n10!n reads:
| Positions | Notation | Holds | Example |
|---|---|---|---|
| 5–8 | 4!n | 4 digitsBank code (entidad) | 2100 |
| 9–12 | 4!n | 4 digitsBranch code (oficina) | 0418 |
| 13 | 1!n | 1 digitCheck digit for bank and branch | 4 |
| 14 | 1!n | 1 digitCheck digit for the account | 5 |
| 15–24 | 10!n | 10 digitsAccount number | 0200051332 |
Spain IBAN example
ES91 2100 0418 4502 0005 1332 is the sample the SWIFT IBAN Registry publishes for Spain: a well-formed IBAN for showing the format, not a real account. Written electronically it has no spaces (ES9121000418450200051332); on paper it is printed in groups of four.
Its check digits, worked through with ISO 7064 mod 97-10:
Move the country code and check digits to the end
21000418450200051332ES91Replace each letter with two digits (A = 10 … Z = 35)
E = 14, S = 28
21000418450200051332142891Divide that number by 97 and keep the remainder
Remainder 1. A valid IBAN always leaves 1, so the check digits are right.
Where the check digits come from
Put 00 in their place (ES00…), repeat steps 1–3: remainder 7. The check digits are 98 − 7 = 91.
SEPA
Spain is in the Single Euro Payments Area, so SEPA credit transfers and direct debits can reach ES IBANs; whether a given bank takes part is up to that bank.
What the format can and can’t tell you
- Valid means the structure and check digits are right — not that the account exists or can receive payments.
- National check digits inside the BBAN (e.g. the French RIB key, or the Spanish, Belgian and Italian CIN digits) are not verified.
- Bank and branch codes are read from their positions; they are not looked up in a bank directory.
Check ES IBANs from code or an AI agent
curl -s 'https://payopskit.com/api/v1/iban/ES9121000418450200051332'{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "validate_iban",
"arguments": {
"iban": "ES9121000418450200051332"
}
}
}{
"input": "ES9121000418450200051332",
"iban": "ES9121000418450200051332",
"print": "ES91 2100 0418 4502 0005 1332",
"valid": true,
"country": {
"code": "ES",
"name": "Spain",
"sepa": true,
"sepaNote": null
},
"checkDigits": "91",
"expectedCheckDigits": "91",
"length": {
"actual": 24,
"expected": 24
},
"bban": "21000418450200051332",
"bbanFormat": "4!n4!n1!n1!n10!n",
"bankCode": "2100",
"branchCode": "0418",
"parts": [
{
"label": "Country code",
"value": "ES",
"start": 0,
"end": 2,
"kind": "country"
},
{
"label": "Check digits",
"value": "91",
"start": 2,
"end": 4,
"kind": "check"
},
{
"label": "Bank code",
"value": "2100",
"start": 4,
"end": 8,
"kind": "bank"
},
{
"label": "Branch code",
"value": "0418",
"start": 8,
"end": 12,
"kind": "branch"
},
{
"label": "National check digits",
"value": "45",
"start": 12,
"end": 14,
"kind": "national-check"
},
{
"label": "Account",
"value": "0200051332",
"start": 14,
"end": 24,
"kind": "account"
}
],
"checks": {
"characters": true,
"country": true,
"length": true,
"bbanFormat": true,
"checksum": true
},
"errors": [],
"notes": [
"Valid means the structure and check digits are right — not that the account exists or can receive payments.",
"National check digits inside the BBAN (e.g. the French RIB key, or the Spanish, Belgian and Italian CIN digits) are not verified."
]
}The MCP server is at /mcp (Streamable HTTP, no key); the API and MCP docs show how to connect Claude, Cursor or VS Code.
From a national account number: GET /api/v1/iban/check-digits?country=ES&bban=… or the MCP tool compute_iban_check_digits computes the check digits and the whole IBAN.
Other 24-character IBANs
- Andorra4!n4!n12!cSEPA
- Czechia4!n6!n10!nSEPA
- Moldova2!c18!cSEPA
- Pakistan4!a16!c
- Romania4!a16!cSEPA
- Saudi Arabia2!n18!c
- Slovakia4!n6!n10!nSEPA
- Sweden3!n16!n1!nSEPA
- Tunisia2!n3!n13!n2!n
- Virgin Islands (British)4!a16!n
The same length doesn’t mean the same structure: compare the BBAN formats. All IBAN formats and lengths
Source: the SWIFT IBAN Registry (ISO 13616), transcribed and checked against each country’s registry example; the positions of bank and branch codes are given only where the registry’s are well established. The SWIFT IBAN Registry is the authority. Informational only.