How to calculate an IBAN: steps, MOD-97 formula and tools

Published on · Updated on

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

  1. Start with the country code (ES, DE, FR, etc.) followed by 00 as provisional check digits.
  2. Append the full national account number (BBAN). In Spain this is the 20-digit CCC.
  3. Reorder: move the first four characters (ES00…) to the end → …ES00.
  4. Convert letters to digits: A=10, B=11, …, Z=35.
  5. Apply MOD-97: divide by 97 and keep the remainder.
  6. Compute the check digits: 98 − remainder. Replace the provisional 00 (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:

  1. Open the IBAN Generator.
  2. Paste the CCC (with or without spaces).
  3. 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 0 with O, or 1 with l/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.


Frequently Asked Questions

How many digits does a Spanish IBAN have?
24 characters: ES + 2 check digits + 20 from the CCC (bank, branch, CD and account number).
Can I compute an IBAN if I only have the national account?
Yes. The Spanish IBAN is ES + two check digits + the full 20-digit CCC. Our IBAN Generator handles other countries too.
What is the MOD-97 algorithm?
It is the method defined by ISO 7064 to compute IBAN check digits. You reorder the IBAN, map letters to digits and calculate 98 minus the remainder of dividing by 97.
How do I know if an IBAN is valid?
Check the country length, MOD-97 check digits and national BBAN format. Our free IBAN Validator does it all in seconds.
Does the IBAN change if I switch branches inside the same bank?
Usually yes, because positions 5-8 represent the branch. Your bank will give you the updated IBAN after the move.

Check any IBAN for free

Try it now →
Was this article helpful?

Related articles

Showing the first four on mobile.