The UpTools CNPJ generator creates valid CNPJ numbers, the registration numbers of Brazilian companies, for testing systems. Choose how many you want (from 1 to 20), pick the punctuated format (00.000.000/0001-00) or digits only, and copy them in one click. Every number has correct check digits and is generated in your browser.
These CNPJs are fictitious and meant only for testing and learning: they do not represent real companies and should not be used outside development environments.
What is a CNPJ?
The CNPJ (Cadastro Nacional da Pessoa Jurídica, or National Registry of Legal Entities) is the number Brazil’s Federal Revenue Service, the Receita Federal, uses to identify companies and other entities, such as associations and government bodies. It appears on invoices, contracts, payment slips and bank records, and it plays the same role for a company that the CPF, Brazil’s individual taxpayer number, plays for a person.
How the number is structured
A CNPJ has 14 digits, written in the format 00.000.000/0001-00:
- Root or base (8 digits): identifies the company and is the same for the head office and all its branches.
- Branch number (4 digits): identifies the establishment. Usually, 0001 is the head office, and branches get 0002, 0003 and so on. The generator always uses 0001.
- Check digits (2 digits): calculated from the previous 12 to catch typing errors.
How the check digits are calculated
- Multiply the first 12 digits by the weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3 and 2 and add up the results.
- Find the remainder of the sum divided by 11. If the remainder is 0 or 1, the first check digit is 0; otherwise, it is 11 minus the remainder.
- For the second digit, use the first 13 digits (now including the first check digit) and the weights 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3 and 2, applying the same rule.
Example with the base 45.723.174 and the branch number 0001: the first sum is 4×5 + 5×4 + 7×3 + 2×2 + 3×9 + 1×8 + 7×7 + 4×6 + 0×5 + 0×4 + 0×3 + 1×2 = 175. The remainder of 175 ÷ 11 is 10, so the first digit is 11 − 10 = 1. With that digit included, the second sum is 187, whose remainder when divided by 11 is 0, so the second digit is 0. The result is 45.723.174/0001-10.
How to use the CNPJ generator
- Enter the Quantity of CNPJs, from 1 to 20.
- Turn Format with punctuation on or off.
- Click Generate CNPJ.
- Copy a single number with the button next to it, or the whole list with Copy all.
What it is for
- Testing sign-up flows for business customers and suppliers;
- Checking input masks, validation rules and error messages in ERPs, invoicing systems and online stores;
- Populating staging databases without exposing data from real companies;
- Practicing how to implement the check-digit calculation in courses and training.
For individual sign-ups, use the CPF generator; for testing payments, use the credit card generator.
Responsible use
The generated CNPJs are fictitious, meant only for testing and educational purposes, and were not issued by the Receita Federal to any company. Using them to issue documents, open accounts, close deals or deceive people, companies or government agencies is illegal and may constitute crimes under Brazilian law, such as identity fraud and swindling.
Frequently asked questions
Does the generated CNPJ belong to a company?
It is created at random, without querying the Receita Federal database. Since millions of CNPJs are registered, a generated number may match that of a real company, so use it only for testing.
Why do all the numbers have 0001 before the check digits?
Because the generator creates head-office numbers, the most common case in sign-up forms. If you need to test branches, change the branch number (for example, to 0002) and recalculate both check digits.
Does the generator create alphanumeric CNPJs?
No. Since July 2026, the Receita Federal has also been issuing alphanumeric CNPJs, but the traditional numeric format remains valid, and that is the format this tool generates.
How can I tell whether a CNPJ really exists?
The check-digit calculation only confirms the structure of the number. To find out whether a CNPJ is active and who it belongs to, look up its registration certificate on the Receita Federal website.