Guide · Identity

CURP, RFC, NSS and INE: what each Mexican ID identifies and what you can validate offline

Mexico's CURP, RFC, NSS and INE are not interchangeable: who assigns each one, who has it, what is inside and what you can validate offline.

OrigoID team Published on 7 min read Leer en español
In this guide
  1. The four, side by side
  2. CURP
  3. RFC
  4. NSS
  5. The INE voter card
  6. How they relate
  7. Six common mistakes
  8. In short
  9. Sources

If you build customer, employee or supplier onboarding for Mexico, sooner or later the form asks for four things: CURP, RFC, NSS and INE. They look alike, they get mixed up, and they are not interchangeable. Each one is issued by a different institution, answers a different question and is held by a different group of people.

This article puts them side by side: what each one is, what is inside it, what you can check without calling anyone, and which mistakes keep coming up when storing them.

The four, side by side

CURP RFC NSS INE voter card
Identifies The person The taxpayer The person before Social Security A citizen entitled to vote
Issued by RENAPO (population registry) SAT (tax authority) IMSS (social security) INE (electoral institute)
Who has it Anyone living in Mexico, and Mexicans abroad Individuals and companies registered with SAT Anyone who has been registered with IMSS Mexican citizens who applied for it
Shape 18 characters 13 (individual) or 12 (company) 11 digits A document with several numbers
Expires No No No Yes, after ten years

The last column causes the most trouble: the INE card is not a number. It is a document that carries several.

CURP

The Clave Única de Registro de Población is assigned by the National Population Registry. It registers individually every person living in the country, Mexican or foreign, and Mexicans living abroad. That is why a newborn has one and so does a foreign resident: it is the closest thing Mexico has to a person identifier.

It has 18 characters, and of the four it packs the most data: letters from the surnames and given name, date of birth, sex, state of birth, a differentiator that also tells the century, and a check digit.

Offline you can check the shape, that the date exists and is not in the future, and the check digit. The regex, the algorithm and code in three languages are in How to validate a Mexican CURP. Whether it is active in the registry only RENAPO can answer, through an API to validate a CURP.

RFC

The Registro Federal de Contribuyentes is assigned by SAT. Individuals and companies registered for tax purposes have one, which makes it the only one of the four that also identifies a company.

An individual's RFC has 13 characters and a company's has 12: letters from the name, a date (birth or incorporation), two homoclave characters and a check digit. Unlike the CURP, it can contain Ñ and &, and the date does not tell the century.

Offline you can check the shape and that the date exists. The check digit is not a reason to reject: there are valid RFCs that fail it, starting with the generic XAXX010101000. The details are in How to validate a Mexican RFC.

NSS

The Número de Seguridad Social is assigned by IMSS to each worker the first time they are registered. IMSS defines it as an 11-digit numeric key that is unique, permanent and non-transferable. Someone who has never been registered with IMSS does not have one.

According to IMSS's own rules, the number identifies the state where it was issued, the year of enrollment, the year of birth and a sequential number; that is ten digits plus a check digit.

Three things to keep in mind:

Python
import re


def nss_check_digit(body: str) -> int:
    """Check digit for the first 10 digits of an NSS (Luhn)."""
    total = 0
    for i, ch in enumerate(body):
        d = int(ch) * (2 if i % 2 else 1)
        total += d - 9 if d > 9 else d
    return (10 - total % 10) % 10


def nss_looks_valid(value: str) -> bool:
    """Shape and check digit only. It does not say the NSS exists."""
    return bool(re.fullmatch(r"[0-9]{11}", value)) and nss_check_digit(value[:10]) == int(value[10])
Python
>>> nss_check_digit("1234567890")
3
>>> nss_looks_valid("12345678903")
True

Since the algorithm does not come from an official source, treat it like the RFC's check digit: use it to warn about a possible typo, not to reject.

The INE voter card

The credencial para votar is issued by the Instituto Nacional Electoral to Mexican citizens who apply for it. It is used to vote and as official identification. Two facts set it apart from the other three:

Among the things printed on it:

So there is no such thing as "the INE number". When a requirement asks for it, ask which one.

Offline there is little you can check: the length of each number and the expiry year printed on the card. Whether the card is still valid and has not been reported is something only INE can answer.

How they relate

The CURP is the hub. The other three lean on it:

Being related does not mean one can be computed from another. The first ten characters of a person's CURP and RFC usually match, because both come from the name and the date of birth, but the rules are not the same:

Case CURP RFC
Ñ among the letters Becomes X Can appear
The four letters spell an offensive word (PEDO) The second letter changes: PXDO The last one changes: PEDX

Do not build the RFC from the CURP or the other way around. Ask for both.

Six common mistakes

  1. One regex for everything. The CURP and the clave de elector both have 18 characters and start the same way; they are not the same thing. The RFC allows Ñ and &; the CURP does not.
  2. Storing identifiers as numbers. The NSS, the CIC and the OCR are all digits. They are still text.
  3. A field called "INE number". The card carries several numbers and they change with the model. Name the field after what it holds: clave_elector, cic, ocr.
  4. Assuming everyone has all four. A minor has a CURP and no INE card. Someone who has never been registered with IMSS has no NSS. A company only has an RFC.
  5. Treating every check digit the same. The CURP's is a reason to reject. The RFC's and the NSS's are only a warning: the generic RFC XAXX010101000 fails its own, and the NSS algorithm is not official.
  6. Trusting two-digit years. The CURP tells you the century; the RFC and the NSS do not.

In short

Sources

Related services

Keep reading

All guides ›
Identity Validate a Mexican CURP: regex and check digit

Offline CURP validation: a regex true to the official rules, the real date and the check digit algorithm, with tested code in Python, JavaScript and Go.

10 min
For developers Mexican identity verification with MCP

From zero to a service that validates Mexico's CURP with OrigoID's API using its MCP server in Claude Code, and the design choices that make it fast.

5 min
Compliance Mexico's UIF blocked persons list: what to check

Mexico's UIF blocked persons list is confidential and has no public lookup. Its seven legal grounds and the public lists you can screen instead.

6 min
Start free, no card.

Courtesy credits to try it with your own data. Access is enabled after a brief validation of your company.

Request access