· 4 min read
How to Generate Valid-Format Test IBANs
Heshan Fernando
Co-founder & COO
You’re building or testing a form that accepts IBANs — the international bank account number format used across Europe and several other regions — and you need sample values that pass format and checksum validation, without using anyone’s real bank account number. A completely random string of digits and letters won’t work for this, because IBANs have a specific structure and a checksum (based on the mod-97 algorithm) that a real validation function will correctly reject if it’s not properly formed.
Making up a plausible-looking IBAN by hand isn’t realistic — the checksum digits are calculated through a specific mathematical process, not chosen freely, so a hand-typed “fake” IBAN will almost always fail validation rather than passing it the way a proper test case should.
What a valid-format test IBAN actually requires
An IBAN consists of a country code, two checksum digits, and a country-specific basic bank account number (BBAN) whose exact length and structure varies by country. The checksum digits aren’t arbitrary — they’re calculated using the mod-97 algorithm applied to the rest of the IBAN, which is exactly the same check a real validation system performs when verifying an IBAN’s format is internally consistent.
For testing purposes, what you need is an IBAN that’s structurally correct and passes the checksum, without corresponding to any real account — a synthetic value engineered to pass validation, not a randomly typed string.
Why people get stuck here
- Country-specific formats vary in length and structure. An IBAN’s total length and internal structure differs by country, so a generator needs to know the specific format for whichever country you’re testing against.
- The checksum isn’t something you can fake by guessing. Mod-97 checksum digits are the result of a specific calculation — you can’t just pick plausible-looking digits and expect them to pass real validation.
- Using a real account number for testing is a bad idea. Even in a test environment, using an actual real-world IBAN (yours or anyone else’s) for testing purposes isn’t appropriate, and a purpose-built fake generator avoids that entirely.
- QA and development environments need to run many test cases. A single test IBAN isn’t enough for thorough validation testing — you typically need several across different countries and edge cases.
What a good IBAN test generator looks like
Covers multiple countries’ formats correctly
Since IBAN structure varies by country, the generator needs to produce correctly formatted values for whichever specific countries your form needs to support.
Computes a genuinely valid checksum
The generated IBAN needs to actually pass mod-97 validation, not just look superficially plausible — otherwise it doesn’t properly test your form’s validation logic.
Clearly produces test values, not real account data
The tool should generate values specifically for testing purposes, ensuring nothing resembles or could be confused with an actual real-world account number.
Common mistakes to avoid
- Making up a plausible-looking IBAN by hand, which will almost certainly fail real checksum validation since the checksum isn’t a freely chosen value.
- Using a friend’s or coworker’s real IBAN for testing, which is inappropriate even in a non-production environment.
- Testing only with one country’s format when your form needs to support several, missing format differences that only show up with other countries’ account numbers.
- Assuming a test IBAN that passes format validation also represents a real, usable account — it doesn’t, and shouldn’t be used for anything beyond testing.
- Not testing your form’s handling of deliberately invalid IBANs alongside valid test ones, to confirm your validation logic correctly rejects malformed input too.
How to do it with IBAN Test Generator
Online Tool Store’s IBAN Test Generator generates random, checksum-valid test IBANs for common countries, entirely in your browser.
- Choose the country format you want to test.
- Generate a random, checksum-valid test IBAN.
- Use it to test your form’s validation logic.
- Generate additional test values across different countries as needed.
Because the generated values pass real mod-97 checksum validation, they properly exercise your form’s validation logic the way a genuine (but appropriately fake) test case should.
Frequently asked questions
Will a generated test IBAN work for an actual bank transfer?
No — these are synthetic values engineered to pass format and checksum validation for testing purposes only. They don’t correspond to any real account and shouldn’t be used or presented as if they were a real IBAN.
Why does the checksum matter for a test value?
If your form’s validation logic checks the mod-97 checksum (as a proper IBAN validator should), a test value with a nonsense or incorrect checksum won’t actually exercise that validation logic correctly — you need a genuinely valid checksum to properly test the “this passes validation” case.
Can I generate test IBANs for any country?
Coverage depends on the specific generator — most support the more commonly used country formats first. If you need a less common country’s format, check that it’s specifically supported before relying on it for your test suite.
Final thought
A properly generated test IBAN needs a real, valid checksum to actually exercise your form’s validation logic — a hand-typed fake almost certainly won’t pass. Generate synthetic test values purpose-built for testing, and never use a real account number in their place.