Tresoria
← All articles
Blog

RIB and ICE in Morocco: how to read a bank statement

April 10, 2026

Decoding a Moroccan bank statement: the structure of the 24-digit RIB, the 15-digit ICE, what these identifiers are for, and why they matter for treasury, reconciliation and importing statements.

How many digits does a Moroccan RIB have?

A Moroccan RIB (Relevé d'Identité Bancaire) has 24 digits. It reads as four blocks: the bank code, the city (branch) code, the account number and a two-digit check key. The ICE (Identifiant Commun de l'Entreprise) has 15 digits.

Built on the RIB, the Moroccan IBAN has 28 characters: the MA prefix, two check digits, then the 24 RIB digits.

How to read a Moroccan bank statement

A Moroccan bank statement summarises the movements on an account over a given period. At the top you will find the account holder's identity, the branch details and, above all, the RIB, which uniquely identifies the account. Then come the opening balance, the list of entries and the closing balance.

Each entry line generally shows a transaction date, a value date, a description and an amount in debit or credit. The value date, often different from the transaction date, determines when the movement is actually taken into account for calculating interest and the cash position: a crucial nuance in treasury management.

Reading these elements is the basis of any rigorous monitoring. Two identifiers appear constantly in banking and commercial exchanges in Morocco: the RIB for the account, and the ICE for the company.

The RIB: 24 digits decoded

The RIB, or Relevé d'Identité Bancaire, is made up of 24 digits that uniquely identify an account. It breaks down into four blocks: a bank code, a city or locality (branch) code, the account number, and a RIB check key on the last two digits.

The bank code, on the first digits, designates the institution holding the account: each Moroccan bank has its own code. The RIB key is a control key calculated from the other digits; it helps detect a data-entry error. In between, the middle digits identify the branch and the account number itself.

The RIB also sits at the heart of the Moroccan IBAN, which adds the prefix MA followed by two check digits in front of the 24 RIB digits, for 28 characters in total. A single wrong digit is enough to make the RIB invalid, which is precisely why the check key matters for transfers and direct debits.

Anatomy of a RIB

007Bank code · 3 digits
780City code · 3 digits
0001234567890123Account number · 16 digits
96Key · 2 digits

Moroccan IBAN: MA, 2 check digits, then the 24 RIB digits

MA64007780000123456789012396

28 characters in all.

Made-up example: this RIB matches no account.

Example: a RIB read block by block

Take a made-up RIB, the one from the checker's example above: 007 780 0001234567890123 96. The first three digits, 007, are the bank code: they designate Attijariwafa Bank. The next three, 780, are the branch's city code. Then come the 16 digits of the account number, 0001234567890123, and finally the key, 96.

Reading a RIB block by block catches a mistake before you even compute the key: a bank code that matches no bank, or a block of the wrong length, points straight to a typing error.

How the RIB key is calculated

The RIB key is chosen so that the number formed by all 24 digits is a multiple of 97. To find it, take the first 22 digits, append two zeros, compute the remainder of the division by 97, then subtract that remainder from 97: key = 97 − (first 22 digits × 100 mod 97).

In the example, 0077800001234567890123 followed by 00 leaves a remainder of 1 when divided by 97, so the key is 97 − 1 = 96.

A single wrong digit, or two neighbouring digits swapped, always changes that remainder. That is why a key that does not match is enough to reject a RIB before a transfer goes out.

Bank codes in Morocco

The first three digits of a RIB designate the bank that holds the account. The table below lists the national codes as they appear in Tresoria's bank catalogue, the same one the checker uses.

Banque Populaire is a special case: besides the 190 code of Banque Centrale Populaire, each regional Banque Populaire has its own code, from 101 to 197. Some participatory banks issue their RIBs under their parent bank's code: Bank Assafa under 007, Bank Al Yousr under 190 and Umnia Bank under 230.

Bank codes

CodeBank
007Attijariwafa Banksame code as Bank Assafa
011Bank of Africa
013BMCI
021Crédit du Maroc
022Saham Bankformerly Société Générale Maroc
050CFG Bank
190Banque Centrale Populairesame code as Bank Al YousrRegional Banques Populaires: codes 101 to 197
225Crédit Agricole du Maroc
230CIH Banksame code as Umnia Bank
350Al Barid Bank
Source: Tresoria's bank catalogue.

24, 26 or 28 digits: RIB and IBAN

A Moroccan RIB always has 24 digits. The Moroccan IBAN takes those 24 digits and puts MA and two check digits in front of them: 28 characters in all, often printed in groups of four, which gives MA64 0077 8000 0123 4567 8901 2396 for the example.

If you count 26 digits, you have most likely copied the IBAN without the letters MA: drop the two digits that followed them and what remains is the RIB. Conversely, a hand-typed IBAN can carry wrong check digits even when the RIB is right; the checker above flags it.

The ICE: the common company identifier

The ICE, or Identifiant Commun de l'Entreprise, is a 15-digit identifier assigned to every company in Morocco. Its purpose is to provide a single identifier shared across the various administrations (tax, customs, social security, commercial register), where several separate numbers previously coexisted.

The ICE is mandatory on commercial and tax documents, notably invoices. It identifies without ambiguity the company issuing or receiving a transaction. The secondary establishments of a single company share a common root while remaining distinguishable, which makes it easier to track different sites.

For treasury, the ICE is valuable: it makes identifying third parties, customers and suppliers alike, more reliable than the company name alone, which is often subject to variations in spelling or abbreviation.

RIB, ICE, IF, RC: don't confuse the identifiers

Several identifiers coexist in Morocco, and they should not be confused. The RIB identifies a bank account; the ICE identifies the company across all administrations; the Tax Identifier (IF) is used by the tax authority; the Commercial Register number (RC) corresponds to registration with the commercial court.

These identifiers do not replace one another; they are complementary. A compliant invoice generally shows the issuer's company name, ICE, IF and RC, while a transfer order relies on the beneficiary's RIB or IBAN. Telling them apart avoids costly payment or reporting errors.

Why RIB and ICE matter for treasury

In treasury, the RIB and the ICE play a direct role in the reliability of operations. The RIB determines the routing of transfers and direct debits to the correct account: a wrong bank code, and the payment fails or goes to the wrong place. Recognising the bank code also tells you immediately which bank an account belongs to.

The ICE, for its part, secures the reconciliation between bank entries, invoices and third parties. When a payment lands on the account, linking the movement to the right customer is more reliable with a stable identifier such as the ICE than with a mere description, which is often truncated or approximate on statements.

Together, these identifiers reduce reconciliation gaps, speed up matching and improve the quality of forecasts, since well-identified inflows and outflows are easier to categorise and to plan.

Importing and cleaning up your bank statements

Many Moroccan companies feed their cash monitoring from the statements provided by their banks, exported as a file (CSV, Excel or XML) and then imported into a management tool. The quality of that import depends directly on clean identifiers: the RIB for the account, the ICE and descriptions for third parties.

This is where recognising bank codes proves its worth. Tresoria relies on a list of Moroccan banks to recognise the bank code contained in the RIB and to label each account correctly at import. Bank data enters through file import or scheduled connectors (SFTP, REST); a live bank connection is not yet available and is among the planned developments.

Upstream, a few good practices limit errors: checking the RIB control key, keeping each third party's ICE up to date, and standardising descriptions. Reliable identifiers going in mean faster reconciliation and more solid cash forecasts coming out.

See Tresoria on your own accounts

A thirty-minute demo, with your statements. No commitment.

Request a demo