Skip to content

CNPJ Generator

Generate valid Brazilian CNPJs for testing, including the new 2026 alphanumeric format.

Options

Between 1 and 100 per batch. Every number is unique.

Format

Type

The classic 14 digit CNPJ, still valid for every existing company.

Branch

Positions 9 to 12 are the branch number (ordem). 0001 is the headquarters, the most common case in tests.

Generated CNPJs

Your CNPJs will appear here.

For software testing only. These numbers are random and only mathematically valid: they pass the check digit test, are not registered companies, and one may happen to match a real CNPJ. Never use them to issue invoices, sign contracts or identify a business.

Frequently asked questions

How are the CNPJ check digits calculated?

Take the first 12 characters and multiply them by the weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 (the sequence 2 to 9 repeating from right to left). Add the products and divide by 11: a remainder of 0 or 1 gives 0, otherwise the digit is 11 minus the remainder. For the second digit, include the first check digit and use the weights 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2. For 11.222.333/0001 this gives 8 and 1.

What is the alphanumeric CNPJ?

Because numeric CNPJs are running out, the Receita Federal (Instrução Normativa RFB nº 2.229/2024) issues new CNPJs from July 2026 with letters A to Z allowed in the first 12 positions. The length stays 14 and the last two characters remain numeric check digits. Existing numeric CNPJs do not change.

How are check digits computed for an alphanumeric CNPJ?

With the same weights and mod 11 rule. The only change is the value of each character: its ASCII code minus 48. Digits keep their value (0 to 9) and letters go from A = 17 to Z = 42. For 12.ABC.345/01DE the result is 35, the example the Receita Federal publishes.

What do I need to change in my system for the new CNPJ?

Store the CNPJ as text, not as a number; accept letters in masks and input fields; uppercase before validating; and update the check digit routine to use ASCII minus 48. Generate a batch of alphanumeric CNPJs here and run them through your forms and APIs to find what breaks.

Is it legal to use a CNPJ generator?

Yes, for testing software. The numbers are random and only mathematically valid, they are not registered companies, and one may coincide with a real CNPJ. Using a CNPJ to issue invoices, sign contracts or pass as a business you are not can be a crime, such as falsidade ideológica under article 299 of the Brazilian Penal Code.