iban()¶
- Faker.iban()
Generate one or more valid fake IBANs for a given country (synchronous).
Uses the country-specific BBAN generator and the MOD-97 check-digit algorithm to produce structurally valid IBANs. Generated IBANs are re-validated before being returned.
- Parameters:
country_code – ISO 3166-1 alpha-2 country code (uppercase), e.g.
"DE","GB","US".amount – Number of IBANs to generate. Defaults to
1.
- Returns:
A single result
dictwhenamount=1, otherwise alistof result dicts. Each dict contains:iban: full IBAN stringcountry: country codevalid: alwaysTruelength: total length of the IBANdetails: parsed BBAN fields (bank code, account number, …)api_owner/api_updates: attribution
- Raises:
ValueError – If
country_codeis empty, unsupported, or if the generated IBAN fails length or MOD-97 validation.
Example:
iban = faker.iban("DE") ibans = faker.iban("GB", amount=3)