Skip to main content
TrackJud TrackJud

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.

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