How to calculate an IBAN
The IBAN (International Bank Account Number) is the unique identifier for a bank account in international format, standardised by ISO 13616. Calculating an IBAN correctly is essential so that your transfers reach the right destination without bouncing or incurring extra fees.
TL;DR
- An IBAN has up to 34 alphanumeric characters. In Spain it is 24.
- It starts with the country code (2 letters) followed by two check digits and the national account number (BBAN).
- Check digits are computed with the MOD-97 (ISO 7064) algorithm.
- If you only have a national account number (e.g. Spanish CCC, UK sort code + account), use our IBAN Generator to derive the IBAN.
- To validate an existing IBAN, use the IBAN Validator.
IBAN structure
ES 76 2100 0418 45 0200051332
│ │ │ │
│ │ └── BBAN (Basic Bank Account Number, varies per country)
│ └────── Check digits (2 characters)
└────────── ISO 3166-1 country code (2 letters)
Each country defines the length and composition of its BBAN. Spain: 4 (bank) + 4 (branch) + 2 (CD) + 10 (account) = 20 characters.
Manual steps to calculate an IBAN
- Start with the country code (
ES,DE,FR, etc.) followed by00as provisional check digits. - Append the full national account number (BBAN). In Spain this is the 20-digit CCC.
- Reorder: move the first four characters (
ES00…) to the end →…ES00. - Convert letters to digits: A=10, B=11, …, Z=35.
- Apply MOD-97: divide by 97 and keep the remainder.
- Compute the check digits:
98 − remainder. Replace the provisional00(zero-pad to two digits if needed).
You can do it by hand but a single transcription error invalidates the IBAN, which is why almost everyone uses a tool.
Deriving a Spanish IBAN from a CCC
Spain was one of the last countries to adopt IBAN. If your legacy account is in CCC format (20 digits: bank-branch-DC-account), the IBAN is simply ES + the two computed digits + your CCC. To get it in one click:
- Open the IBAN Generator.
- Paste the CCC (with or without spaces).
- We return a valid IBAN with correct check digits.
Validating an existing IBAN
If someone has given you an IBAN and you want to confirm it is valid before sending a transfer, use the IBAN Validator. We check:
- Correct length for the country.
- MOD-97 check digits.
- National BBAN structure.
- Bank associated with the IBAN.
Common mistakes when calculating an IBAN
- Forgetting to add the country code before applying MOD-97.
- Confusing
0withO, or1withl/I. - Copying the IBAN from a PDF and dragging invisible whitespace.
- Mixing one bank’s IBAN with another bank’s CCC.
Conclusion
Computing an IBAN is a deterministic, reproducible process, but a single mistyped digit can cause a bounced transfer and return fees. Use our IBAN Generator when starting from a CCC, or the IBAN Validator to confirm an existing one.