Free tool
CNPJ validator
Check whether a Brazilian CNPJ is valid in one click. The computation runs entirely in your browser — nothing is sent to any server.
How the algorithm works
A CNPJ has 14 digits formatted as NN.NNN.NNN/NNNN-NN, the last two being check digits computed from the first 12 via the mod-11 algorithm.
The first 8 digits identify the company root (the CNPJ of the headquarters). The next 4 digits identify the branch — `0001` is the HQ, `0002` onwards are subsidiaries. The last 2 are the check digits.
For the first check digit: - Each of the first 12 digits is multiplied by the weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 - The products are summed and the remainder of a division by 11 is computed - If the remainder is less than 2, DV is 0; otherwise DV = 11 − remainder
For the second check digit, the same process runs including the first DV, with weights 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2.
This validator implements exactly this algorithm. If you want to go further and check whether a company has open lawsuits or labor liability, use Vigilant — same CNPJ, but then you're talking about court data, not just mathematical validation.
Frequently asked questions
How do I validate a CNPJ with the mod-11 algorithm?
A CNPJ has 14 digits — 12 identify the company + 2 check digits. The 1st CD is computed by multiplying the first 12 digits by weights 5,4,3,2,9,8,7,6,5,4,3,2, summing, taking mod 11 and subtracting from 11 (if 10 or 11, becomes 0). The 2nd CD repeats the process including the 1st CD, with weights 6,5,4,3,2,9,8,7,6,5,4,3,2. If both match, the CNPJ is mathematically valid.
Does a mathematically valid CNPJ mean a real registered company?
No. Passing mod-11 only guarantees check digit consistency — the CNPJ may never have been issued. To check if the company exists, use the CNPJ lookup tool (via BrasilAPI/Receita Federal). To check if the company has lawsuits, labor liabilities or fiscal enforcement, use Vigilant.
What do the 4 digits before the "/" in a CNPJ mean?
The first 8 digits identify the parent company (root). The following 4 digits (before the dash) indicate the branch: "0001" is always headquarters, "0002" onwards are branches. Example: 12.345.678/0001-00 is HQ; 12.345.678/0002-XX is the first branch. Each branch has its own CNPJ but shares the root.
Do CNPJs with repeated digits (00.000.000/0000-00) pass mod-11?
Mathematically yes — sequences like 00.000.000/0000-00 and 11.111.111/1111-11 pass. But Receita Federal never issued those. This validator automatically detects and rejects all 10 repeated sequences to avoid false positives in tests and forms.
What is the difference between validating a CNPJ and looking up a CNPJ?
Validation = check if the check digits are correct (this tool, 100% local). Lookup = fetch company data (legal name, status, address, partners) from Receita Federal. For lookup, use our [CNPJ lookup tool](/en/tools/cnpj-lookup) — free and returns public data in seconds.
Related tools
Need more than validation?
Vigilant searches lawsuits linked to Brazilian CPFs and CNPJs across 12 court sources. Via API or dashboard.
Search lawsuits with Vigilant