Gerador CPF e CNPJ
Gere e valide números de CPF e CNPJ com pontuação opcional e seleção de estados da Receita Federal para testes de software e desenvolvimento de sistemas.
Sobre Gerador e Validador de CPF e CNPJ (com Pontuação e Estados)
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.
Guia prático de utilização passo a passo
- Select your document type: CPF (11 digits for individuals) or CNPJ (14 digits for corporate entities).
- Choose your formatting preference: Com Pontuação (standard punctuation) or Apenas Números (unformatted digits).
- If generating CPF numbers, pick a specific Brazilian State / Fiscal Region (for example, SP for São Paulo or RJ/ES for Rio de Janeiro).
- Set the desired batch quantity from 1 up to 50 documents.
- Click the Gerar Documentos button to compute valid numbers with verified checksum digits.
- Click the Copy icon beside any individual number or use Copy All to grab the batch for testing.
- Switch to the Validador tab to paste any existing document number and inspect its validity and regional origin.
Especificações de engenharia e detalhes de execução
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.
Privacidade de dados e isolamento em memória
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 comuns em produção
- 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 e limites operacionais
- 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.
Perguntas Frequentes
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.