IBAN Generator (Test Data)
Generate valid test IBAN numbers for development, testing, and QA with mod-97 algorithm validation - TESTING ONLY
[ Test IBANs - Quick Summary ]
What: Generates test IBANs (International Bank Account Numbers, ISO 13616) for 14 European countries, with the right length for each country and correct mod-97 check digits.
When to use: Testing bank-transfer and SEPA direct debit forms, IBAN validation code, payroll and supplier records, onboarding flows, database seeds and API contract tests.
Example: DE89 3704 0044 0532 0130 00 (the well-known German sample IBAN, 22 characters)
Important: TESTING ONLY. A generated IBAN is not a real bank account. It passes the IBAN check, but no bank holds an account under that number, so nothing can be paid into or collected from it.
This test IBAN generator creates fake but well-formed International Bank Account Numbers for software testing. Pick a country, and each IBAN gets that country's code, the length its banking system uses and two check digits calculated with the ISO 7064 mod-97 method, so it passes the same IBAN check that banking forms and libraries run. Use them to fill SEPA payment forms, seed test databases, check that your validation accepts good IBANs and rejects mistyped ones, or demo an app without exposing anyone's real bank details. The IBANs are random: they don't belong to anyone, aren't linked to a real bank account and can't send or receive money.
What is an IBAN?
An IBAN (International Bank Account Number) identifies one bank account in a format that works across borders. It is defined by ISO 13616, and SWIFT, as the standard's registration authority, publishes each country's exact format in the IBAN Registry. Every IBAN has the same three parts:
- Country code: two letters from ISO 3166-1, such as DE for Germany or FR for France.
- Check digits: two digits from 02 to 98, calculated from the rest of the IBAN with the mod-97 method below.
- BBAN (Basic Bank Account Number): the domestic account number. Its length and layout are fixed per country and usually hold a bank code, sometimes a branch code, the account number and, in some countries, a national check digit.
An IBAN can be up to 34 characters long, but each country uses one fixed length: Norway 15, Belgium 16, Germany and the UK 22, France and Italy 27, Poland 28. The electronic form is written without spaces (DE89370400440532013000). On paper and on screen, it's split into groups of four (DE89 3704 0044 0532 0130 00). In the German example, DE is the country, 89 the check digits, 37040044 the 8-digit bank code (Bankleitzahl) and 0532013000 the 10-digit account number.
How the mod-97 check works
The check digits let software catch typos before a payment is sent. To validate an IBAN:
- Remove spaces and check that the length is right for the country.
- Move the first four characters (country code and check digits) to the end.
- Replace every letter with two digits: A = 10, B = 11, and so on up to Z = 35.
- Read the result as one large whole number and divide it by 97. The IBAN is valid only if the remainder is 1.
Worked example: DE89370400440532013000 becomes 370400440532013000DE89. With D = 13 and E = 14, that's 370400440532013000131489, and that number mod 97 is 1, so the IBAN is valid. To create check digits, you put 00 in their place, do the same calculation, and subtract the remainder from 98. For the German example, the remainder is 9 and 98 - 9 = 89. Results below 10 get a leading zero.
The numbers are too long for normal 64-bit integers, so code usually reads them a few digits at a time and keeps only the running remainder. The check reliably catches a single wrong character and two neighbouring characters swapped, the most common typing errors. It only proves that the number is well formed. It can't tell whether the bank exists, whether the account is open or who owns it.
Supported countries and IBAN formats
The generator covers 14 countries, all of them in the SEPA area. The lengths match the SWIFT IBAN Registry. The layout column shows what the BBAN contains in real IBANs from that country (n = digits, a = letters, c = letters or digits):
| Code | Country | Length | BBAN layout |
|---|---|---|---|
| AT | Austria | 20 | 5n bank code + 11n account |
| BE | Belgium | 16 | 3n bank + 7n account + 2n check |
| CH | Switzerland | 21 | 5n bank clearing number + 12c account |
| DE | Germany | 22 | 8n Bankleitzahl + 10n account |
| DK | Denmark | 18 | 4n registration number + 10n account |
| ES | Spain | 24 | 4n bank + 4n branch + 2n check + 10n account |
| FI | Finland | 18 | 14n bank code and account, ending in a check digit |
| FR | France | 27 | 5n bank + 5n branch + 11c account + 2n RIB key |
| GB | United Kingdom | 22 | 4a bank identifier + 6n sort code + 8n account |
| IT | Italy | 27 | 1a CIN check letter + 5n ABI + 5n CAB + 12c account |
| NL | Netherlands | 18 | 4a bank identifier + 10n account |
| NO | Norway | 15 | 4n bank + 7n account, ending in a check digit |
| PL | Poland | 28 | 8n bank and branch + 16n account |
| SE | Sweden | 24 | 3n bank + 17n account |
What the generator does and doesn't do: it fills the whole BBAN with random digits, then calculates the IBAN check digits. Every IBAN it produces has the right country code, the right length and valid mod-97 check digits. It does not build the national parts: UK and Dutch IBANs get four digits where real ones have four letters (a real UK example is GB82 WEST 1234 5698 7654 32), the Italian CIN is a digit instead of a letter, and the national check digits used in France, Spain, Belgium, Italy, Norway and Finland are random. A validator that checks only the IBAN standard will accept these test IBANs. A validator that also applies national bank-code or account-number rules can reject them, which is useful if you want to test that stricter path too.
IBAN Generator Options
Quantity (1-20)
Country
Formatted
How to Generate Test IBANs
[STEP 1] Choose the country and quantity
Pick the country your form or system should handle and how many IBANs you need. If your product accepts IBANs from several countries, generate a few from each: lengths range from 15 to 28 characters across the supported list.
[STEP 1] Choose the format
Keep "formatted" on for data people would type or paste from a statement. Turn it off for the compact electronic format used in payment files and API requests.
[STEP 1] Generate and copy
Run the generator. Each IBAN is listed with its country. Copy single values, or export the batch as TXT or CSV to load into a test database, spreadsheet or test fixture.
[STEP 1] Use them only in test environments
Feed them to forms, validators and sandboxes. Don't put them in live payment runs or real mandates: a transfer to a test IBAN will be rejected by the receiving side, because no such account exists.
Testing with IBANs
- _ Test both sides of validation. Your code should accept every generated IBAN. Then change one character, swap two neighbouring digits or drop the last character: each of those must now fail. Also try a wrong length for the country, an unknown country code and an IBAN with spaces or lowercase letters.
- _ Don't hard-code one length. IBAN length depends on the country, and a field limited to 22 characters will cut off French, Italian and Polish IBANs. Store IBANs in the electronic format (uppercase, no spaces), allow up to 34 characters, and add the spaces only when you display them.
- _ Know which checks you run. The IBAN standard only requires the country length and the mod-97 result. Some systems go further and check the national bank code against a bank directory or apply domestic check-digit rules. Random test IBANs pass the first kind of check, not the second.
- _ Keep test and real data apart. Mark test records clearly, keep them out of production payment runs, and never copy real customers' IBANs into development databases. Generated IBANs let you build and demo bank-detail features without handling anyone's personal financial data.
- _ Use the bank's or provider's own test accounts for end-to-end tests. To see how a real transfer or SEPA direct debit is accepted, rejected or returned, use the sandbox IBANs and scenarios your bank or payment provider documents. Random IBANs are for forms, validation and data, not for simulating bank responses.
- _ BIC is a separate code. A BIC (also called a SWIFT code, ISO 9362) identifies the bank, not the account: 4 characters for the bank, 2 for the country, 2 for the location and an optional 3-character branch code. For SEPA transfers in euros, the IBAN alone is enough and the BIC is optional. Outside SEPA, many international payments still need both.
Technical Implementation - Building a Test IBAN
How this generator builds each IBAN, and how to check one in your own code:
// Build a test IBAN
country = "DE" // one of the 14 supported countries
length = IBAN_LENGTH[country] // e.g. DE = 22, FR = 27, NO = 15
bban = random_digits(length - 4) // random digits, no real bank or account
// Check digits (ISO 7064 MOD 97-10)
rearranged = bban + country + "00"
numeric = letters_to_digits(rearranged) // A=10, B=11 ... Z=35
check = 98 - mod97(numeric)
iban = country + zero_pad(check, 2) + bban
// Validate any IBAN
function is_valid(iban):
iban = remove_spaces(uppercase(iban))
if length(iban) != IBAN_LENGTH[first_two(iban)]: return false
rearranged = iban[4:] + iban[0:4]
return mod97(letters_to_digits(rearranged)) == 1
// mod97 on a long digit string, a few digits at a time
function mod97(digits):
remainder = 0
for each digit d in digits:
remainder = (remainder * 10 + d) % 97
return remainder
// Example: DE89 3704 0044 0532 0130 00
// 370400440532013000 + "DE00" -> 370400440532013000131400
// mod 97 = 9 -> check digits 98 - 9 = 89
API Access for Developers
country (two-letter code, default DE), quantity (1-20) and formatted (true or false). GET /api/v1/ibans/countries lists the supported countries and their IBAN lengths, and POST /api/v1/ibans/validate with an iban field runs the length and mod-97 check on any IBAN you send.Frequently Asked Questions
Are these real bank accounts?
Why do the generated IBANs pass validation?
Will a strict validator accept them?
What is the difference between an IBAN and a BIC or SWIFT code?
Which countries use IBANs?
Can I use these IBANs in a SEPA direct debit test?
[ HOW TO CITE THIS PAGE ]
Generate-Random.org. (2026). IBAN Generator (Test Data). Retrieved from https://generate-random.org/ibans
IBAN Generator (Test Data) - Generate-Random.org (https://generate-random.org/ibans)