RFC: what it is and how to test it
The RFC (Registro Federal de Contribuyentes) is the tax ID of Mexico, issued by the SAT. People have 13 characters and companies 12. Like the CURP it is built from the holder: initials, birth or incorporation date and a 3-character homoclave, and invoices (CFDI) fail when it is wrong.
For tests only. These numbers have a correct format and check digit but belong to no real person or account. Never use them to deceive, to open accounts or to bypass a check. The numbers on this page come from the same generator as the tool, with a fixed seed so that the examples do not change; the tool creates new ones at every click.
Structure of the number
Person: 4 letters, 6 digits of date (YYMMDD) and 3 of homoclave. Company: 3 letters, 6 of date and 3 of homoclave. The last homoclave character is a check digit calculated over the previous 12 positions; the generic RFC of the SAT for the public (XAXX010101000) and for foreigners (XEXX010101000) are valid although their homoclave is 000.
The check digit, step by step
The 12 positions (a company RFC has 11 before the check digit and is padded with a space on the left) take their value in the alphabet 0123456789ABCDEFGHIJKLMN&OPQRSTUVWXYZ plus space and Ñ, are multiplied by the weights 13 down to 2 and summed. The check character is 11 minus the remainder of the sum by 11, taken mod 11, as the same alphabet position: 10 is the letter A.
Worked example with SMQ 711125 TX4:
| Position | Character | Value | Weight | Product |
|---|---|---|---|---|
| 1 | (space) | 37 | 13 | 481 |
| 2 | S | 29 | 12 | 348 |
| 3 | M | 22 | 11 | 242 |
| 4 | Q | 27 | 10 | 270 |
| 5 | 7 | 7 | 9 | 63 |
| 6 | 1 | 1 | 8 | 8 |
| 7 | 1 | 1 | 7 | 7 |
| 8 | 1 | 1 | 6 | 6 |
| 9 | 2 | 2 | 5 | 10 |
| 10 | 5 | 5 | 4 | 20 |
| 11 | T | 30 | 3 | 90 |
| 12 | X | 34 | 2 | 68 |
Sum = 1613; 1613 mod 11 = 7; 11 - 7 = 4, taken mod 11; the value 4 is the character "4" of the alphabet (10 is the letter A).
Valid examples
Five numbers generated by the tool with a fixed seed, each one accepted by its validator:
| Example (formatted) | Without mask | Validator |
|---|---|---|
SMQ 711125 TX4 | SMQ711125TX4 | valid |
PLY 621221 FU0 | PLY621221FU0 | valid |
RAPX 620420 2H0 | RAPX6204202H0 | valid |
PKC 820814 M16 | PKC820814M16 | valid |
SNI 111119 TW7 | SNI111119TW7 | valid |
How the validator answers
The same first example, one with a changed ending and one truncated, checked by the validator:
| Value | Result | Reason |
|---|---|---|
SMQ 711125 TX4 | valid | - |
SMQ711125TX5 | invalid | the check digit should be 4 |
SMQ711125T | invalid | needs 12 or 13 characters |
Common mistakes
- A 12-character RFC is a company, not a typo: validate the length first and pad a company RFC with a space on the left before the weighted sum.
- Do not treat the homoclave as free text: the SAT assigns it and a validator can only check its last character.
Frequently asked questions
What is the difference between RFC and CURP?
The CURP identifies a person for civil purposes and has 18 characters; the RFC identifies a taxpayer, person or company, and has 13 or 12. A person has both and the first 10 positions of each are similar but not the same rule.
Does a valid RFC mean the taxpayer is registered?
No. The check character proves the number is well formed. To know whether an RFC is registered and active, use the SAT consultation.
Can I use a RFC number generated here in a real system?
No. A number such as SMQ 711125 TX4 has a correct format and check, but nobody was issued it, and it may coincide with a real holder by chance. Use it in test environments, demos and automated tests that never leave your control.