Brazil CNPJ validator (mod-11)
The CNPJ (Cadastro Nacional da Pessoa Jurídica) is Brazil’s company taxpayer number: 12 base digits followed by 2 mod-11 check digits. This validator recomputes both check digits, rejects reserved all-identical sequences, and shows the formatted number — useful for form validation and data cleaning.
How it works
The tool strips punctuation and confirms 14 digits. It computes the first check digit from a weighted sum of the 12 base digits (weights 5,4,3,2,9,8,7,6,5,4,3,2), and the second from the 12 base digits plus the first check digit (weights 6,5,4,3,2,9,8,7,6,5,4,3,2). For each:
remainder = sum mod 11; digit = remainder < 2 ? 0 : 11 − remainder
If both computed digits match the printed ones — and the number is not 14 identical digits — the CNPJ is valid.
Example
For 11.222.333/0001-81:
- Base =
112223330001 - First check digit computes to 8
- Second check digit computes to 1
- Both match → Valid CNPJ
| Input | Result |
|---|---|
11.222.333/0001-81 | Valid |
11.222.333/0001-80 | Invalid (check digits do not match) |
11111111111111 | Invalid (all identical) |
Everything runs in your browser, with nothing uploaded.