How to validate a Mexican RFC
How the check digit works
An RFC has 13 characters (individual) or 12 (company): letters, a YYMMDD date, a 2-character homoclave and a check digit. The API checks format and date, and computes the check digit:
- Take the first 11 or 12 characters; for companies, left-pad with one space to reach 12.
- Map each character with the SAT table: 0–9 → 0–9, A–N → 10–23, & → 24, O–Z → 25–36, space → 37, Ñ → 38.
- Multiply by weights
13, 12, …, 2and add up. r = 11 − (sum mod 11): ifr = 11the digit is 0, ifr = 10it isA, otherwiser.
The generic RFCs XAXX010101000 and XEXX010101000 are accepted.
Validate with the API
Direct use is free: 50 requests per IP per day, no signup. Endpoints: POST /validate, POST /batch, GET /generate/{doc_type} (for testing only: synthetic data, not real identities).
curl
curl -X POST "https://validalatam.ia-latam.app/validate" -H "Content-Type: application/json" \
-d '{"type":"MX_RFC","value":"UKUS790523S70"}'
# synthetic test data only / solo para pruebas
curl "https://validalatam.ia-latam.app/generate/MX_RFC"Python
import requests
BASE = "https://validalatam.ia-latam.app"
r = requests.post(f"{BASE}/validate", json={"type": "MX_RFC", "value": "UKUS790523S70"})
print(r.json()["valid"], r.json()["formatted"])
Real API response (synthetic value from /generate)
UKUS790523S70 (MX_RFC):
{"valid":true,"type":"MX_RFC","country":"MX","input":"UKUS790523S70","normalized":"UKUS790523S70","formatted":"UKUS790523S70","error":null,"details":{"entity":"person"}}
Plans
For production: Basic free (500 req), Pro US$9, Ultra US$29 and Mega US$99 per month on RapidAPI.
For AI assistants (MCP)
pip install validalatam-mcpgithub.com/elmatis172/validalatam-mcp
← All guides · Contact: faucolabs@gmail.com