Mexican RFC Generator for Testing | Free Online Tool
Generate valid Mexican RFC codes for software testing. Create up to 100 RFCs for individuals or companies with proper SAT format and verification digits.
Mexican RFC Generator for Testing
Generate RFC Codes
Enter a number between 1 and 100
Documentation
What is a Mexican RFC generator for testing?
A Mexican RFC generator for testing creates fake but correctly formatted RFC codes. RFC stands for Registro Federal de Contribuyentes, the tax ID that Mexico's tax authority (SAT) issues to people and companies. This tool builds random codes that follow the official structure and pass the same checksum check as a real RFC, so developers can use them as sample data without touching anyone's real tax information.
What is a Mexican RFC?
An RFC is a short code used to identify a taxpayer in Mexico. It works like a Social Security Number in the United States or a National Insurance Number in the United Kingdom. Mexico requires an RFC for filing taxes, issuing invoices, opening certain bank accounts, and running payroll. Every person and every registered company has one.
RFC format for individuals
An individual's RFC (persona física) has 13 characters, built from four parts:
- 4 letters, in the real-world version drawn from the person's name: the first letter of the paternal surname, the first vowel inside the paternal surname, the first letter of the maternal surname, and the first letter of the given name
- 6 digits for the date of birth, in YYMMDD order (year, month, day)
- 2 characters called the homonymy key, which keep two people with the same name and birth date from getting the same code
- 1 check digit, calculated from all the characters before it
The last three characters together are usually called the homoclave.
This generator does not collect a real name or birth date. It has no name field. Instead it produces a random four-letter block that follows the same letter pattern (consonant, vowel, then two more letters) and a random date, so the output looks and behaves like a genuine RFC without being tied to a real person.
RFC format for companies
A company's RFC (persona moral) has 12 characters:
- 3 letters taken from the company name in a real RFC; this generator picks them at random
- 6 digits for the date the company was formed, in YYMMDD order
- 2 characters for the homonymy key
- 1 check digit
The generator draws both individual and company dates from the same range: any day between January 1, 1930, and today. There is no separate, narrower range for companies; both types can produce a date anywhere in that span.
How the check digit is calculated
The check digit is a single character added at the end of an RFC so a computer can catch typos. It comes from this formula:
- Look up each character's value in this 39-symbol table:
0123456789ABCDEFGHIJKLMN&OPQRSTUVWXYZ Ñ. A character's value is its position in that string, counting from 0. So the digits 0–9 keep their own value, A is 10 up to N at 23, "&" is 24, O is 25 up to Z at 36, a blank space is 37, and "Ñ" is 38. - If the code is shorter than 12 characters (this happens for companies, which have only 11 characters before the check digit), add a leading blank space so it fills out to 12 characters.
- Multiply each character's value by a weight that counts down from 13 for the first character to 2 for the last.
- Add up all 12 products to get a sum.
- Divide the sum by 11 and keep the remainder.
- Subtract that remainder from 11, then take the result modulo 11 again. If the answer is 10, the check digit is the letter "A"; otherwise it is written as a single digit, 0 through 9.
Worked example: individual RFC
Take the 12-character block GOME900615A1 (name letters GOME, birth date June 15, 1990, homonymy key A1). No padding is needed, since it is already 12 characters.
| Position | Character | Value | Weight | Product |
|---|---|---|---|---|
| 1 | G | 16 | 13 | 208 |
| 2 | O | 25 | 12 | 300 |
| 3 | M | 22 | 11 | 242 |
| 4 | E | 14 | 10 | 140 |
| 5 | 9 | 9 | 9 | 81 |
| 6 | 0 | 0 | 8 | 0 |
| 7 | 0 | 0 | 7 | 0 |
| 8 | 6 | 6 | 6 | 36 |
| 9 | 1 | 1 | 5 | 5 |
| 10 | 5 | 5 | 4 | 20 |
| 11 | A | 10 | 3 | 30 |
| 12 | 1 | 1 | 2 | 2 |
The products add up to 1,064. Dividing by 11 leaves a remainder of 8. Subtracting from 11 gives 3, so the check digit is 3. The finished RFC is GOME900615A13.
Worked example: company RFC
Take the 11-character block ACM0103157B (company letters ACM, formation date March 15, 2001, homonymy key 7B). Because it is only 11 characters, a blank space (value 37) is added at the front to make 12. Running the same steps gives a sum of 1,047, a remainder of 2 when divided by 11, and a check digit of 9. The finished RFC is ACM0103157B9.
How to use the Mexican RFC generator
- Choose a type: Individual (Persona Física) or Company (Persona Moral).
- Enter how many codes to create, from 1 to 100.
- Select "Generate RFCs."
- Read the results table, which lists each code, its type, and whether it passes validation.
- Select "Copy to Clipboard" to copy the whole list.
Banned words in the letter block
The SAT keeps a list of words it will not allow in an RFC, mostly vulgar ones. If the letters drawn from a taxpayer's name spell one of them, the rule is to replace the last of those letters with an X. BUEY becomes BUEX, and the three-letter company block BUE becomes BUX. This generator applies the same rule to its random letters. For companies it goes one step further and also swaps the last letter when the three-letter block merely starts a banned word, since only three of the four letters are there to judge.
The generator does not fall back on XAXX or XAX. Those belong to XAXX010101000 and XEXX010101000, the generic codes the SAT reserves for unidentified national and foreign taxpayers, and reusing them would produce sample data that clashes with real reserved values.
What counts as a well-formed RFC
The tool checks each code it produces against the pattern the SAT publishes for the RFC:
1^[A-Z&Ñ]{3,4}[0-9]{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])[A-Z0-9]{2}[0-9A]$
2Read left to right, that means three or four name characters, which may include "Ñ" and "&"; two digits of year; a month from 01 to 12; a day from 01 to 31; two homonymy characters that can be any letter or digit; and a final check digit that can only be a digit or the letter "A". A code that fails any of these rules, or whose check digit does not match the sum described above, is marked "Invalid" in the results table.
Common uses for test RFCs
- Form and input validation: check that a signup or checkout form accepts correctly formatted RFCs and rejects bad ones.
- Database and load testing: fill a test database with realistic-looking values without using real taxpayer data.
- API testing: feed sample RFCs into an endpoint that checks or stores tax IDs.
- Training and teaching materials: show what an RFC looks like without exposing anyone's real information.
Data privacy notes
Every RFC this tool produces is random. None of them is tied to a real person or business, and none should be used on a tax return, invoice, or any official form. Treat them strictly as sample data for software development and testing.
Frequently asked questions
What is a Mexican RFC used for? It identifies a taxpayer in Mexico. People and businesses need one to file taxes, issue invoices, and complete most official financial transactions.
Are the generated RFCs valid for official use? No. They are correctly formatted and pass the checksum check, but they are randomly generated and not registered with the SAT. They must never be used for real tax filings or legal documents.
How long is a Mexican RFC? An individual's RFC has 13 characters. A company's RFC has 12 characters.
How is the check digit calculated? Each character gets a numeric value from a fixed table, that value is multiplied by a position weight from 13 down to 2, the products are summed, and the check digit comes from 11 minus the remainder of that sum divided by 11 (using the letter "A" in place of 10).
Why do some RFCs use dates that seem impossibly old or new? Both individual and company codes in this tool draw a date from the same span, January 1, 1930, to today. That range is wide enough to cover almost any real birth date or incorporation date, but it is not narrowed for companies.
Can I choose the name or date used in a generated RFC? No. This tool generates every character at random, including the letters and the date. To test a specific value, filter the generated list for a matching pattern or adjust the underlying code.
Can an RFC contain "Ñ" or "&"?
Yes. The SAT character table gives "&" the value 24 and "Ñ" the value 38, and the official pattern allows both in the name block. A company called "García & Asociados" can hold an RFC beginning GA&. This generator draws only from A-Z, so its own codes never use those two characters, but its validator accepts them.
References
- Servicio de Administración Tributaria (SAT), "Obtén tu RFC con CURP"
- SAT, "Guía del validador de RFC" — the character table, the 13..2 weights and the mod-11 check digit
- Código Fiscal de la Federación, Artículo 27, Obligaciones del Registro Federal de Contribuyentes