---
title: How to Generate Valid Test IBANs for QA and CI
description: Test IBANs must pass the MOD-97 checksum but must not be real accounts. How generators build valid mock IBANs, and why seeded output matters for CI.
canonical: https://stanzaapi.com/guides/generating-valid-test-ibans
---

[Home](/)/[Guides](/guides)/How to Generate Valid Test IBANs for QA and CI

# How to Generate Valid Test IBANs for QA and CI

A test IBAN is a mathematically valid IBAN that is not a real bank account. A generator builds one from a country format plus a bank code, then computes the MOD-97 check digits so validators accept it.

Updated 2026-09-30 · 4 min read

## Why to use mock IBANs

A real customer IBAN is personal data. Using one in a test fixture, a screenshot, or a shared CI log is a data-protection problem even if no payment is made.

A test IBAN gives you the same validation behaviour — length, structure, and checksum — without exposing an account that belongs to someone.

## How a generator builds a valid IBAN

A generator works in four steps.

- Select a country and read its length and BBAN pattern from the registry.
- Fill the BBAN using a bank code and account digits that match the pattern.
- Append the country code and the placeholder 00, then compute the MOD-97 check digits.
- Replace the 00 with the computed check digits to produce a valid IBAN.

## Seeded output for reproducible CI

A good generator accepts a seed. With the same seed and country it returns the same IBAN every time and prints a permanent URL you can paste into a fixture or a ticket.

Random output in a test suite causes flaky diffs. Seeded output lets a failing case be reproduced exactly.

## What a generated IBAN proves

A generated IBAN passes the structure and checksum rules, which is exactly what a validator checks. It does not correspond to a real account and will not receive a payment.

That distinction matters: test data should never be presented as a live account, and a generated IBAN should never be sent to a payment rail.

## Try it on real data

[Global IBAN, BIC/SWIFT & Bank Routing Validator API → — High-speed ISO 13616 MOD-97 IBAN checksum verification, ISO 9362 BIC/SWIFT validation, and bank routing extraction across 87 countries — Open the tool](/tools/iban-validator/)

## Frequently Asked Questions

Is a test IBAN a real bank account?

No. A test IBAN is mathematically valid but is not a real account. It passes the structure and MOD-97 checksum checks that a validator performs, and nothing more.

Can I use a generated IBAN in production?

No. Generated IBANs are for testing only. Sending one to a payment rail will fail or misroute, because no account exists behind it.

Why do I need a seed?

A seed makes the generator deterministic. The same seed and country always produce the same IBAN, so a test fixture can be reproduced exactly instead of changing on every run.

## Primary sources

- [ISO 13616 — International Bank Account Number (IBAN)](https://www.iso.org/standard/81090.html)
- [ISO 7064 — Check character systems](https://www.iso.org/standard/31531.html)
- [StanzaAPI — IBAN test data (CC0 dataset)](https://stanzaapi.com/datasets/iban)
