Skip to content

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

Loading calculator...
📚

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 homoclave, which keep two people with the same name and birthdate from getting the same code
  • 1 check digit, calculated from all the characters before it

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 homoclave
  • 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:

  1. Look up each character's value in a 39-symbol table: the digits 0-9 keep their own value, the letters run A=10 through Z=36 (skipping N+1 for the special symbol "&", which is 24), a blank space is 37, and "Ñ" is 38.
  2. 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.
  3. Multiply each character's value by a weight that counts down from 13 for the first character to 2 for the last.
  4. Add up all 12 products to get a sum.
  5. Divide the sum by 11 and keep the remainder.
  6. 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, homoclave A1). No padding is needed, since it is already 12 characters.

PositionCharacterValueWeightProduct
1G1613208
2O2512300
3M2211242
4E1410140
599981
60080
70070
866636
91155
1055420
11A10330
121122

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, homoclave 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

  1. Choose a type: Individual (Persona Física) or Company (Persona Moral).
  2. Enter how many codes to create, from 1 to 100.
  3. Select "Generate RFCs."
  4. Read the results table, which lists each code, its type, and whether it passes validation.
  5. Select "Copy to Clipboard" to copy the whole list.

Why the codes sometimes start with XAXX or XAX

If the randomly chosen letters happen to spell a word the SAT bans from RFCs (mostly vulgar words), the generator swaps them for a fixed placeholder: XAXX for individuals or XAX for companies. In the real Mexican tax system, XAXX010101000 and similar generic codes are also used for foreign taxpayers or simplified tax cases, so these patterns show up in genuine RFCs too, for a different reason.

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.

References

  1. Servicio de Administración Tributaria (SAT), "Obtén tu RFC con CURP"
  2. Código Fiscal de la Federación, Artículo 27, Obligaciones del Registro Federal de Contribuyentes