How to use the CNPJ generator tool
- Pick Validate checksum under Operation to test an existing number, or Generate test numbers to create new ones.
- For validation, enter the number in Brazilian numeric CNPJ. Punctuation as in 04.252.011/0001-10 is fine.
- For generation, type how many you need, from 1 to 50, in Test numbers to generate.
- Select Process number and read the output in the Result box.
- Use Copy to take the result with you, or Example to run the sample CNPJ.
Structure of a 14-digit CNPJ
CNPJ stands for Cadastro Nacional da Pessoa Jurídica, the registry of legal entities kept by Brazil's Receita Federal. A numeric CNPJ has three parts: eight digits for the company root, four digits for the establishment and two check digits. It is normally printed as 00.000.000/0000-00.
The establishment block separates the head office from branches. 0001 is the head office, and branches count up from 0002. Every number this generator produces uses 0001, so the results look like head office registrations.
How the CNPJ generator calculates check digits
The first check digit is a weighted sum of the twelve leading digits with the weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2. Divide the sum by 11. A remainder of 0 or 1 gives the digit 0, and any other remainder is subtracted from 11. The second digit covers thirteen digits, the twelve plus the first check digit, with the weights 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2.
For the sample 04.252.011/0001-10 the first sum is 65, which leaves 10, so the digit is 1. The second sum is 67, which leaves 1, so the small-remainder rule applies and the digit is 0.
Root 04252011, establishment 0001
0*5 + 4*4 + 2*3 + 5*2 + 2*9 + 0*8 + 1*7 + 1*6 + 0*5 + 0*4 + 0*3 + 1*2 = 65
65 mod 11 = 10 -> 11 - 10 = 1
Second sum over 0425201100011 = 67
67 mod 11 = 1 -> 0
Input: 04.252.011/0001-10
Result: Checksum valid. Assignment status is unknown.Validation rules and messages
Before checking, the validator strips spaces, dots, slashes and hyphens. What remains must be exactly 14 digits.
- Correct check digits: Checksum valid. Assignment status is unknown.
- Wrong check digits, or fourteen identical digits such as 00.000.000/0000-00: Invalid Brazilian numeric CNPJ number.
- Wrong length or any letter: Enter 14 digits.
- Branch numbers pass. The validator does not require 0001, it is only the generator that always writes it.
Numeric only: no alphanumeric CNPJ support
Receita Federal has defined an alphanumeric CNPJ in which the first twelve positions may hold letters as well as digits, with new registrations scheduled to use it from July 2026. This tool does not implement that variant. A value containing letters fails with Enter 14 digits, and the generator outputs digits only. Numeric CNPJs issued earlier keep their numbers.
How test numbers are generated
Generation draws twelve random digits from the browser's cryptographic random source, rejects a draw of twelve equal digits, overwrites positions nine to twelve with 0001 and appends the check digits. Each output line is one unformatted 14-digit number.
Because the root is random, a generated number may equal the CNPJ of an existing company. Keep the output inside test suites and demo environments.
Frequently asked questions
Do generated CNPJ numbers belong to real companies?
Not by design. The eight root digits are random and only the check digits are computed. A random root can still collide with a registered company, and the tool has no way to know, so treat every generated CNPJ as test data.
Why do all generated CNPJs contain 0001?
The code replaces the establishment block with 0001, the value used for a company's head office. Other establishment numbers cannot be generated. You can still validate a branch CNPJ that you already have.
Can this tool validate the new alphanumeric CNPJ?
No. It accepts digits only. A CNPJ with letters is rejected with the message Enter 14 digits before any checksum is calculated, so those numbers need a validator that implements the alphanumeric rules.
Does the validator check whether the company is active?
No. It verifies the length and the two check digits, and rejects fourteen repeated digits. Registration status, company name and address come from Receita Federal records, which this page never queries.
Do I have to type the dots, slash and hyphen?
No. You can paste 04.252.011/0001-10 or 04252011000110, because separators are removed before validation. Generated numbers are printed without them.