Skip to content
cnpj/ob
Free tool

Validate a CNPJ

Check whether a Brazilian CNPJ is valid by its check digits, including the alphanumeric format, and see the step-by-step calculation.

Validation runs in your browser. Need a CNPJ to test? Use the generator.

Valid does not mean active

Validation only checks the math: whether the last 2 digits match the first 12. A CNPJ can be valid and be closed, irregular or not exist at all. To see the registration status, partners and address, look up the CNPJ in the Receita Federal register.

How the check digit is calculated

  1. Take the first 12 characters and multiply each by the weights 5 4 3 2 9 8 7 6 5 4 3 2.
  2. Add the results and take the remainder of the division by 11.
  3. If the remainder is 0 or 1, the first digit is 0. Otherwise, it is 11 minus the remainder.
  4. Repeat with the 13 characters (including the digit you just calculated) and the weights 6 5 4 3 2 9 8 7 6 5 4 3 2 to find the second digit.

In the alphanumeric CNPJ (since July 2026), letters enter the calculation as their ASCII code minus 48: A is 17, B is 18, up to Z = 42. Digits keep their own value, so existing CNPJs give the same result as always. See the alphanumeric CNPJ guide (Portuguese), with validation code in JavaScript and Python.

Validate in your system

Use the same rule in your code or call the API, which validates without using quota:

curl https://api.cnpjob.com.br/cnpj/validate/33000167000101

With a free key, GET /cnpj/:cnpj returns the full company registration. Get a free key · Documentation

Frequently asked questions

Does a valid CNPJ mean the company exists?

No. Validation only checks the check digits. To know whether the company exists and is active, look up the CNPJ.

Why does 11.111.111/1111-11 show as invalid?

Sequences of the same repeated character would pass the math, but the Receita Federal does not issue them, so every serious validator rejects them.

Does the validator accept alphanumeric CNPJs?

Yes. Type it with or without punctuation, in upper or lower case.

Is the CNPJ I type sent to a server?

No. The calculation runs in your browser. Only if you click to look up the company data does the number go to the search.