CURP and RFC Explained: How Mexico's Identity and Tax Codes Are Built
Learn how the Mexican CURP and RFC are built from your name and birth date, what the homoclave is, why codes can differ and how to check a check digit.

Almost every form in Mexico asks for two codes: the CURP and the RFC. Banks, schools, employers, hospitals and government offices use them to identify you. They look like random strings of letters and numbers, but each character follows a rule. This guide explains how both codes are built and how to use the free CURP and RFC Generator to understand yours, spot errors on documents or validate a code someone gave you.
Two codes, two institutions
The CURP (Clave Única de Registro de Población) is issued by RENAPO, the national population registry, to everyone registered in Mexico, including children and foreigners with legal residence. It has 18 characters.
The RFC (Registro Federal de Contribuyentes) is issued by SAT, the tax administration, when you register as a taxpayer. For individuals it has 13 characters; for companies it has 12. Since 2022 most adults who work, even as employees, need an RFC because employers must put it on payroll receipts.
The four letters
Both codes start with four letters taken from your name:
- The first letter of your first (paternal) surname.
- The first internal vowel of that surname, meaning the first vowel after the first letter.
- The first letter of your second (maternal) surname.
- The first letter of your given name.
So Gloria Hernández García starts with H (Hernández), E (first vowel after H), G (García) and G (Gloria): HEGG.
Several rules adjust this. Words such as de, del, la, los, las, mac and von are ignored, so María de la Luz becomes Luz for this purpose when María is the first given name. If your first given name is José or María and you have a second one, the second is used. Accents are removed, and Ñ becomes X. If you have only one surname, the CURP uses X in place of the missing one, and the RFC uses the first two letters of the surname and the first two of the given name instead.
Finally, if the four letters spell a rude or offensive word in Spanish, one letter is replaced with an X so the code is not embarrassing.
The date and the rest of the CURP
After the letters come six digits for your birth date as year, month and day: 560427 for 27 April 1956.
The CURP then adds:
- One letter for sex as registered: H, M or, since 2023 in some states, X.
- Two letters for the state of birth, such as VZ for Veracruz, JC for Jalisco, DF for Mexico City and NE for people born abroad.
- Three consonants: the first internal consonant of the first surname, the second surname and the given name.
- One differentiator: usually 0 to 9 for people born before 2000 and a letter for those born from 2000.
- One check digit calculated from the previous 17 characters.
The differentiator is the reason a generated CURP might not match your real one. When two people would get exactly the same first 16 characters, RENAPO assigns different values in position 17. The tool uses the usual default, so most people get the right code, but you should always confirm with RENAPO.
The homoclave and check digit of the RFC
After the four letters and six digits, the RFC adds a two-character homoclave and a check digit. The homoclave is calculated from your full name, with each letter turned into a two-digit number, multiplied in pairs and summed; the remainder is converted into two characters from a table. Its purpose is to separate people who share the same first ten characters.
The final character is a check digit computed with weights from 13 down to 2 and a modulo 11 rule. That digit lets software detect a single typing mistake.
How to use the generator
- Enter your given names exactly as on your birth certificate.
- Enter your paternal and maternal surnames, leaving the second blank if you have only one.
- Set your date of birth, sex and state of birth.
- Read the CURP and RFC, with a table explaining each part.
- To check a code from a form, paste it into the validation fields. The tool checks the structure, the state code and the check digit.
When this is useful
- You are filling in a form and are not sure whether your RFC has a homoclave.
- An employer printed your RFC on a payroll receipt and you want to check it.
- A school asks for a child's CURP and the paper copy is hard to read.
- You are a developer and need to test validation rules on a form.
What it cannot do
A validation only tells you a code is well formed. It does not prove the code is registered or belongs to that person. A generated code is not an official document.
To get the official codes, download your CURP free at gob.mx/curp and your RFC from the Constancia de Situación Fiscal in the SAT portal. Use those on contracts, invoices and government procedures.
Limits
The rules used here are the ones published for individuals. Very unusual names, foreign names or names changed by court order may be handled differently by RENAPO or SAT, so always rely on the official record.



