Skip to content

iban

Validates an International Bank Account Number (IBAN) for 77 countries.

Options

OptionTypeDefaultDescription
countrystringundefinedRestrict to a specific country code (e.g. "DE")
sepaboolean | stringundefinedIf true, restrict to SEPA countries; if a string, treated as a country code
messagestringlocale defaultCustom error message

Playground

Valid values

ValueCountry
"DE89370400440532013000"Germany
"GB29NWBK60161331926819"United Kingdom
"FR7614508059009054924040816"France

Invalid values

ValueReason
"DE89370400440532013001"Wrong mod-97 checksum
"XX89370400440532013000"Unknown country code

Notes

  • Empty string ("") always returns valid: true. Combine with notEmpty to require a value.
  • Without country option, accepts IBANs from all 77 supported countries.
  • With sepa: true, only accepts IBANs from the 36 SEPA member countries.

Released under the MIT License.