Skip to content

CNPJ Generator

Generate valid CNPJ numbers for testing and development. Bulk generation, formatted or digits-only output. Built for developers and QA engineers.

No sign-up 100% free Private
Options
The result will appear here

Was this tool helpful?

CNPJ Generator for Testing

Our CNPJ generator creates mathematically valid CNPJ numbers (Cadastro Nacional da Pessoa Jurídica) for use in software testing and development environments. Each generated 14-digit number follows the official Module 11 algorithm from Brazil's Receita Federal, with correctly calculated check digits that pass any standard validation routine. Brazil has over 58 million registered CNPJs, with approximately 22 million currently active — our generator produces numbers structurally identical to those issued by the government.

The generation process is fully random and client-side: the tool produces a random 8-digit root using the browser's crypto.getRandomValues() for true cryptographic randomness, appends a branch number (0001 for headquarters), computes the two verification digits via weighted sums and modulo 11, and formats the result as XX.XXX.XXX/XXXX-XX. Everything runs in your browser — no data is sent to any server, ensuring complete privacy and LGPD compliance.

You can generate CNPJs individually or in batches of up to 50, with or without formatting. Each generated CNPJ is guaranteed unique within the same batch — duplicates are automatically discarded and replaced. This is perfect for populating test databases, validating business registration forms, running integration tests against payment APIs, testing ERP systems, simulating company registrations in staging environments, or verifying that your invoice generation system correctly handles CNPJ formatting.

Understanding CNPJ structure: A CNPJ consists of a root (8 digits identifying the company), a branch number (4 digits — 0001 for headquarters, 0002+ for branches), and two check digits. The generator uses branch 0001 by default since most testing scenarios involve headquarters. The first check digit is calculated using Module 11 with multipliers (5,4,3,2,9,8,7,6,5,4,3,2) applied to the first 12 digits — the sum of products is divided by 11, and if the remainder is less than 2 the digit is 0, otherwise 11 minus the remainder. The second check digit follows the same logic with multipliers (6,5,4,3,2,9,8,7,6,5,4,3,2) applied to the first 13 digits, ensuring mathematical validity identical to real CNPJs issued by the Receita Federal.

Legal notice: All generated CNPJs are fictitious and do not correspond to any real company registered with the Receita Federal. Using fabricated CNPJs for fraud or any illegal purpose is a crime under Article 304 of the Brazilian Penal Code. This tool is intended exclusively for development and testing.

Need to verify an existing CNPJ? Use our CNPJ Validator. For the new alphanumeric format (effective July 2026 per IN RFB 2.119/2022), try the Alphanumeric CNPJ Generator. For individual taxpayer numbers, see our CPF Generator. To look up actual company data, visit our CNPJ Lookup. You can also format existing numbers with our CNPJ Formatter tool.

Frequently Asked Questions

Are the generated CNPJs real?
No. They are randomly generated and not linked to any real company. To check an existing CNPJ, use our CNPJ Validator.
Can I use generated CNPJs in production systems?
No. These CNPJs are for development and testing only. Using fictitious CNPJs for fraud is a crime under Brazilian law (Art. 304 of the Penal Code). For the new alphanumeric format, see our Alphanumeric CNPJ Generator.
How many CNPJs can I generate at once?
Up to 50 CNPJs per batch, with or without formatting (XX.XXX.XXX/XXXX-XX). All generated locally in your browser. To validate an existing number, use our CNPJ Validator.
Do generated CNPJs pass validators?
Yes. Every generated CNPJ uses the official Module 11 algorithm from Receita Federal with correct check digits. It will pass any CNPJ validator, including our CNPJ Validator. However, it won't be registered with the Receita Federal.
Are generated CNPJs always headquarters (0001)?
Yes. By default, the order number is 0001, representing the headquarters of the fictitious company. This covers most test scenarios. If you need branch numbers, manually change digits 9-12 and recalculate the check digits.
Is my data collected when generating CNPJs?
No. Generation happens 100% in your browser using JavaScript. No information is sent to our servers. You can even disconnect from the internet and continue using the tool.
What's the difference between numeric and alphanumeric CNPJ?
The numeric CNPJ (current) uses only digits 0-9 and the Module 11 algorithm. The new alphanumeric CNPJ (effective July 2026, IN RFB 2.119/2022) includes letters A-Z and uses Modulo 97. To generate the new format, use our Alphanumeric CNPJ Generator.
How do I copy the generated CNPJs?
Each generated CNPJ has a copy button next to it. For batches, there's an option to copy all at once, separated by line breaks. Works on both mobile and desktop.