1001Ferramentas
🆔 Generators

Alphanumeric CNPJ Generator

Generate valid Brazilian alphanumeric CNPJ numbers in the new Receita Federal format (IN RFB 2.119/2022), effective July 2026. Uses the official SERPRO algorithm. For test use only.

What is the Alphanumeric CNPJ?

With Normative Instruction RFB no. 2.119/2022 (amended by IN 2.229/2024) the alphanumeric CNPJ appears. The root now accepts uppercase letters (A–Z) alongside digits, which expands the company identification namespace. For new registrations, this format starts to apply in July 2026.

For the check digits, the official algorithm published by Receita Federal and SERPRO is used. Each character is converted via ASCII minus 48 (0–9 → 0–9, A=17, B=18 … Z=42) and then multiplied by weights [6,5,4,3,2,9,8,7,6,5,4,3,2], with modulo 11. It's the same procedure as the numeric CNPJ, only generalised to the alphanumeric set.

By the official algorithm, the CNPJs generated here are mathematically valid. Even so they remain fictitious and match no registered company.

For testing and development use only. Using fake CNPJs for any illegal purpose is a crime.

Brazil's new alphanumeric CNPJ explained

The CNPJCadastro Nacional da Pessoa Jurídica — is Brazil's federal taxpayer ID for legal entities, the corporate counterpart of the CPF. Since 1972 it has been a 14-digit numeric code printed as XX.XXX.XXX/XXXX-DD. The Brazilian Federal Revenue (Receita Federal) is running out of numeric combinations as more than 60 million CNPJs have already been issued, so it published IN RFB nº 2.229/2024 introducing an alphanumeric version that comes into force on 1 July 2026.

The new layout keeps the same 14-position grid but allows letters in the first 12 characters:

AA.AAA.AAA/AAAA-DD
└── 8 chars ──┘└─4─┘└DV┘
  root / base    branch  check digits
12 alphanumeric (A–Z, 0–9) + 2 numeric DVs

How the check digits are calculated

The modulo-11 formula is the same one used for the numeric CNPJ — only the input changes. Each letter is converted to a number using its ASCII code minus 48, so A = 17, B = 18, …, Z = 42. The 12 converted values are then multiplied by the weights 5,4,3,2,9,8,7,6,5,4,3,2 for the first DV (and 6,5,4,3,2,9,8,7,6,5,4,3,2 for the second), summed, divided by 11; if the remainder is 0 or 1 the DV is 0, otherwise it is 11 minus the remainder. The two final digits remain numeric, which keeps backwards-compatible parsing for legacy systems that only inspect the trailing check.

What changes for systems and businesses

  • Existing CNPJs do not change. Every company already registered keeps its numeric ID forever — only brand-new registrations issued after the cutover may receive an alphanumeric one.
  • Database columns must accept letters. Fields stored as NUMERIC, BIGINT or 14-digit ZIP-padded integers have to be migrated to VARCHAR(14) or CHAR(14).
  • Validation libraries need updates. Regex patterns like ^\d{14}$ must be replaced by ^[A-Z0-9]{12}\d{2}$ and the DV routine must implement the ASCII conversion.
  • NF-e and tax XML layouts (Nota Fiscal Eletrônica) are being updated by SEFAZ to carry the alphanumeric format, including QR-code payloads on the consumer receipt (NFC-e).

FAQ

Can I use a generated alphanumeric CNPJ to register a company? No. The numbers produced here are mathematically valid against IN RFB 2.229/2024 but they are not registered with the Receita Federal. Using one to issue invoices, sign contracts or open bank accounts is identity fraud (Código Penal arts. 299 and 307).

Why letters instead of more digits? Adding letters expands the address space from 10^12 to 36^12 — roughly a 4,700-fold increase — without forcing any change to the 14-position layout already printed on millions of invoices, contracts and database schemas.

Will the NF-e QR code change? Yes. SEFAZ has published a draft layout (Nota Técnica) that updates the NFC-e QR payload and the chave-de-acesso (44-digit access key) so they can carry an alphanumeric CNPJ. Issuing software has to be recompiled before 1 July 2026.

Is everything generated in the browser? Yes. No data leaves your device — the test CNPJs are produced and validated entirely client-side in JavaScript.

Related Tools

Generate CNPJs in the new alphanumeric format

Brazil's tax authority will adopt the alphanumeric CNPJ (IN RFB 2.119/2022), in which the first twelve characters start mixing letters and numbers. This generator creates valid CNPJs already in that new format, so you can test systems before the switch.

The numbers come out with the check-digit calculation adapted for letters, so they pass the new format's validation routines without matching any real company. It's what you use to prepare and approve systems that will need to accept the alphanumeric CNPJ ahead of time.

Everything is generated in the browser, with no database lookup at all. Worth the reminder: fictitious data is for software testing, never to simulate companies in real situations.