iban
Validates an International Bank Account Number (IBAN) for 77 countries.
Options
| Option | Type | Default | Description |
|---|---|---|---|
country | string | undefined | Restrict to a specific country code (e.g. "DE") |
sepa | boolean | string | undefined | If true, restrict to SEPA countries; if a string, treated as a country code |
message | string | locale default | Custom error message |
Playground
Valid values
| Value | Country |
|---|---|
"DE89370400440532013000" | Germany |
"GB29NWBK60161331926819" | United Kingdom |
"FR7614508059009054924040816" | France |
Invalid values
| Value | Reason |
|---|---|
"DE89370400440532013001" | Wrong mod-97 checksum |
"XX89370400440532013000" | Unknown country code |
Notes
- Empty string (
"") always returnsvalid: true. Combine withnotEmptyto require a value. - Without
countryoption, accepts IBANs from all 77 supported countries. - With
sepa: true, only accepts IBANs from the 36 SEPA member countries.