CNPJ (National Registry of Legal Entities) Validator
Check if a CNPJ is valid. Validation is performed using the official check digit algorithm.
ℹ️ How it Works
The CNPJ is validated using an algorithm that checks the two check digits:
- The CNPJ must contain 14 numeric digits.
- CNPJs with all identical digits are considered invalid.
- The first check digit is calculated by multiplying the first 12 digits by a sequence of weights starting from 5 down to 2, then 9 down to 2.
- The second check digit is calculated by multiplying the first 13 digits by a sequence of weights starting from 6 down to 2, then 9 down to 2.
- The result of each sum is divided by 11. If the remainder is less than 2, the check digit is 0; otherwise, it is 11 minus the remainder.
- To verify the validity of a CNPJ with the Federal Revenue, access the official website: CNPJ Consultation - Federal Revenue
ℹ️ How Alphanumeric CNPJ Works
The Alphanumeric CNPJ is an evolution of the traditional model, allowing letters and numbers in the first 12 characters, followed by two numeric check digits. The validator uses the official algorithm published by the Federal Revenue, according to Normative Instruction 2,229.
- The CNPJ must contain 14 characters: 12 alphanumeric (A-Z, 0-9) and 2 numeric check digits.
- It cannot contain special characters other than a period, slash, or hyphen (used only as a mask).
- CNPJs composed only of zeros or with all identical characters are invalid.
- The check digits are calculated by an algorithm that uses specific weights for each position, according to the official standard.
- The calculation of the digits is performed on the first 12 characters, converting letters to their ASCII values and applying the defined weights.
- For technical details, consult the official Federal Revenue website.
Implementation Schedule
- October 15, 2024: Publication of Normative Instruction 2,229
- October 25, 2024: Normative Instruction comes into effect
- July 2026: Implementation of the new Alphanumeric CNPJ model
Facts about the CNPJ Validator
- The CNPJ Validator checks the 14-digit format and check digits.
- The validation uses the official Modulo 11 algorithm.
- The tool supports both numeric and alphanumeric CNPJ formats.
- The tool does not verify the active status of the company.