Generated numbers are only mathematically valid and are meant for testing and development. They do not belong to real companies and must not be used for fraud.
Generate CNPJ
Validate CNPJ
How the CNPJ works
The CNPJ (Cadastro Nacional da Pessoa Jurídica) has 14 characters: 8 for the company root, 4 for the establishment order (0001 for headquarters) and 2 check digits calculated with modulo 11. From July 2026 the Brazilian Federal Revenue starts issuing alphanumeric CNPJs, where the root and the order may contain the letters A to Z; the calculation uses each character's ASCII value minus 48 and the check digits stay numeric. The generator and the validator accept both formats.
Everything runs in your browser: no generated or typed number is sent or stored.
How to generate and validate a CNPJ
-
1
Choose the options
Set the quantity (1 to 50), the establishment type (headquarters 0001 or branch) and whether to include punctuation. Tick "Alphanumeric CNPJ" to generate numbers in the new format with letters.
-
2
Generate and copy
Click "Generate CNPJ" and copy each number, or the whole list with "Copy all".
-
3
Validate any CNPJ
Type the CNPJ in the validation section. The mask is applied automatically and the result tells you whether the check digits are correct, for both numeric and alphanumeric CNPJ.
Structure of the CNPJ
The Brazilian CNPJ has 14 positions: 8 for the root (identifies the company), 4 for the establishment order (0001 is headquarters, the others are branches) and 2 check digits. The first check digit applies the weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 to the first 12 positions; the second applies 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 to the first 13. The digit is 0 when the remainder of the division by 11 is less than 2; otherwise it is 11 minus the remainder.
Alphanumeric CNPJ
From July 2026 the Brazilian Federal Revenue starts issuing alphanumeric CNPJs, because the traditional numbering is running out. The first 12 positions (root and order) may contain digits and the letters A to Z; the two check digits remain numeric. The calculation is the same as for the numeric CNPJ, using each character's ASCII code minus 48 as its value: digits 0 to 9 are worth 0 to 9, A is worth 17, B is worth 18 and so on. Existing numeric CNPJs do not change.
Systems, databases and forms must accept letters in this field. This generator helps you test that change.
When to use a generated CNPJ
Generated numbers pass the mathematical validation but do not belong to real companies. Use them for software testing, demo data and development environments, never for fraud.
CNPJ generator: frequently asked questions
Does the generated CNPJ belong to a real company?
No. The numbers are random and only respect the check digit calculation. By coincidence they may exist in the Federal Revenue database, so do not use them for real registrations.
What is the alphanumeric CNPJ?
It is the new CNPJ format, issued from July 2026, in which the root and the order may contain the letters A to Z. The two check digits remain numeric.
How do I validate a CNPJ?
Type the number in the validator: it checks the format, rejects repeated sequences and recalculates the two check digits with modulo 11.
What is the difference between headquarters and branch?
The four digits after the slash are the establishment order. 0001 identifies the headquarters; branches use 0002, 0003 and so on.
Are the generated numbers stored?
No. Everything happens in your browser and nothing is sent to or stored on a server.