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
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.
- Build the BBAN in the country's format: here, random digits (and letters where the format asks for them).
- Append the country code and
00, then replace each letter with two digits (A=10, B=11 ... Z=35). - 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
| Country | Code | Length | BBAN format | SEPA |
|---|---|---|---|---|
| Germany | DE | 22 | 8n 10n | Yes |
| United Kingdom | GB | 22 | 4a 6n 8n | Yes |
| France | FR | 27 | 5n 5n 11c 2n | Yes |
| Spain | ES | 24 | 4n 4n 1n 1n 10n | Yes |
| Italy | IT | 27 | 1a 5n 5n 12c | Yes |
| Netherlands | NL | 18 | 4a 10n | Yes |
| Belgium | BE | 16 | 3n 7n 2n | Yes |
| Austria | AT | 20 | 5n 11n | Yes |
| Switzerland | CH | 21 | 5n 12c | Yes |
| Ireland | IE | 22 | 4a 6n 8n | Yes |
| Portugal | PT | 25 | 4n 4n 11n 2n | Yes |
| Poland | PL | 28 | 8n 16n | Yes |
| Sweden | SE | 24 | 3n 16n 1n | Yes |
| Denmark | DK | 18 | 4n 9n 1n | Yes |
| Norway | NO | 15 | 4n 6n 1n | Yes |
| Finland | FI | 18 | 3n 11n | Yes |
| Luxembourg | LU | 20 | 3n 13c | Yes |
| Czechia | CZ | 24 | 4n 6n 10n | Yes |
| Slovakia | SK | 24 | 4n 6n 10n | Yes |
| Hungary | HU | 28 | 3n 4n 1n 15n 1n | Yes |
| Romania | RO | 24 | 4a 16c | Yes |
| Bulgaria | BG | 22 | 4a 4n 2n 8c | Yes |
| Croatia | HR | 21 | 7n 10n | Yes |
| Slovenia | SI | 19 | 5n 8n 2n | Yes |
| Greece | GR | 27 | 3n 4n 16c | Yes |
| Cyprus | CY | 28 | 3n 5n 16c | Yes |
| Malta | MT | 31 | 4a 5n 18c | Yes |
| Estonia | EE | 20 | 2n 2n 11n 1n | Yes |
| Latvia | LV | 21 | 4a 13c | Yes |
| Lithuania | LT | 20 | 5n 11n | Yes |
| Iceland | IS | 26 | 4n 2n 6n 10n | Yes |
| Liechtenstein | LI | 21 | 5n 12c | Yes |
| Andorra | AD | 24 | 4n 4n 12c | Yes |
| Turkey | TR | 26 | 5n 1n 16c | No |
| Ukraine | UA | 29 | 6n 19c | No |
| United Arab Emirates | AE | 23 | 3n 16n | No |
| Saudi Arabia | SA | 24 | 2n 18c | No |
| Israel | IL | 23 | 3n 3n 13n | No |
| Qatar | QA | 29 | 4a 21c | No |
| Kuwait | KW | 30 | 4a 22c | No |
| Pakistan | PK | 24 | 4a 16c | No |
| Brazil | BR | 29 | 8n 5n 10n 1a 1c | No |
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'); // truedef 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' → GB82WEST12345698765432In 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:
- Credit card generator · Luhn-valid numbers by brand or BIN
- Stripe test cards · 4242 4242 4242 4242 and every decline
- Adyen test cards · Brands, 3D Secure 2, decline triggers
- Braintree test cards · Valid cards, amounts that decline
- PayPal sandbox cards · Card numbers and rejection triggers
- Phone number generator · Fictional ranges reserved by regulators
- Fake address generator · Test identities by country
More free developer tools
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.