Kastavo

Brazilian CNPJ Validator

Enter a CNPJ, formatted or not, and see whether its check digits are valid.

Accepts numeric and alphanumeric CNPJ (numbers and letters from A to Z).

This tool validates Brazilian documents only.

Not sure? Turn your internet off and try — it still works.

How it works

The CNPJ has 14 characters, written AA.AAA.AAA/AAAA-DD: 8 identify the company (the root), 4 identify the establishment (0001 is usually the headquarters, and 0002 onward the branches) and 2 are check digits. In a numeric CNPJ, all of them are numbers. Since 31 July 2026, the Receita Federal also issues the alphanumeric CNPJ: the first 12 characters can be numbers from 0 to 9 and capital letters from A to Z, and the 2 check digits are still numbers. The new format only applies to new registrations; the Receita said that new CNPJs may still come out with numbers only, and the CNPJs that already exist do not change. The calculation is the same in both formats. Each character becomes a value: its ASCII code minus 48, so 0 to 9 are worth 0 to 9, A is worth 17, B is worth 18, and so on up to Z, which is worth 42. The first check digit comes from the first 12 characters, multiplied by the weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2; the second, from the first 13, with weights 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2. In each case, add them up and divide by 11: if the remainder is 0 or 1, the digit is 0; otherwise it is 11 minus the remainder. Numeric example, with the test number 11.222.333/0001-81: the first sum is 102 (remainder 3, so the digit is 8) and the second is 120 (remainder 10, so the digit is 1). Alphanumeric example, the one published by the Receita Federal, 12.ABC.345/01DE: the values are 1, 2, 17, 18, 19, 3, 4, 5, 0, 1, 20 and 21; the first sum is 459 (remainder 8, so the digit is 3) and the second, with the 3 added at the end, is 424 (remainder 6, so the digit is 5). The full CNPJ is 12.ABC.345/01DE-35. Typical use: checking a supplier's or a customer's CNPJ before issuing an invoice or closing a registration. Validating the digits does not tell you whether the company exists or is active. This tool accepts both the numeric and the alphanumeric CNPJ; the field turns lowercase letters into capitals as you type, because the official format only uses capitals.

Frequently asked questions

Related tools

This website uses cookies

We use cookies to improve your experience and understand how the site is used. You can change this choice anytime in Cookie Preferences. See our Privacy Policy.