Saltar al contenido principal
Desarrollador Utilidad Activa 💻 Procesamiento Local en Navegador

Generador CPF y CNPJ

Genere y valide números de documentos brasileños CPF y CNPJ con puntuación opcional y filtro por estados para pruebas de software y desarrollo.

Gerador e Validador de CPF / CNPJ
Módulo 11 • Receita Federal Oficial
Herramienta gratuita porAllMyTools.tech
Referencia Técnica y Manual

Acerca de Generador y Validador de CPF y CNPJ (Brasil)

Developing and testing business software in Brazil requires validating two foundational taxpayer identification numbers: the CPF (Cadastro de Pessoas Físicas) for individuals and the CNPJ (Cadastro Nacional da Pessoa Jurídica) for commercial enterprises.

Database validations, e-commerce checkout funnels, and enterprise ERP systems enforce strict mathematical checksums on these numbers using the Modulo 11 check digit algorithm. Using arbitrary placeholder digits like 123456789 causes automated test suites to fail validation gates.

This Brazilian CPF and CNPJ Generator and Validator produces mathematically valid test numbers adhering to official Receita Federal formatting rules. It supports optional punctuation, fiscal region state selections, and immediate verification of external document numbers.

For generating accompanying Brazilian payment payloads, test the brazil pix generator. To generate realistic companion user data like full names and addresses, use the mock data generator.

Especificaciones de ingeniería y detalles de ejecución

CPF verification algorithm uses Modulo 11 with weights from 10 down to 2 for the first check digit, and weights from 11 down to 2 for the second check digit.

CNPJ verification algorithm uses Modulo 11 with cyclical weights [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2] for the first check digit, and [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2] for the second check digit.

Filters invalid repeated number patterns (such as 111.111.111-11 or 000.000.000-00) that pass naive modulo formulas but are rejected by Receita Federal systems.

Extracts the 9th digit of CPF numbers to determine the exact Brazilian Fiscal Region (Região Fiscal 1 through 0).

Standard corporate branch root 0001 is applied for main company headquarters, while custom branch indices test filial structures.

Privacidad de datos y aislamiento en memoria

All random document sequences and mathematical checksums compute locally in client JavaScript.

No generated or validated documents are logged, tracked, or transmitted over network connections.

Generates strictly fictional numbers intended exclusively for automated QA and software engineering environments.

Casos de uso comunes en producción

  • Software quality assurance engineers validating registration forms, checkout flows, and backend customer APIs.
  • Database architects generating synthetic mock customer datasets for load testing and staging migrations.
  • Compliance developers confirming that enterprise customer onboarding pipelines reject malformed tax numbers.

Casos extremos y límites operativos

  • Check digit calculation resulting in 10 or 11: Official Receita Federal rules specify that when the remainder calculation yields 10 or 11, the resulting check digit defaults to 0.
  • Unformatted input normalization: The validator automatically strips non-numeric characters, leading spaces, and punctuation symbols before applying Modulo 11 weights.

Preguntas Frecuentes

Are the generated CPF and CNPJ numbers real?

No. The generated numbers are mathematically valid according to the official Modulo 11 algorithm, but they are synthesized randomly for software testing and do not correspond to living citizens or actual registered companies.

How does the 9th digit of a CPF indicate the Brazilian state?

The 9th digit identifies the fiscal region: 1 is DF/GO/MT/MS/TO, 2 is AC/AP/AM/PA/RO/RR, 3 is CE/MA/PI, 4 is AL/PB/PE/RN, 5 is BA/SE, 6 is MG, 7 is ES/RJ, 8 is SP, 9 is PR/SC, and 0 is RS.

Can I validate a list of multiple CPF or CNPJ numbers at once?

Yes. The validator accepts bulk multi-line inputs, verifying each document line by line and reporting its validity status.