Search docs...

Search docs...

es

CLABE

The 18-digit interbank account number used for SPEI transfers.

Try it
CLABE002010077777777771Valid
Bank
Banamex
Bank code
002
Plaza
010
Account
07777777777

Validate and parse

import { parseClabe } from "mexico-utils";

parseClabe("002 010 07777777777 1");
// {
//   clabe: "002010077777777771",
//   bank: { code: "002", name: "Banamex" },
//   plaza: "010",
//   account: "07777777777"
// }

The digits break down like this:

DigitsMeaning
1–3Bank
4–6Plaza (city)
7–17Account number
18Check digit

The bank list comes from Banxico's list of SPEI participants and is exported as BANKS. You can browse it on the banks page. If the code isn't in the list, the CLABE is still valid and bank is null, because new participants show up all the time.

ErrorMeaning
formatNot 18 digits
check-digitThe last digit doesn't match. Almost always a typo

Generate

import { generateClabe } from "mexico-utils";

generateClabe("012", "180", "01234567890");

It pads each part with zeros and adds the check digit.