Alphanumeric CNPJ Validator
Validate alphanumeric CNPJs in the new Federal Revenue format. For QA.
About the Alphanumeric CNPJ Validator
This tool validates the new alphanumeric CNPJ format established by IN RFB No. 2,119/2022. Starting July 2026, the Federal Revenue may issue CNPJs containing letters (A-Z) and numbers (0-9), increasing combination possibilities.
The verification digit calculation algorithm is similar to the traditional CNPJ, but adapted to work with alphanumeric characters. This tool is essential for testing your system's compatibility with the new standard.
Anatomy & Structure of Alphanumeric CNPJ
The upcoming Alphanumeric CNPJ features 14 positions formatted as XX.XXX.XXX/XXXX-DD:
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 to 8 | Alphanumeric Root | 8 chars | Letters A-Z and digits 0-9 identifying the entity | 12AB56CD |
| 9 to 12 | Establishment Code | 4 chars | Alphanumeric establishment order (0001 for main headquarters) | 0001 |
| 13 & 14 | Numeric Check Digits | 2 digits | Strictly numeric check digits computed via ASCII-based Modulo 11 | 42 |
Official Alphanumeric CNPJ Algorithm (IN RFB 2,229/2024)
Each character maps to a decimal integer calculated as ASCII code minus 48:
Val(c) = ASCII(c) - 48; CD1 = (Sum1 % 11 < 2 ? 0 : 11 - Rem1); CD2 = (Sum2 % 11 < 2 ? 0 : 11 - Rem2)
- 1. Convert first 12 characters: Value = ASCII - 48 (digits '0'-'9' equal 0-9; letters 'A'-'Z' equal 17-42).
- 2. Multiply values by cyclic weights [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2].
- 3. If remainder modulo 11 < 2, CD1 is 0; else CD1 = 11 - remainder.
- 4. For CD2, multiply by weights [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2] and CD1 by 2.
- 5. If remainder < 2, CD2 is 0; else CD2 = 11 - remainder.
- 6. Check digits 13 and 14 are strictly numeric 0 to 9.