CNPJ Generator
This tool generates FICTITIOUS CNPJs for testing purposes only. Never use these numbers for real registrations or official purposes!
Free online tool to generate valid CNPJ numbers for developers, software testers (QA), and programming students. Generate fictitious Brazilian company registration numbers with mathematically correct check digits, in formatted or numbers-only format. Ideal for system testing, form validation, and staging environments.
What is CNPJ and How Does the Algorithm Work?
The CNPJ (Cadastro Nacional da Pessoa Jurídica) is Brazil's national company registration number, issued by the Federal Revenue Service (Receita Federal). This unique 14-digit number is mandatory for any legal entity in Brazil — required to issue invoices, open business bank accounts, and conduct official commercial activities. The CNPJ structure consists of 12 base digits followed by 2 check digits calculated through a weighted modulo-11 algorithm applied twice.
Common Applications for CNPJ Testing
Our CNPJ generator is the ideal solution for various everyday situations for developers and technology professionals:
- ✓Validate CNPJ input fields, masks, and frontend validation logic in registration forms
- ✓Test invoice systems and nota fiscal (NF-e) workflows that require a valid CNPJ
- ✓Populate staging and homologation databases with realistic company registration data
- ✓Integration testing with APIs and external services that validate CNPJ format
- ✓Create realistic company personas for UX demos and client presentations without real data
Technical Details and Standards
The CNPJ has specific technical characteristics that are important for developers:
- •Check Digit Algorithm: weighted modulo-11 applied twice on the first 12 digits, with weights cycling from 2 to 9
- •Format: 14 digits structured as XX.XXX.XXX/XXXX-DD — the 4-digit block identifies the branch (0001 = headquarters)
- •Branch suffix: this generator always produces headquarters CNPJs (branch 0001), the most common pattern in real systems
- •Unique generation: up to 100 non-repeating CNPJs per session, with uniqueness control via Set
Frequently Asked Questions
Are generated CNPJs real?
No. Generated CNPJs are fictitious numbers that only pass mathematical validation. They are not registered with Brazil's Federal Revenue and should only be used for testing purposes.
Can I use generated CNPJs to register a business?
No. Using fake CNPJs for official registrations is considered fraud in Brazil and may result in legal consequences. Use only for software testing in development environments.
How does CNPJ validation work?
CNPJ has 2 check digits calculated from the first 12 digits using a weighted modulo-11 algorithm applied twice. Our generator creates numbers that pass this mathematical validation, making them suitable for system testing.
Can I generate multiple CNPJs at once?
Yes! Generate up to 100 unique CNPJs at once. Perfect for batch testing, QA automation, and populating test databases.
Is this generator free?
Yes, completely free with no limits. Generate as many CNPJs as needed for your tests without registration or payment.
[ Wikipedia: CNPJ (Cadastro Nacional da Pessoa Jurídica), CNPJ (National Registry of Legal Entities) ]