Pular para o conteúdo
Tool

CNPJ Validator

Check online and for free whether a CNPJ number is mathematically valid or whether it was entered incorrectly.

What is the CNPJ Validator?

CNPJ Validator is a free tool that checks whether a National Legal Entity Registration (CNPJ) number is entered correctly. Every valid CNPJ follows a strict mathematical rule imposed by the Federal Revenue Service, known as the module 11 algorithm.

Our tool applies this rule immediately: when pasting a CNPJ, it recalculates the last two numbers (the check digits) and warns whether the CNPJ is structurally true or false.

Attention: This tool only validates the mathematical structure of the number (useful for discovering typos and basic false data). It does not consult the Federal Revenue database, therefore it does not inform whether the company is active, deregistered or ineligible.

Who is it useful for?

  • Developers and QA: To test registration routines, business rules in systems (ERP, e-commerce) and cleaning databases.
  • Accountants and Administrative: To quickly look at a registration or invoice and see if the CNPJ provided by the client was not entered incorrectly.
  • Retailers and Sellers: For quick checks on a purchase form.

How the calculation works (Module 11 Algorithm)

The CNPJ has 14 digits. The first 12 are the company root and branch order (usually 0001 or 0002). The last 2 are the check digits calculated from the first 12.

The rule works like this:

  1. Multiply each of the first 12 digits by a sequence of weights (5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2).
  2. Add all these results together and divide the sum by 11.
  3. The remainder of this division defines the first check digit. If the remainder is less than 2, the digit is 0; otherwise, it is 11 minus the remainder.
  4. The process repeats to discover the second digit, this time including the first check digit we just discovered and using a new table of weights (starting from 6).

If the numbers found in the account do not match the last two numbers entered, the CNPJ is invalid.

Perguntas frequentes

Does the validator check whether the company exists in the Federal Revenue Service?

No. The validator only confirms that the mathematical structure of the number is correct (modulo 11). To find out if the company is active, you must check the CNPJ Card directly on the Federal Revenue website.

Does the tool tell you if the CNPJ is a headquarters or branch?

Yes. The structure of the CNPJ itself reveals this. The numbers before the dash (e.g. 0001 or 0002) indicate the order of establishment. The validator interprets and displays this information on the screen.

Sobre este conteúdo

Escrito por:
Equipe Ferramenta Grátis

Ferramentas relacionadas

Online CNPJ Validator: Check if the number is valid