Regex for IBAN Number
Validates International Bank Account Numbers (IBAN): 2-letter country code, 2 check digits, and up to 30 alphanumeric characters.
Pattern
/^[A-Z]{2}\d{2}[A-Z0-9]{4,30}$/ Live Tester
Enter a string to test
Examples
✓ DE89370400440532013000
✓ GB29NWBK60161331926819
✓ FR7630006000011234567890189
✗ DE89
✗ de89370400440532013000
✗ 1234567890
Pattern Breakdown
^[A-Z]{2} — two uppercase letters (country code)
\d{2} — two check digits
[A-Z0-9]{4,30}$ — 4 to 30 alphanumeric characters (BBAN)
Code Snippets
Javascript
const regex = /^[A-Z]{2}\d{2}[A-Z0-9]{4,30}$/;
regex.test("DE89370400440532013000"); // true Python
import re
pattern = r"^[A-Z]{2}\d{2}[A-Z0-9]{4,30}$"
bool(re.match(pattern, "DE89370400440532013000")) # True Php
$pattern = '/^[A-Z]{2}\d{2}[A-Z0-9]{4,30}$/';
preg_match($pattern, "DE89370400440532013000"); // 1 Related Patterns
Email Address /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/ URL /^https?:\/\/(www\.)?[a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([a-zA-Z0-9()@:%_+.~#?&/=-]*)$/ Phone Number (International) /^\+?[1-9]\d{1,14}$/ Phone Number (US) /^\(?[2-9]\d{2}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/ Phone Number (EU) /^\+?[1-9][0-9]{0,3}[\s.-]?\(?[0-9]{1,5}\)?[\s.-]?[0-9]{1,5}[\s.-]?[0-9]{1,5}$/ IPv4 Address /^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/
Frequently Asked Questions
What is the regex for IBAN Number?▾
The regex pattern for IBAN Number is /^[A-Z]{2}\d{2}[A-Z0-9]{4,30}$/. Validates International Bank Account Numbers (IBAN): 2-letter country code, 2 check digits, and up to 30 alphanumeric characters.
How do I use the IBAN Number regex in JavaScript?▾
In JavaScript you create the pattern with a regex literal or the RegExp constructor and call .test() to check a string against it. A ready-to-copy example is shown in the Code Snippets section above, alongside Python and PHP versions.
What does the IBAN Number pattern match?▾
It matches strings like DE89370400440532013000; it rejects strings like DE89. See the Examples section above for the full list of matching and non-matching cases.