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 dict when amount=1, otherwise a list of result dicts. Each dict contains:

  • iban: full IBAN string

  • country: country code

  • valid: always True

  • length: total length of the IBAN

  • details: parsed BBAN fields (bank code, account number, …)

  • api_owner / api_updates: attribution

Raises:

ValueError – If country_code is empty, unsupported, or if the generated IBAN fails length or MOD-97 validation.

Example:

iban = faker.iban("DE")
ibans = faker.iban("GB", amount=3)