Brazil CNPJ validator and generator (alphanumeric 2026)
Validate a CNPJ from Brazil (validar CNPJ), numeric or alphanumeric since July 2026: check digits, the reason a number fails and a test generator.
How CNPJ check digits are calculated in Brazil
In Brazil, the CNPJ has 14 positions: an 8-character root, a 4-character establishment number (0001 for the head office) and 2 modulo 11 check digits computed with weights 5, 4, 3, 2, 9 down to 2, then 6, 5, 4, 3, 2, 9 down to 2. Since July 2026 the first 12 positions may contain letters, worth their ASCII code minus 48 (A = 17); the check digits stay numeric.
The calculation
Each character of the first 12 positions is converted: a digit keeps its value, a letter is worth its ASCII code − 48 (A = 17, B = 18, C = 19… Z = 42). First check digit: sum of the values × 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2; when the remainder of the sum divided by 11 is 0 or 1 the digit is 0, otherwise 11 − remainder. The second covers the first 13 positions with weights 6, 5, 4, 3, 2, 9 down to 2.
Worked examples
- 11.222.333/0001-81 (numeric): sum 102, remainder 3, first digit 8; then 120, remainder 10, second digit 1.
- 12.ABC.345/01DE-35 (example published by Serpro): values 1, 2, 17, 18, 19, 3, 4, 5, 0, 1, 20, 21; sum 459, remainder 8, first digit 3; then 424, remainder 6, second digit 5.
- 11.222.333/0001-82: invalid, the tool says 81 was expected.
The alphanumeric CNPJ
Normative Instruction RFB No. 2,229/2024 of 15 October 2024 created this format for new registrations from July 2026; the Receita Federal issued the first one, 00.000.000/E08G-12, on 31 July 2026. Numeric CNPJs already issued do not change, and the tool accepts both formats.
Generator and limits
The generator produces fictitious numbers for testing a form or a system (head office 0001 or a random establishment). A valid number is not necessarily assigned.
Sources and dates: Receita Federal, Alphanumeric CNPJ (IN RFB 2,229/2024); Serpro calculation rule (ASCII − 48 conversion, example 12.ABC.345/01DE-35) (checked on 15/10/2026).
Frequently Asked Questions
Since when can a CNPJ contain letters?
Normative Instruction RFB No. 2,229/2024 introduced the alphanumeric CNPJ for new registrations from July 2026, and the Receita Federal issued the first one on 31 July 2026. Existing numeric CNPJs remain valid and are not renumbered.
How are the check digits of a CNPJ with letters calculated?
Convert each character to its ASCII code minus 48: digits keep their value, A is 17, B is 18 and so on. Then apply the usual modulo 11 with weights 5, 4, 3, 2, 9 down to 2, then 6, 5, 4, 3, 2, 9 down to 2. For 12.ABC.345/01DE the result is 35.
What does 0001 mean in a CNPJ?
Positions 9 to 12 number the establishment: 0001 is usually the head office (matriz), and 0002, 0003… are branches. The first 8 positions, the root, are shared by every establishment of the company.
Can a generated CNPJ be used on an invoice?
No. The generator produces arithmetically valid numbers to test a form or software; they match no registered company, or a real one by chance. An invoice requires the issuer's real CNPJ.
Is this tool really free?
Yes, all tools on Kristools are 100% free and accessible without registration.
Is my data protected?
Yes. All processing is performed directly and securely inside your browser. No personal data is sent to our servers.