CNPJ Generator

Try our CNPJ generator! You can create various valid numbers and customize your experience using the automatic rotation to generate new CNPJs based on the selected time. Additionally, you can choose whether or not to include the mask between the digits.

Also, be sure to check out our CNPJ validator which ensures the authenticity of the generated numbers. It’s quick and easy!

This tool generates fictitious data intended exclusively for software testing and development purposes. The data does not correspond to real people or entities and must not be used for illegal, fraudulent purposes, or in ways that violate the privacy of others. Compliant with LGPD (Brazilian Data Protection Law).

Understanding CNPJ and the Generator Algorithm

What is CNPJ?

The Cadastro Nacional da Pessoa Jurídica (CNPJ) is the company registration number in Brazil, issued by the Receita Federal. It has 14 digits in the format XX.XXX.XXX/XXXX-DD: the first 8 identify the company, the next 4 identify the branch (0001 for the headquarters), and the last 2 are check digits. Every company with legal operations in Brazil needs a CNPJ to issue invoices, hire employees, and open business accounts.

How does the generation algorithm work?

CNPJ uses the same modulus 11 principle as CPF, but with different weights. The first 12 digits are the base. For the first check digit, weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, and 2 are applied left to right, and the remainder of division by 11 defines the verifier (remainder less than 2 results in 0). The second verifier uses weights 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, and 2, including the first verifier already calculated.

Why use fictional CNPJs in development?

Invoice issuing systems, ERPs, B2B e-commerce platforms, and supplier registrations require a valid CNPJ. When developing or testing these applications, using real company CNPJs exposes corporate data and can cause conflicts in staging databases. CNPJs generated by Help4Dev are mathematically valid, pass format checks, and allow comprehensive testing without any legal or privacy risk.

Frequently Asked Questions about CNPJ

What is the difference between a headquarters and branch CNPJ?

A headquarters CNPJ ends with the suffix /0001 before the check digits, indicating it is the main establishment. Branches receive sequential suffixes like /0002, /0003, etc. Help4Dev's generator creates headquarters CNPJs by default.

Can the generated CNPJ be looked up at the Federal Revenue Service?

No. Since the CNPJ is fictitious and randomly generated, it does not exist in the Federal Revenue database. A lookup will return 'CNPJ not found'. This is expected and confirms the number is safe for testing.

Can I generate CNPJs in batch for test automation?

Yes. You can use Help4Dev's auto-rotation feature to quickly generate multiple CNPJs. For more complex automation, the modulo 11 algorithm is public and can be implemented directly in your test framework code.