Mexican CLABE Generator
Generate valid Mexican CLABE (Clave Bancaria Estandarizada) numbers for software testing or verify existing ones.
Mexican CLABE Generator for Testing
Introduction
The Mexican CLABE (Clave Bancaria Estandarizada or Standardized Banking Code) is an 18-digit numeric code used in Mexico's banking system to standardize and facilitate electronic funds transfers. For software developers, QA engineers, and financial technology professionals, having access to valid CLABE numbers is essential for testing payment systems, banking applications, and financial software that interacts with Mexican banking infrastructure.
This Mexican CLABE Generator tool creates valid CLABE numbers that follow the official format and validation rules established by the Mexican Banking Association (ABM). Whether you need a single CLABE for a quick test or multiple CLABEs for comprehensive testing scenarios, this tool provides properly formatted numbers with valid check digits that pass standard verification processes.
Understanding CLABE Numbers
What is a CLABE?
A CLABE (Clave Bancaria Estandarizada) is Mexico's standardized banking code used for all electronic funds transfers within the Mexican banking system. Introduced in 2004, the CLABE system ensures that bank transfers can be processed accurately and efficiently across different financial institutions in Mexico.
CLABE Structure
Every CLABE consists of exactly 18 digits, divided into four key components:
- Bank Code (digits 1-3): Identifies the specific bank in Mexico
- Branch Code (digits 4-6): Identifies the specific branch of the bank
- Account Number (digits 7-17): The unique account identifier (11 digits)
- Check Digit (digit 18): A verification digit calculated using a specific algorithm
For example, in the CLABE number 012345678901234567
:
012
is the bank code (BBVA Bancomer)345
is the branch code67890123456
is the account number7
is the check digit
How CLABE Numbers Are Generated
Bank Codes
The first three digits of a CLABE represent the bank code, which identifies the specific financial institution in Mexico. These codes are standardized and assigned by the Mexican Banking Association (ABM). Our generator includes all official bank codes from the Mexican financial system, including major banks like:
- 002 - BANAMEX
- 012 - BBVA BANCOMER
- 014 - SANTANDER
- 021 - HSBC
- 072 - BANORTE
Branch Codes
The next three digits (positions 4-6) represent the branch code. While real branch codes correspond to specific physical locations of banks, for testing purposes, our generator creates random but valid-format branch codes.
Account Numbers
Positions 7-17 contain the 11-digit account number. In production systems, these numbers are unique to each bank account. Our generator creates random account numbers that follow the proper format but are not linked to real accounts.
Check Digit Calculation
The 18th digit is a check digit calculated using a specific algorithm:
- Each of the first 17 digits is multiplied by a corresponding weight value
- The weights follow the pattern: 3, 7, 1, 3, 7, 1, ... (repeating)
- Only the last digit of each multiplication result is used
- These digits are summed
- The check digit is calculated as (10 - (sum mod 10)) mod 10
This algorithm ensures that the CLABE number passes validation checks.
function calculateCheckDigit(clabe17) {
// Weights for each position
const weights = [3, 7, 1, 3, 7, 1, 3, 7, 1, 3, 7, 1, 3, 7, 1, 3, 7];
// Calculate the weighted sum
let sum = 0;
for (let i = 0; i < 17; i++) {
const digit = parseInt(clabe17[i], 10);
const product = digit * weights[i];
sum += product % 10; // Only the last digit of the product is used
}
// Calculate the check digit
const mod = sum % 10;
const checkDigit = (10 - mod) % 10; // If mod is 0, check digit is 0
return checkDigit;
}
Using the CLABE Generator Tool
Our CLABE generator offers three main functions:
1. Generate a Single CLABE
This option creates one valid CLABE number. You can:
- Select a specific bank or let the tool randomly choose one
- Copy the generated CLABE to your clipboard with a single click
- View a breakdown of the CLABE components (bank code, branch code, account number, check digit)
2. Generate Multiple CLABEs
When you need several CLABE numbers for testing:
- Specify the number of CLABEs to generate (up to 100)
- Optionally select a specific bank for all generated CLABEs
- Copy individual CLABEs or the entire set
- Each CLABE is guaranteed to be unique and valid
3. Verify a CLABE
To check if a CLABE number is valid:
- Enter the 18-digit CLABE you want to verify
- The tool will check:
- If the format is correct (18 digits)
- If the bank code exists in the Mexican banking system
- If the check digit is valid
- For valid CLABEs, you'll see a breakdown of its components
- For invalid CLABEs, you'll see specific error messages explaining why it's invalid
CLABE Verification Process
When verifying a CLABE, our tool performs several checks:
- Format Check: Ensures the input consists of exactly 18 digits
- Bank Code Validation: Verifies that the first three digits correspond to a real Mexican bank
- Check Digit Validation: Recalculates the check digit and compares it with the provided one
def validate_clabe(clabe):
# Check if CLABE is 18 digits
if not re.match(r'^\d{18}$', clabe):
return {"isValid": False, "errors": ["CLABE must be exactly 18 digits"]}
# Extract components
bank_code = clabe[0:3]
branch_code = clabe[3:6]
account_number = clabe[6:17]
provided_check_digit = clabe[17]
# Validate bank code
if bank_code not in MEXICAN_BANKS:
return {"isValid": False, "errors": ["Invalid bank code"]}
# Validate check digit
calculated_check_digit = calculate_check_digit(clabe[0:17])
if int(provided_check_digit) != calculated_check_digit:
return {"isValid": False, "errors": ["Invalid check digit"]}
# If all checks pass
return {
"isValid": True,
"bankCode": bank_code,
"bankName": MEXICAN_BANKS[bank_code],
"branchCode": branch_code,
"accountNumber": account_number,
"checkDigit": provided_check_digit
}
Use Cases for the CLABE Generator
Software Development and Testing
-
Payment System Integration: When developing systems that integrate with Mexican payment gateways or banking APIs, you need valid CLABE numbers to test the integration.
-
Form Validation: For applications that collect CLABE numbers, you can use this tool to generate valid test data and verify your validation logic.
-
Database Testing: When populating test databases with Mexican banking information, this tool provides realistic CLABE numbers.
-
Regression Testing: Use consistent, valid CLABE numbers across test suites to ensure your application handles Mexican banking data correctly.
Financial Application Testing
-
Cross-Border Payment Testing: For applications handling international transfers to Mexico, test with valid CLABE numbers.
-
Banking App Simulation: Create realistic test scenarios for banking applications that process Mexican transfers.
-
Error Handling: Test how your system responds to valid and invalid CLABE numbers to ensure robust error handling.
Educational Purposes
-
Learning Mexican Banking Standards: Understand the structure and validation rules of CLABE numbers.
-
Financial Technology Training: Use the tool to demonstrate Mexican banking standards in fintech training programs.
Limitations and Considerations
While our CLABE generator creates technically valid numbers that pass standard validation checks, it's important to understand these limitations:
-
Not Connected to Real Accounts: Generated CLABEs are not linked to actual bank accounts and cannot be used for real transactions.
-
Testing Only: These CLABEs should only be used in testing environments, never in production systems.
-
Bank Code Updates: The Mexican Banking Association occasionally updates the list of official bank codes. Our tool is regularly updated, but there might be a short delay in reflecting the very latest changes.
-
Security Considerations: Never use generated test CLABEs in security-sensitive contexts or as substitutes for proper security testing.
Alternatives to CLABE
While CLABE is the standard for Mexican interbank transfers, other identification systems exist in the financial world:
-
IBAN (International Bank Account Number): Used primarily in Europe and some other countries, but not in Mexico.
-
SWIFT/BIC Codes: Used for international transfers, often in conjunction with CLABE for transfers to Mexico.
-
ABA Routing Numbers: Used in the United States banking system.
-
Account Numbers: Simple bank account numbers without the standardized format of CLABE.
For testing Mexican financial systems specifically, CLABE is the required standard.
History of CLABE in Mexico
The CLABE system was introduced in Mexico in 2004 by the Mexican Banking Association (Asociación de Bancos de México, ABM) to standardize electronic funds transfers between Mexican banks. Before CLABE, each bank had its own account numbering system, making interbank transfers complicated and error-prone.
The implementation of CLABE coincided with the development of the Interbanking Electronic Payment System (Sistema de Pagos Electrónicos Interbancarios, SPEI), Mexico's real-time gross settlement system operated by the central bank, Banco de México.
Since its introduction, CLABE has become mandatory for all interbank electronic transfers in Mexico, significantly improving the efficiency and reliability of the Mexican banking system.
Frequently Asked Questions
What is a CLABE number used for?
A CLABE number is used to identify bank accounts within the Mexican banking system for electronic funds transfers. It ensures that money is sent to the correct account at the correct bank and branch.
How can I tell which bank a CLABE belongs to?
The first three digits of a CLABE number identify the bank. For example, 012 indicates BBVA Bancomer, 072 indicates Banorte, and 002 indicates Banamex.
Are generated CLABE numbers connected to real accounts?
No. The CLABE numbers created by this tool are structurally valid but are not connected to any real bank accounts. They should only be used for testing purposes.
How do I know if a CLABE number is valid?
A valid CLABE number must:
- Contain exactly 18 digits
- Have a valid bank code (first 3 digits)
- Have a correct check digit (last digit) Our verification tool checks all these criteria.
Can I use these generated CLABEs for real transactions?
No. These are test CLABEs only and should never be used for real financial transactions. They will not route to actual accounts.
How often are the bank codes updated?
We regularly update our bank code database to reflect changes in the Mexican banking system. However, if you notice any discrepancies, please let us know.
Why does my bank app reject a CLABE that your tool says is valid?
While our tool verifies the structural validity of a CLABE, bank applications may perform additional checks specific to their systems, such as verifying that the account actually exists in their database.
Can I generate CLABEs for a specific bank?
Yes, our tool allows you to select a specific bank when generating CLABEs, ensuring that the bank code portion matches your selected institution.
How is the check digit calculated?
The check digit is calculated using a weighted modulo 10 algorithm. Each of the first 17 digits is multiplied by a specific weight (3, 7, 1, 3, 7, 1, ...), and only the last digit of each product is used. These digits are summed, and the check digit is calculated as (10 - (sum mod 10)) mod 10.
Is there a limit to how many CLABEs I can generate at once?
For performance reasons, our tool limits generation to 100 CLABEs at a time, which should be sufficient for most testing scenarios.
References
-
Banco de México. "CLABE - Clave Bancaria Estandarizada." https://www.banxico.org.mx/servicios/clabe-estandarizada.html
-
Asociación de Bancos de México (ABM). "Catálogo de Claves de Instituciones de Crédito." https://www.abm.org.mx/
-
Sistema de Pagos Electrónicos Interbancarios (SPEI). "Reglas de Operación." https://www.banxico.org.mx/sistemas-de-pago/servicios/sistema-de-pagos-electronicos-interbancarios-spei/
-
Comisión Nacional Bancaria y de Valores (CNBV). "Disposiciones de carácter general aplicables a las instituciones de crédito." https://www.gob.mx/cnbv
Try our Mexican CLABE Generator now to create valid test CLABEs for your development and testing needs. Whether you're building a financial application, testing payment systems, or learning about Mexican banking standards, our tool provides the accurate test data you need.