Skip to main content

Alphanumeric CNPJ Generator

Prepare your system for the new Alphanumeric CNPJ standard. For tests.

Waiting for generation...

Prepare your System for the Future of CNPJ

According to Normative Instruction RFB No. 2,119/2022, the Federal Revenue of Brazil instituted the new Alphanumeric CNPJ standard, which may be issued starting in July 2026. This change is fundamental and requires systems to adapt in advance.

The Box4Dev Alphanumeric CNPJ Generator is a proactive tool for developers and QA teams. It allows simulating the new format, enabling the validation of databases, form masks, APIs, and all business logic.

Anatomy & Structure of Alphanumeric CNPJ

The upcoming Alphanumeric CNPJ features 14 positions formatted as XX.XXX.XXX/XXXX-DD:

PositionFieldLengthMeaning & RuleExample
1 to 8Alphanumeric Root8 charsLetters A-Z and digits 0-9 identifying the entity12AB56CD
9 to 12Establishment Code4 charsAlphanumeric establishment order (0001 for main headquarters)0001
13 & 14Numeric Check Digits2 digitsStrictly numeric check digits computed via ASCII-based Modulo 1142

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. 1. Convert first 12 characters: Value = ASCII - 48 (digits '0'-'9' equal 0-9; letters 'A'-'Z' equal 17-42).
  2. 2. Multiply values by cyclic weights [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2].
  3. 3. If remainder modulo 11 < 2, CD1 is 0; else CD1 = 11 - remainder.
  4. 4. For CD2, multiply by weights [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2] and CD1 by 2.
  5. 5. If remainder < 2, CD2 is 0; else CD2 = 11 - remainder.
  6. 6. Check digits 13 and 14 are strictly numeric 0 to 9.

Frequently Asked Questions (FAQ)