T
ToolPrime

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

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.

Related Tools