Alphanumeric CNPJ
Validate and generate CNPJs in the new alphanumeric format adopted by Brazil's Receita Federal, which mixes letters and numbers. Learn what changed, what the number looks like and how to calculate the check digits step by step.
Validate an alphanumeric CNPJ
Generate an alphanumeric CNPJ
Need many at once? Use the CNPJ generator.
What is the alphanumeric CNPJ?
It is the new format of the CNPJ (Cadastro Nacional da Pessoa Jurídica, the Brazilian company taxpayer ID), introduced by Normative Instruction RFB No. 2,229/2024. The number still has 14 positions, but the first 12 (the company root and the branch number) now accept the letters A to Z in addition to digits. The last two characters remain numeric check digits. The change was needed because purely numeric combinations were running out.
What changes and what stays the same
- New registrations have been receiving alphanumeric CNPJs since July 2026.
- Companies that already have a CNPJ keep the same numeric number.
- The mask stays the same: 12.ABC.345/01DE-35.
- Systems, databases and forms must accept letters in the first 12 positions.
How to calculate the check digit
The calculation is the same modulo 11 used for the numeric CNPJ. The difference is that each character is converted to a number using its ASCII code minus 48. That way, the digits 0 to 9 keep their own value and the letters range from A = 17 to Z = 42.
- Convert the first 12 characters using the table below.
- Multiply them by the weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 and add up the results.
- Take the remainder of the division by 11. If it is 0 or 1, the digit is 0; otherwise, it is 11 minus the remainder.
- Repeat with the 12 characters plus the first digit, using the weights 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2.
Example: 12.ABC.345/01DE-35
| Character | 1 | 2 | A | B | C | 3 | 4 | 5 | 0 | 1 | D | E |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Value | 1 | 2 | 17 | 18 | 19 | 3 | 4 | 5 | 0 | 1 | 20 | 21 |
| Weight | 5 | 4 | 3 | 2 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 |
| Product | 5 | 8 | 51 | 36 | 171 | 24 | 28 | 30 | 0 | 4 | 60 | 42 |
The sum of the products is 459. The remainder of 459 ÷ 11 is 8, so the first digit is 11 − 8 = 3. Repeating the calculation with the 3 included, the second digit is 5, which gives the CNPJ 12.ABC.345/01DE-35.
Character value table
Frequently asked questions
When did the alphanumeric CNPJ take effect?
Brazil's Receita Federal started issuing alphanumeric CNPJs for new registrations in July 2026, under Normative Instruction RFB No. 2,229/2024.
Will existing CNPJ numbers change?
No. Existing CNPJs keep the same number. Only new registrations receive the alphanumeric format.
Which characters can an alphanumeric CNPJ contain?
The first 12 positions accept digits 0 to 9 and uppercase letters A to Z. The last two positions, the check digits, are always numeric.
How do I calculate the check digit of an alphanumeric CNPJ?
Convert each character to a number using its ASCII code minus 48 (A = 17, B = 18 and so on) and apply the same modulo 11 used for the numeric CNPJ, with weights from 2 to 9.
What does my system need to change to support the new CNPJ?
Fields and database columns that store the CNPJ as a number must accept text, masks and validations must allow letters in the first 12 positions, and the check digit calculation must use the ASCII conversion.