Skip to main content
Numbers & Finance · In-Browser Regular Expression Lab

IBAN Regex — International Bank Account Number Validation

Validates canonical IBAN structure: 2-letter country code, 2-digit checksum, and up to 30 alphanumeric characters.

Flags:
//none
Match Found
Load Sample:
Match Inspection & Details1 match
Match #1:GB82WEST12345698765432

Test Samples Verification Matrix

Expected Valid Samples (Should Match)

GB82WEST12345698765432 Pass
DE89370400440532013000 Pass
FR1420041010050500013M02606 Pass

Expected Invalid Samples (Must Reject)

1282WEST123456 Rejected (Pass)
GB82WEST Rejected (Pass)
DE8937040044053201300099999999999 Rejected (Pass)
Code Implementation Generator
// JavaScript / TypeScript (ES6+)
const pattern = /^[A-Z]{2}[0-9]{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}$/;
const text = "GB82WEST12345698765432";

const isMatch = pattern.test(text);
console.log("Is Match:", isMatch);

if (isMatch) {
  const matches = text.match(pattern);
  console.log("Matches:", matches);
}

Regular Expression Token Breakdown

Conforms to ISO 13616 standard for international bank account representation. Each component of the regular expression serves a distinct syntactical purpose as mapped below:

Token PatternName / ComponentFunction & Rule
^[A-Z]{2}Country CodeTwo-letter ISO 3166-1 alpha-2 code.
[0-9]{2}Check DigitsTwo check digits calculated via mod 97.
[A-Z0-9]{4}Bank CodeBasic Bank Account Number (BBAN) prefix.
[0-9]{7}Account numberStandardized account digits.

Frequently Asked Questions

Does this regex allow spaces?
Electronic IBANs must not contain spaces. For printed IBANs, strip whitespace prior to matching.
Browse All 40 Patterns