Free tool

IBAN generator and validator

Generate random IBANs with correct check digits for 42 countries to test payment forms, SEPA flows, imports and validation code, or paste IBANs to check them. Choose a country, optionally fix the bank code, and export as text, CSV or JSON. This is test data for development only: the account numbers are random and must never be used to send or request money.

Free · no sign-up · runs in your browser, nothing is uploaded

10 test IBANs · Germany · SEPA

Generating…

Format: DE + 2 check digits + Bank code (BLZ) (8 digits) + Account number (10 digits). For development and testing only: a random IBAN can match a real account by chance, so never send money to one.

How an IBAN is built

An IBAN is a 2-letter ISO country code, 2 check digits and the national account number (BBAN). The BBAN format is fixed per country in the SWIFT IBAN registry: Germany uses an 8-digit bank code and a 10-digit account, the UK a 4-letter bank code, a 6-digit sort code and an 8-digit account.

  1. Build the BBAN in the country's format: here, random digits (and letters where the format asks for them).
  2. Append the country code and 00, then replace each letter with two digits (A=10, B=11 ... Z=35).
  3. Take that number mod 97 and subtract it from 98. The result, padded to 2 digits, goes after the country code.

Example: for the UK BBAN WEST12345698765432 the check digits are 82, so the IBAN is GB82 WEST 1234 5698 7654 32. Belgian, French and Spanish IBANs also carry national check digits inside the BBAN; the generator computes those so stricter validators accept the numbers.

IBAN length and format by country

CountryCodeLengthBBAN formatSEPA
GermanyDE228n 10nYes
United KingdomGB224a 6n 8nYes
FranceFR275n 5n 11c 2nYes
SpainES244n 4n 1n 1n 10nYes
ItalyIT271a 5n 5n 12cYes
NetherlandsNL184a 10nYes
BelgiumBE163n 7n 2nYes
AustriaAT205n 11nYes
SwitzerlandCH215n 12cYes
IrelandIE224a 6n 8nYes
PortugalPT254n 4n 11n 2nYes
PolandPL288n 16nYes
SwedenSE243n 16n 1nYes
DenmarkDK184n 9n 1nYes
NorwayNO154n 6n 1nYes
FinlandFI183n 11nYes
LuxembourgLU203n 13cYes
CzechiaCZ244n 6n 10nYes
SlovakiaSK244n 6n 10nYes
HungaryHU283n 4n 1n 15n 1nYes
RomaniaRO244a 16cYes
BulgariaBG224a 4n 2n 8cYes
CroatiaHR217n 10nYes
SloveniaSI195n 8n 2nYes
GreeceGR273n 4n 16cYes
CyprusCY283n 5n 16cYes
MaltaMT314a 5n 18cYes
EstoniaEE202n 2n 11n 1nYes
LatviaLV214a 13cYes
LithuaniaLT205n 11nYes
IcelandIS264n 2n 6n 10nYes
LiechtensteinLI215n 12cYes
AndorraAD244n 4n 12cYes
TurkeyTR265n 1n 16cNo
UkraineUA296n 19cNo
United Arab EmiratesAE233n 16nNo
Saudi ArabiaSA242n 18cNo
IsraelIL233n 3n 13nNo
QatarQA294a 21cNo
KuwaitKW304a 22cNo
PakistanPK244a 16cNo
BrazilBR298n 5n 10n 1a 1cNo

n is digits, a upper-case letters and c letters or digits, as in the registry. IBANs are not only European: Brazil, Saudi Arabia, the UAE, Israel, Pakistan and others use them too, though not for SEPA payments.

Validate an IBAN in JavaScript and Python

Strip spaces, move the first four characters to the end, turn letters into numbers and check that the remainder mod 97 is 1.

// true when the IBAN's check digits are right (spaces allowed)
function ibanValid(input) {
  const s = input.replace(/\s+/g, '').toUpperCase();
  if (!/^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$/.test(s)) return false;
  const moved = s.slice(4) + s.slice(0, 4);
  let rem = 0;
  for (const ch of moved) {
    const v = ch >= 'A' ? String(ch.charCodeAt(0) - 55) : ch; // A=10 ... Z=35
    for (const d of v) rem = (rem * 10 + Number(d)) % 97;
  }
  return rem === 1;
}

ibanValid('DE89 3704 0044 0532 0130 00'); // true
def iban_check_digits(country: str, bban: str) -> str:
    """The two digits after the country code."""
    moved = bban + country + "00"
    num = int("".join(str(int(c, 36)) for c in moved.upper()))
    return f"{98 - num % 97:02d}"

iban_check_digits("GB", "WEST12345698765432")  # '82' → GB82WEST12345698765432

In production, also check the length for the country and the BBAN format. Libraries such as ibantools (JavaScript) and schwifty (Python) include the registry data.

More test data for payment flows

Test data only, for development and QA. For card payments and the rest of a checkout form:

FAQ

Are generated IBANs real bank accounts?+

No. The generator builds an IBAN with the right length, the right format for the country and correct check digits, then fills the account digits at random. It passes the checks a form or API runs before accepting an IBAN. Because the digits are random, a number can match a real account by chance, so use them only in test systems and never send money to one.

How are IBAN check digits calculated?+

Move the country code and two zeros to the end (DE00 at the end of the BBAN), turn letters into numbers (A=10 ... Z=35), take the result mod 97 and subtract it from 98. That gives the two digits after the country code. To validate, move the first four characters to the end, convert the letters and check that mod 97 equals 1. This is ISO 7064 MOD 97-10, used by ISO 13616.

Can I use a generated IBAN to test SEPA payments in Stripe or Adyen?+

Use them for your own validation code, forms, fixtures and imports. Payment providers expect the test IBANs they publish in their sandbox docs, each tied to an outcome such as success or a failed debit. A random IBAN with valid check digits can still be rejected by a sandbox that checks it against its own list.

What is the difference between an IBAN and a BBAN?+

The BBAN (basic bank account number) is the national account number: for Germany the 8-digit bank code plus the 10-digit account number. The IBAN adds the 2-letter country code and 2 check digits in front, so the same account can be read across borders.

Why does my bank reject an IBAN that passes this validator?+

The mod-97 check only proves the IBAN was typed correctly. Many countries also have national check digits inside the BBAN (this tool checks Belgium, France and Spain), and only the bank knows whether the account exists. A German IBAN with a bank code that no bank uses passes the IBAN check and still fails at the bank.

How long is an IBAN?+

It depends on the country, from 15 characters (Norway) to 30 or more (Kuwait has 30, Malta 31). Germany and the UK have 22, France and Italy 27, Spain 24, the Netherlands 18 and Belgium 16. The table below lists every country this tool supports.

Sources: SWIFT IBAN Registry · ISO 13616 · European Payments Council: IBAN · IBAN (Wikipedia). Checked 2026-11-15.