National check digits in the IBAN

The check digits many countries keep inside the account number, from the French clé RIB to the Italian CIN, and how they differ from the IBAN ones.

Updated

Every IBAN has two check digits right after the country code, calculated with MOD-97. Many countries add check digits of their own inside the BBAN, the national account number. Most of them are older than the IBAN: banks used them to catch typing mistakes in domestic account numbers before the IBAN existed, and the IBAN kept them when it wrapped those numbers.

Two layers of checks

Take the French example IBAN FR14 2004 1010 0505 0001 3M02 606. The 14 after FR are the IBAN check digits. The last two digits, 06, are the clé RIB, the French national check. They protect different things:

IBAN check digits National check digits
Where Positions 3 and 4, in every IBAN Inside the BBAN, at a place set by each country
Method MOD 97-10 (ISO/IEC 7064), the same everywhere A national rule, different from country to country
What they cover The whole IBAN, country code included Usually the bank code, branch code and account number
Defined by ISO 13616 The country's central bank or banking association

The two layers are independent. An IBAN can have correct MOD-97 check digits and still fail the national check, for example when someone wrapped a mistyped domestic number into an IBAN and computed the IBAN check digits afterwards. The reverse also happens: change one digit of a valid IBAN and the MOD-97 check fails, even if the national check still passes.

The main methods

National checks look different, but most belong to a few families.

MOD 97 tails

Several countries end the BBAN with two digits calculated with MOD 97-10, the same method as the IBAN check digits, applied to the digits in front of them. Portugal (the NIB check digits), Slovenia, Serbia, Montenegro, North Macedonia, Bosnia and Herzegovina, Kosovo and Timor-Leste work this way.

RIB keys

The French clé RIB is 97 minus the remainder of 89 × bank code + 15 × branch code + 3 × account number divided by 97. Letters in the account number first become digits (A and J count as 1, B, K and S as 2, and so on). The key makes the whole domestic number divisible by 97. France and Monaco share it, and Tunisia and Mauritania use RIB keys with the same goal: the whole account number is divisible by 97.

The Italian CIN

Italy and San Marino put a check letter, the CIN, at the start of the BBAN. It covers the 22 characters after it: the ABI bank code, the CAB branch code and the account number. Characters in odd positions are converted with a table, characters in even positions keep their plain value (digits as themselves, letters A = 0 to Z = 25). The sum divided by 26 leaves a remainder from 0 to 25, which becomes a letter from A to Z.

The Spanish control digits

A Spanish account code (CCC) has two control digits between the branch code and the account number. The first checks the bank and branch codes, the second the 10-digit account number. Each is a weighted sum with the weights 1, 2, 4, 8, 5, 10, 9, 7, 3, 6, subtracted from 11 after dividing by 11. A result of 11 becomes 0 and 10 becomes 1. See the Spanish format.

Weighted sums

Many countries multiply each digit by a weight, add up the products and keep the remainder:

  • Belgium: the last two digits are the first ten digits modulo 97 (97 in place of 0).
  • Norway: MOD 11 with the weights 5, 4, 3, 2, 7, 6, 5, 4, 3, 2. Account numbers that would need the value 10 are never issued.
  • Finland: the Luhn algorithm, the one used for card numbers.
  • Estonia: the 7-3-1 method, weights 7, 3, 1 repeated from the right.
  • Hungary: two digits with the weights 9, 7, 3, 1, one for the bank and branch code and one for the account number.
  • Poland: one digit at the end of the 8-digit sort code, weights 3, 9, 7, 1.
  • Albania: one digit after the bank and branch code, weights 9, 7, 3, 1.
  • Czech Republic and Slovakia: the account prefix and the account number must each give a weighted sum divisible by 11.
  • Croatia: ISO 7064 MOD 11,10, once for the bank code and once for the account number.
  • Costa Rica: the last digit of the customer account number, weights 1 to 9 then 1 to 7, modulo 11.
  • Russia: the control key of the Bank of Russia, weights 7, 1, 3 over the end of the BIK bank code and the account number.

Country by country

The table lists every country whose national check this site computes, with the positions of the check digits in the IBAN. Follow a country's link for its generator and full format.

Country Positions Method IBAN check digits Source
Albania 12 Weights 9, 7, 3, 1 (mod 10) Depend on the account Bank of Albania, Decision No. 26 of 4.5.2022
Belgium 15–16 First 10 digits mod 97 Depend on the account Febelfin / National Bank of Belgium
Bosnia and Herzegovina 19–20 MOD 97-10 BA39 Centralna banka Bosne i Hercegovine
Costa Rica 22 Weights 1 to 9 (mod 11) Depend on the account Banco Central de Costa Rica, Cuenta Cliente
Croatia 11, 21 ISO 7064 MOD 11,10 Depend on the account Hrvatska narodna banka, Narodne novine 13/2025
Czech Republic 14, 24 Weighted MOD 11 Depend on the account Česká národní banka, vyhláška č. 169/2011 Sb.
Estonia 20 7-3-1 (mod 10) Depend on the account Estonian Banking Association (Pangaliit)
Finland 18 Luhn (mod 10) Depend on the account Finance Finland (Finanssiala)
France 26–27 Clé RIB (mod 97) FR76 when the account number has only digits CFONB, RIB standard (Banque de France)
Hungary 12, 28 Weights 9, 7, 3, 1 (mod 10) Depend on the account Magyar Nemzeti Bank, 35/2017. (XII. 14.) MNB rendelet
Italy 5 CIN check letter (mod 26) Depend on the account ABI, coordinate bancarie (Banca d'Italia)
Kosovo 19–20 MOD 97-10 XK05 Central Bank of the Republic of Kosovo (BQK)
Mauritania 26–27 RIB key (mod 97) MR13 Banque Centrale de Mauritanie, Instruction 16/GR/2008
Monaco 26–27 Clé RIB (mod 97) MC58 when the account number has only digits CFONB, RIB standard (Banque de France)
Montenegro 21–22 MOD 97-10 ME25 Centralna banka Crne Gore
North Macedonia 18–19 MOD 97-10 MK07 National Bank of the Republic of North Macedonia
Norway 15 MOD 11 Depend on the account Bits AS / Finans Norge
Poland 12 Weights 3, 9, 7, 1 (mod 10) Depend on the account Narodowy Bank Polski
Portugal 24–25 MOD 97-10 PT50 Banco de Portugal, NIB
Russia 22 Control key, weights 7, 1, 3 Depend on the account Bank of Russia, Procedure No. 515 of 8.9.1997
San Marino 5 CIN check letter (mod 26) Depend on the account Banca Centrale della Repubblica di San Marino (ABI standard)
Serbia 21–22 MOD 97-10 RS35 Narodna banka Srbije
Slovakia 14, 24 Weighted MOD 11 Depend on the account Národná banka Slovenska, opatrenie č. 8/2009
Slovenia 18–19 MOD 97-10 SI56 Banka Slovenije, Uradni list RS 85/2016
Spain 13–14 Control digits (mod 11) Depend on the account Consejo Superior Bancario, Código Cuenta Cliente (AEB/CECA)
Timor-Leste 22–23 MOD 97-10 TL38 Banco Central de Timor-Leste
Tunisia 23–24 RIB key (mod 97) TN59 Banque Centrale de Tunisie

For a few other countries, such as Burundi, Djibouti and São Tomé and Príncipe, the registry examples suggest a national check as well, but we have not found an official description. The generator leaves those digits random.

Fixed IBAN check digits

A MOD 97 tail or a RIB key makes the BBAN leave the same remainder when divided by 97, whatever the account. Since the IBAN check digits depend only on that remainder and the country code, every valid IBAN of these countries has the same check digits: every Portuguese IBAN starts with PT50, every Serbian one with RS35 and every Tunisian one with TN59. French IBANs whose account number has only digits all start with FR76. Letters in a French account number change the result, which is why the registry example above starts with FR14.

This is a handy sanity check when you read IBANs from these countries: other check digits mean the IBAN is wrong.

Should a validator check them?

MOD-97 already catches every single wrong digit and every swap of two neighbouring digits, so national checks add little against typing mistakes. They help in other cases: an IBAN built by hand from a wrong domestic number, or a fabricated IBAN whose author only computed the MOD-97 digits.

Before you add them to your own validator:

  • Each country needs its own algorithm, and each one must follow the official rule exactly. A wrong implementation rejects real customers' IBANs, which is worse than not checking.
  • Test every algorithm with real-format examples, such as the registry example on each country page.
  • Keep the error message specific. "The national check digits do not match" helps a user more than "Invalid IBAN".

Our IBAN validator verifies the national check digits wherever the rule is known and says so when it is not. The open-source iban-check library covers the structural checks and MOD-97.

Testing with national check digits

The generator calculates the national check digits for every country in the table above, in both modes, realistic and fully random, so validators that verify them accept the generated IBANs. For a negative test, change one of the national check digits and recalculate the IBAN check digits: the IBAN then passes MOD-97 but fails the national check. The validator suggests the matching IBAN check digits when they are wrong. Test IBANs for developers and QA covers the other layers a validator checks.

Sources

  • SWIFT IBAN Registry, Release 102 (June 2026): the BBAN structure of every country and the examples used above.
  • ISO/IEC 7064: the MOD 97-10 and MOD 11,10 check character systems.
  • Czech National Bank, IBAN: Decree 169/2011 Coll. on the Czech account number and its check.
  • 35/2017. (XII. 14.) MNB rendelet, Annex 1: the Hungarian account number and its check digits.
  • The national sources listed in the table: central banks, banking associations and their published standards.

Need a test IBAN?

Generate a valid IBAN for any of 91 countries, copy it in the format you need and see what each segment means.

Open the generator