Mexican data,
validated.
CURP, RFC, CLABE, NSS, postal codes, phone numbers and amounts in words. One tiny TypeScript library that gets the details right.
A CURP, RFC, CLABE, NSS, postal code, phone number or amount. It figures out which one it is.
- Bank
- Banamex
- Bank code
- 002
- Plaza
- 010
- Account
- 07777777777
Runs in your browser. Nothing you type leaves this page.
Everything a Mexican form needs
Each module validates, explains what's wrong, and pulls the useful data out.
CURP
Validate, read birth date, sex and state, or generate one with RENAPO's rules.
parseCurp("LOOA531113HTCPBN07")?.birthDate
// "1953-11-13"RFC
People, companies and generic RFCs, with SAT's check digit.
parseRfc("EKU9003173C9")?.type
// "company"CLABE
Check the digits and find the bank, plaza and account.
parseClabe("002010077777777771")?.bank
// { code: "002", name: "Banamex" }NSS
IMSS social security numbers, with registration and birth year.
parseNss("72795608040")?.birthYear
// 1956Postal codes
Which of the 32 states a postal code belongs to.
stateFromPostalCode("42800")?.name
// "Hidalgo"Phone numbers
Normalize +52, 044, 01 and friends. Format them properly.
formatPhone("+52 1 773 152 1627")
// "773 152 1627"Amounts in words
Cantidad con letra, the way invoices and checks write it.
amountToWords(21)
// "VEINTIÚN PESOS 00/100 M.N."Install it, import what you need, ship the form.
Read the docsErrors you can show in any language
Every check returns an error code instead of a message, so your form can say exactly what's wrong, in your words.
const result = checkCurp(input);
if (!result.ok) {
// "format" | "date" | "state" | "check-digit"
setError(messages[result.error]);
}Start in a minute
Install it, import what you need, ship the form.