Portuguese IBANs are 25 characters long and wrap the domestic NIB (Numero de Identificacao Bancaria) inside the standard IBAN frame. Because the NIB has its own bank, branch, account, and two-digit national check, it is one of the most structured IBANs in Europe. This validator breaks it apart and checks it instantly, entirely in your browser.
How it works
A Portuguese IBAN always begins with PT, followed by two check digits, a four-digit bank code, a four-digit branch code, an eleven-digit account number, and two national NIB check digits:
PT kk bbbb ssss aaaaaaaaaaa dd
^ ^ ^ ^ ^ NIB check digits (2)
| | | | account number (11 digits)
| | | branch code (4 digits)
| | bank code (4 digits)
| check digits (2)
country code
The validator runs three checks: the length must be exactly 25; the 21-digit BBAN must be all digits; and the ISO 7064 MOD-97-10 checksum must pass. For the checksum the first four characters (PTkk) are moved to the end, every letter is replaced by its numeric code, and the resulting long integer must leave a remainder of 1 when divided by 97. The computation is folded digit-by-digit so no big-integer library is needed.
Worked example
Take PT50 0002 0123 1234 5678 9015 4: country code PT, check digits 50, bank 0002, branch 0123, account 12345678901, NIB check 54. Rearranging the IBAN and dividing by 97 leaves remainder 1, so the checksum passes.
Tips
Almost every Portuguese IBAN you will see starts with PT50, because 50 is the most common IBAN check value for the NIB scheme. Keep all leading zeros in the bank and branch codes, since dropping one shortens the IBAN and fails the length check. All figures are processed locally and never uploaded.