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 CNPJ — Cadastro 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,BIGINTor 14-digit ZIP-padded integers have to be migrated toVARCHAR(14)orCHAR(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).
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.
Frequently asked questions
Can I use a generated alphanumeric CNPJ to register a company?
Why letters instead of more digits?
Will the NF-e QR code change?
Is everything generated in the browser?
Related Tools
CNPJ Generator
Generate mathematically valid Brazilian CNPJ numbers for software testing. With or without formatting. For test use only.
Batch CNPJ Generator
Generate many valid Brazilian CNPJ numbers at once (up to 1000) to test systems, forms and sign-ups. Choose with or without mask and copy the ready list.
Company Data Generator
Generate fictitious company data (company name, CNPJ and type) for software testing. Mathematically valid CNPJ.
PIS/PASEP Generator
Generate mathematically valid Brazilian PIS/PASEP numbers for software testing. Follows the official check-digit algorithm. For test use only.
Brazilian State Tax ID Generator
Generate valid Brazilian State Tax IDs (Inscrição Estadual) for SP, RJ, MG, RS, PR and BA. For fiscal software and SEFAZ integration testing.
RG Generator
Generate mathematically valid Brazilian RG (identity) numbers in the São Paulo format for software testing. For test use only.