ibanchecker.cash
IBAN FundamentalsJune 3, 2026 · 6 min read

How to Generate a Valid IBAN: Step-by-Step from Bank Code to Check Digits

A complete guide to assembling a valid IBAN — from gathering the bank routing code and account number to computing check digits with MOD-97.

Share

Generating a valid IBAN means assembling the correct country code, bank routing data, account number, and check digits in the exact order defined by ISO 13616. This guide explains every step — from gathering the raw bank data to computing the final check digits — so you understand what makes an IBAN valid before trusting any generator tool with a real payment.

What Goes Into an IBAN?

An IBAN has two layers. The outer layer is universal: a 2-letter country code (e.g., DE) and 2 numeric check digits (e.g., 89). The inner layer is the BBAN — Basic Bank Account Number — whose structure is defined country by country.

For a German IBAN you need:

  • Country code: DE
  • Bankleitzahl (BLZ): 8-digit bank routing code (e.g., 37040044 for Deutsche Bank Cologne)
  • Account number: 10-digit account number, left-padded with zeros if shorter (e.g., 0532013000)
  • Check digits: 2 digits calculated from the above — explained below

For a UK IBAN you need the 4-letter bank code (e.g., NWBK), the 6-digit sort code (601613), and the 8-digit account number (31926819).

Every country defines a fixed total length and BBAN layout. Germany is always 22 characters, the UK is always 22, France is always 27. The IBAN formats reference page lists the structure for all 84 countries.

Step 1 — Assemble the BBAN

Concatenate your bank routing identifier and account number in the order your country specifies, zero-padding where necessary to reach the required field lengths.

German example:

BLZ:            37040044   (8 digits)
Account number: 0532013000 (10 digits, zero-padded from 532013000)
BBAN:           370400440532013000

UK example:

Bank code:      NWBK       (4 letters)
Sort code:      601613     (6 digits)
Account number: 31926819   (8 digits)
BBAN:           NWBK60161331926819

Step 2 — Create the Rearranged String for MOD-97

To calculate the check digits, temporarily replace them with 00, then move the first four characters (country code + 00) to the end of the string.

Start:        DE00 370400440532013000
Move first 4: 370400440532013000DE00

Step 3 — Convert Letters to Numbers

Replace every letter with its numeric equivalent: A = 10, B = 11, … Z = 35. This produces a long integer string.

370400440532013000DE00
→ 370400440532013000 13 14 00
→ 370400440532013000131400

Step 4 — Compute MOD-97 and Derive the Check Digits

Compute the remainder of dividing that large number by 97. Subtract the result from 98. Left-pad with a zero if the result is a single digit.

370400440532013000131400 mod 97 = 9
Check digits = 98 − 9 = 89

Insert 89 after the country code: DE89 3704 0044 0532 0130 00. This is the canonical Deutsche Bank Cologne example IBAN.

Step 5 — Verify the Completed IBAN

A correctly generated IBAN should pass MOD-97 with a remainder of exactly 1. Rearrange the full IBAN (move first 4 to the end), convert letters, compute mod 97 — the result must be 1.

DE89370400440532013000
→ 370400440532013000DE89
→ 370400440532013000131489
→ mod 97 = 1  ✓

Paste the result into the ibanchecker.cash validator for an instant independent check — it runs the full four-step validation and returns the bank name and BIC where available.

Country-Specific Rules to Watch For

Some countries have additional domestic check digits embedded inside the BBAN that must be computed before you even start the IBAN check digit calculation:

  • Spain (ES): a 2-digit domestic check pair (positions 9–10 of the IBAN) calculated via modulo-11 over the bank code, branch code, and account number.
  • Italy (IT): a single CIN letter at position 5 of the IBAN, derived from a Luhn-variant algorithm over the ABI, CAB, and account number.
  • Belgium (BE): the last 2 digits of the BBAN are a domestic modulo-97 check over the bank code and account number.

Getting these wrong produces a structurally valid-looking IBAN that will be rejected by the receiving bank.

Using the ibanchecker.cash Converter Tools

For Germany, the BLZ to IBAN converter takes a Bankleitzahl and account number and generates the correct IBAN instantly. For the UK, the Sort Code to IBAN converter builds a valid GB IBAN from a sort code and account number — including check digit calculation — without needing to run the algorithm yourself.

Both tools are free, require no registration, and process everything client-side — no IBAN data is logged or stored.

When Should You Generate an IBAN Yourself?

Most individuals never need to generate an IBAN — their bank provides it. You need to compute an IBAN when you are building a system that constructs IBANs from imported legacy data (old sort codes, account numbers without IBANs), migrating between banking systems, or pre-validating bank details supplied by vendors before they enter your ERP.

For bulk generation from lists, the bulk IBAN checker can validate hundreds of pre-generated IBANs in one CSV upload, returning validity status and bank data for each row.

Last updated: June 2026

Validate an IBAN instantly

Free IBAN checker — MOD-97 verification, bank lookup, and SEPA status across 84 countries.

Open IBAN Checker →

Related Articles