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:
- It is all digits, but it is not a number. Store it as text. If you convert it to an integer and it starts with a zero, you lose the zero.
- Years have two digits. As with the RFC, you cannot know the century.
- IMSS does not publish the check digit algorithm. The digit follows the Luhn algorithm, the one used by bank cards: left to right, the first ten digits are multiplied by 1 and 2 alternately; if a product is above 9, subtract 9; add everything up, and the digit is what is missing to reach the next multiple of ten.
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])
>>> 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:
- It expires. According to INE, each card is valid for ten years from the date of issue.
- Several models are in circulation at the same time, and the oldest ones are no longer valid. The numbers printed on each model are not the same.
Among the things printed on it:
- Clave de elector (voter key), on the front. It has 18 characters and looks like a CURP, but it is not one.
- CURP, also on the front.
- CIC, the card identification code, on the back.
- OCR, an identifier number on the back, 12 or 13 digits long depending on the model.
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:
- The INE card has the CURP printed on it.
- The IMSS procedure to obtain or look up an NSS is done with the CURP and an email address.
- Tax rules let you check whether a person already has an RFC through their CURP.
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
- 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. - Storing identifiers as numbers. The NSS, the CIC and the OCR are all digits. They are still text.
- 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. - 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.
- 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
XAXX010101000fails its own, and the NSS algorithm is not official. - Trusting two-digit years. The CURP tells you the century; the RFC and the NSS do not.
In short
- What is the difference between CURP and RFC? The CURP identifies the person in the population registry; the RFC identifies the taxpayer before SAT. Companies have an RFC and no CURP.
- Is the NSS the same as the CURP? No. The NSS is assigned by IMSS and only people who have been registered there have one.
- What is the INE number? There is no single one. The card carries the clave de elector, the CURP, the CIC and the OCR, and which ones matter depends on the model.
- Which one should I use as a person identifier? The CURP: it is the only one of the four meant for every person, and it does not expire. The others serve the purpose they were made for.
- What can I validate offline? The shape of all four, the date in the CURP and the RFC, and the CURP's check digit. Whether they exist and whose they are is something only each institution can answer.
Sources
- Instructivo Normativo para la asignación de la CURP, Diario Oficial de la Federación, June 18, 2018. Structure of the CURP.
- Reglas para la asignación de la CURP, RENAPO, October 22, 2021. The
Ñand offensive words in the CURP. - tdCFDI.xsd, SAT. Official RFC pattern.
- Resolución Miscelánea Fiscal para 2026, SAT. Rule 2.4.2 (checking the RFC through the CURP) and rule 2.7.1.23 (generic RFC).
- Algoritmo para generar el RFC con homoclave para personas físicas y morales, SAT, response to information request 0610100135506, 2006. Offensive words in the RFC (Annex IV).
- Norma 3000-001-007, IMSS. Definition of the social security number and the data it identifies.
- Procedimiento 9210-003-200, IMSS. NSS as an 11-digit key, unique, permanent and non-transferable; definition of the CURP.
- Obtención o consulta de tu Número de Seguridad Social, gob.mx. Data the procedure asks for.
- ABC de la Credencial para Votar, INE, July 2026. Models, printed data and the ten-year validity.