Skip to main content
Skip to main content

CNPJ Generator

Generate valid CNPJ numbers and development. Excellent for your tests.

Waiting for generation...

About the CNPJ Generator

The Box4Dev CNPJ Generator is an online tool developed to create National Registry of Legal Entities numbers that are mathematically valid. Each generated CNPJ follows the standard Federal Revenue algorithm for calculating verification digits, ensuring its structural validity.

This resource is indispensable for developers, software testers, and systems analysts who need fictitious data to validate forms, test company registration logic, and ensure data integrity in development environments without using real company information.

Anatomy & Structure of Brazilian CNPJ

The National Registry of Legal Entities (CNPJ) comprises 14 decimal digits in 3 segments:

PositionFieldLengthMeaning & RuleExample
1 to 8Company Base Root8 digitsUnique nationwide legal entity registration root12345678
9 to 12Establishment Order4 digitsIdentifies headquarters (0001) or branch establishment (0002 to 9999)0001
13 & 14Check Digits2 digitsDual Modulo 11 check digits calculated with RFB cyclic weights95

Official CNPJ Checksum Algorithm (Brazilian Federal Revenue Modulo 11)

CNPJ integrity is verified with cyclic weights 2 to 9 across two Modulo 11 operations:

CD1 = (Sum1 % 11 < 2 ? 0 : 11 - Rem1); CD2 = (Sum2 % 11 < 2 ? 0 : 11 - Rem2)
  1. 1. Multiply first 12 digits by weights [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2].
  2. 2. Sum all products and take remainder modulo 11.
  3. 3. If remainder < 2, CD1 is 0; otherwise CD1 = 11 - remainder.
  4. 4. For CD2, multiply first 12 digits by weights [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2] and CD1 by 2.
  5. 5. If remainder < 2, CD2 is 0; otherwise CD2 = 11 - remainder.
  6. 6. Sequences of 14 repeated digits are rejected.

Frequently Asked Questions (FAQ)

Is the CNPJ generated by this tool valid?
Yes, the CNPJ number is mathematically valid. It is generated following the official verification digit calculation algorithm (modulus 11), which ensures it is accepted in forms and systems that have this validation. However, it is a fictitious number and does not correspond to a real company registered with the Federal Revenue.
Can I use this CNPJ to open a company or issue invoices?
No. The purpose of the generator is strictly for software testing, studies, and filling out forms in development environments. The use of a fictitious CNPJ for commercial, tax, or fraudulent purposes is illegal.
How does the CNPJ Generator work?
The tool randomly creates the first twelve digits of the CNPJ and then applies the calculation algorithm to determine the last two digits, which are the verification digits. This process ensures that the final number is structurally correct and valid.
Is it safe to use this CNPJ generator?
Completely safe. The generation of the number occurs entirely in your browser (client-side), and no information is sent or stored on our servers. Your privacy and security are guaranteed.