1001Ferramentas
🏢 Generators

CNPJ Generator

Generate mathematically valid Brazilian CNPJ numbers for software testing. With or without formatting. For test use only.

What is a CNPJ generator used for?

When it comes to filling forms, populating test databases or checking whether validation routines actually work, anyone who develops and tests software needs valid CNPJs. And none of that should rely on real company data.

The CNPJs produced here follow the Receita Federal check-digit algorithm, which means they are mathematically correct. Even so, they are fictitious numbers, with no link to any real company.

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

Anatomy of a CNPJ

The CNPJ — Cadastro Nacional da Pessoa Jurídica — is the fourteen-digit identifier the Brazilian Federal Revenue assigns to every legal entity: companies, NGOs, condominiums, churches, MEIs, and even individual branches of the same firm. The canonical format is XX.XXX.XXX/YYYY-DD: the first eight digits are the raiz (root) shared by the company group, the four-digit YYYY is the establishment order (0001 is the headquarters, 0002 onwards are branches), and the final two digits are check digits computed with the modulo-11 algorithm using the weights 5,4,3,2,9,8,7,6,5,4,3,2 from left to right.

In October 2024 the Receita Federal published Instrução Normativa RFB 2.229, which introduces an alphanumeric CNPJ starting in July 2026. The first twelve positions will accept uppercase letters and digits (A-Z and 0-9), while the two trailing check digits remain numeric. The change was driven by the imminent exhaustion of the purely numeric space: Brazil opens around six million new entities per year (MEIs and limited companies combined), and projections estimated that all numeric combinations would be consumed within two years. Existing CNPJs stay valid and unchanged — only new registrations from July 2026 onwards will receive the alphanumeric format.

How the alphanumeric check digit works

To keep the same modulo-11 algorithm working with letters, each character is converted to a number by subtracting 48 from its ASCII code. Digits 0-9 therefore map to themselves (ASCII 48-57 → 0-9), while letters map as A=17, B=18, C=19, …, Z=42. The remaining math is identical to today: multiply, sum, take modulo 11; if the remainder is 0 or 1 the DV is 0, otherwise it is 11 minus the remainder. The trick is elegant — old numeric CNPJs validate exactly the same way under the new rule.

FAQ

Are these CNPJs registered with the government? No. They satisfy the modulo-11 check digit rule but do not exist in the Receita Federal database. Using a generated CNPJ to issue invoices, open accounts, sign contracts or claim tax benefits is fraud (Código Penal arts. 171 / 299).

What is the 0001 in the middle? It is the establishment order. 0001 identifies the headquarters (matriz); subsequent values like 0002, 0003 identify branches that share the same root with the headquarters.

When does the alphanumeric format take effect? July 2026. The format applies only to new inscriptions from that date — current CNPJs remain numeric and valid indefinitely.

Does the tool send my data anywhere? No. All generation runs in your browser in JavaScript and nothing leaves the page.

Related Tools

CNPJ generator for testing

Just like the CPF, the CNPJ (Brazil's company tax number) carries check digits that follow a specific calculation. The generator returns numbers that pass that calculation, so any validation routine accepts them. None of them matches a real company.

It's the right tool for testing a B2B registration system, building staging test data or demoing an invoicing screen without exposing real information. You generate it with or without the mask (00.000.000/0001-00), whatever the field calls for. And the reminder always holds: a fictitious number is for testing, never to impersonate a real company or deceive third parties.

The whole calculation happens locally, in the browser, with no database lookup whatsoever. Each click hands over a different CNPJ, which makes it simple to build entire lists to seed your development environment.