Skip to content

Mexican CLABE Generator & Validator | Free Testing Tool

Generate valid Mexican CLABE numbers for software testing, or verify an existing CLABE's bank code, branch, and check digit. Free, no signup required.

Mexican CLABE Generator

Generate valid Mexican CLABE (Clave Bancaria Estandarizada) numbers for software testing or verify existing ones.

Loading calculator...
📚

Documentation

What Is a CLABE Number?

A CLABE (Clave Bancaria Estandarizada, or "standardized banking code") is the 18-digit number that identifies a bank account in Mexico. Every account at every Mexican bank has one. Banks and payment systems use it to route electronic transfers to the right account. This tool generates CLABE numbers that follow the correct format for software testing, and it checks whether an existing CLABE is valid.

Mexico introduced the CLABE in 2004 together with SPEI (Sistema de Pagos Electrónicos Interbancarios), the country's real-time interbank payment system, which is operated by the central bank, Banco de México. Before CLABE existed, each bank used its own account-number format, and that made transfers between banks slow and error-prone. A single 18-digit format fixed that.

CLABE Structure

A CLABE always has exactly 18 digits, split into four parts:

  1. Bank code (digits 1-3): identifies the bank. For example, 002 is Banamex, 012 is BBVA Bancomer, 014 is Santander, 021 is HSBC, and 072 is Banorte.
  2. Branch code (digits 4-6): identifies the branch where the account was opened.
  3. Account number (digits 7-17): an 11-digit number that identifies the specific account at that branch.
  4. Check digit (digit 18): a single digit calculated from the first 17 digits, used to catch typos.

CLABE Check Digit Formula

The check digit comes from a weighted checksum. The calculation:

  1. Multiply each of the first 17 digits by a weight. The weights repeat in the pattern 3, 7, 1, 3, 7, 1, and so on across all 17 positions.
  2. For each product, keep only its last digit (the product mod 10).
  3. Add up all 17 of those last digits to get a sum.
  4. Take the sum mod 10. Call this value m.
  5. The check digit is (10 - m) mod 10.

The final "mod 10" in step 5 matters: it turns a result of 10 into 0, so the check digit is always a single digit from 0 to 9.

This kind of checksum catches most common data-entry mistakes, such as a single wrong digit or two digits swapped, because those errors almost always change the calculated check digit.

Worked Example

Take the first 17 digits 01234512345678901, built from bank code 012 (BBVA Bancomer), branch code 345, and account number 12345678901.

Multiplying each digit by its weight (3, 7, 1, 3, 7, 1, 3, 7, 1, 3, 7, 1, 3, 7, 1, 3, 7) and keeping only the last digit of each product gives: 0, 7, 2, 9, 8, 5, 3, 4, 3, 2, 5, 6, 1, 6, 9, 0, 7

These sum to 77. Taking 77 mod 10 gives 7. The check digit is (10 - 7) mod 10 = 3.

So the complete, correctly checksummed CLABE is:

012345123456789013

Reading it back: 012 is the bank code (BBVA Bancomer), 345 is the branch code, 12345678901 is the account number, and 3 is the check digit.

How the Generator Works

The tool builds a CLABE by combining a bank code, a random branch code, and a random 11-digit account number, then computing the correct check digit with the formula above. The result always has a valid format and a correctly matching check digit.

Generate a single CLABE. Pick a specific bank, or let the tool choose one at random. The result shows each part of the number separately.

Generate multiple CLABEs. Create up to 100 at once, either from one chosen bank or with banks mixed at random. Each one in the batch is unique.

Verify a CLABE. Enter any 18-digit number. The tool checks three things: that it has exactly 18 digits, that the first three digits match a real bank code, and that the 18th digit matches the value the formula produces for the first 17 digits.

What the Generated Numbers Are For

Generated CLABEs are not linked to any real bank account. They have the correct format and a correctly calculated check digit, so software that only checks structure will accept them, but no money can actually be sent to them. They are meant for automated tests, form validation, database seeding, and similar development work, not for real transfers. A generated CLABE should never be used for an actual payment or stored in a production system as if it were a real customer account.

Bank codes can change over time as institutions merge or new ones are licensed. The bank code list used by this tool may lag behind the most recent official changes, so anyone working on a project that depends on an exact, current bank code should confirm it against Banco de México's own CLABE documentation.

Frequently Asked Questions

What is a CLABE number used for?

It identifies a specific bank account in Mexico, so that an electronic transfer reaches the correct bank, branch, and account.

How can I tell which bank a CLABE belongs to?

The first three digits are the bank code. For example, 012 is BBVA Bancomer, 014 is Santander, and 072 is Banorte.

Are the CLABEs this tool generates linked to real accounts?

No. They are correctly formatted and pass structural validation, but they do not correspond to any real account. They should be used only for testing.

How do I check if a CLABE is valid?

Check three things: it must be exactly 18 digits, the first three digits must be a real bank code, and the 18th digit must match the value calculated from the first 17 digits using the weighted checksum described above.

Can a random 18-digit number pass as a valid CLABE?

Rarely. Only about one in nine three-digit codes belongs to a real bank, and only one of the ten possible last digits gives the correct check digit for any given 17-digit prefix. Combined, a random 18-digit number has roughly a 1% chance of passing both checks.

Why would a bank reject a CLABE that this tool marks as valid?

This tool only checks structure: length, bank code, and check digit. A bank also checks whether the account actually exists and is open. A structurally valid but made-up CLABE will fail at that second step, since it points to no real account.

References

  1. Banco de México, "CLABE - Clave Bancaria Estandarizada": https://www.banxico.org.mx/servicios/clabe-estandarizada.html
  2. Banco de México, "Sistema de Pagos Electrónicos Interbancarios (SPEI)": https://www.banxico.org.mx/sistemas-de-pago/servicios/sistema-de-pagos-electronicos-interbancarios-spei/
  3. Asociación de Bancos de México (ABM): https://www.abm.org.mx/