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.

Frequently asked questions

How do I know if a CNPJ is valid?

Paste the number above. The tool recalculates the two check digits using the modulo 11 algorithm and tells you immediately whether the maths adds up, which catches typos and invented numbers.

Does a valid CNPJ mean the company exists?

No. The check is of the number's structure only. A CNPJ can pass the calculation and belong to no registered company. To confirm a company exists you have to query the Brazilian federal revenue service.

What are the CNPJ check digits?

The last two numbers. They come from a calculation over the preceding twelve digits, multiplied by weights and divided by 11. They work as a proof: change a digit in the middle and the sum stops matching.

Can I validate several at once?

Validation here is one at a time. To fill a test database, the CNPJ generator produces valid numbers in bulk.

Is the number I paste sent to a server?

No. The calculation happens in your browser and the number never leaves your device.

About this content

Written by:
Ferramenta Grátis

Related tools