CPF/CNPJ Generator & Validator
Generate and validate CPF and CNPJ, including the new alphanumeric format.Validate
CPF generator
CNPJ generator
How CPF and CNPJ validation works
CPF (11 digits) and CNPJ (14 positions) use modulo-11 check digits. This tool validates and generates both, including the alphanumeric CNPJ base (letters A–Z and digits) with numeric check digits, following Receita Federal’s ASCII−48 conversion rule (IN RFB nº 2.229/2024; new alphanumeric inscriptions from July 2026).
Does a valid number mean the document exists?
No. A pass here only means the check digits match the modulo-11 algorithm. It does not confirm registration with Receita Federal or any other authority.
What changed in alphanumeric CNPJ?
Per Receita Federal (gov.br CNPJ Alfanumérico / IN RFB 2.229/2024), new CNPJs keep 14 positions but the first 12 may include letters A–Z. Existing numeric CNPJs stay valid. Each character is converted with ASCII code minus 48 before the same weighted modulo-11 calculation; the two check digits remain digits 0–9.
What is the difference between CPF and CNPJ?
CPF identifies individuals (11 digits). CNPJ identifies companies and other legal entities (14 positions, now allowing letters in the base). Both use the same modulo-11 check-digit scheme.
When do alphanumeric CNPJs start?
Receita Federal’s published schedule targets July 2026 for new alphanumeric inscriptions only. Older numeric CNPJs are not rewritten. Always confirm against the official Receita Federal page for cutover windows.