CNPJ Generator & Validator

CNPJ & EIN Generator: Alphanumeric CNPJ 2026 + Validator

Generate test CNPJs (numeric or the new alphanumeric format, with branches) and US EINs, plus CIF, Partita IVA and SIREN. Validator included, free.

Updated November 2026

Reviewed by Rafael Duarte

Generator Settings

Quantity

Real-Time Validator

Validation Report

Waiting for input…

How to generate a CNPJ or EIN

Pick a tab, set the format, copy the result

1. Pick a country

On the English page the EIN (USA) tab opens first. Click the CNPJ tab for Brazil, or switch to NIPC (Portugal), CIF (Spain), P.IVA (Italy), USt-IdNr (Germany) or SIREN (France).

2. Set the format

For a CNPJ, choose Numeric or Alphanumeric (2026), then Matrix (0001) or Branch (0002+) with 1 to 5 branches. The EIN, NIPC, CIF, P.IVA and USt-IdNr tabs generate 1, 5, 10 or 50 IDs at once. Turn Formatted off to get raw characters.

3. Generate and copy

Each ID comes with a fictitious company: name, industry code, address and partner. Copy All grabs the whole profile, and Export CSV or Export JSON downloads the IDs.

What this tool does

Real check-digit math, branches and the alphanumeric CNPJ, ready for QA

Numeric and alphanumeric CNPJ

Generate the classic 14-digit CNPJ or the alphanumeric one, where the 8-character root mixes digits and letters A–Z. Check digits use Modulus 11 with each character worth its ASCII code minus 48, not base 36.

Head office and branches

Pick Branch (0002+) and set 1 to 5 branches. You get the head office (/0001) plus /0002, /0003 and so on, all sharing one root, each with its own check digits.

EIN with a prefix check

Each EIN starts with a two-digit prefix from the tool's list of 85, followed by seven random digits. The validator rejects prefixes outside that list, such as 00, 07 or 89.

Full fictitious company profile

Company name, industry code (CNAE, NAICS, ATECO, NAF…), street address and a partner or director: everything a form asks for, none of it real.

Real-time validator

Paste an ID into the validator for the selected tab and get VALID or INVALID with the reason: expected vs. actual check digits, head office or branch order, numeric or alphanumeric format.

Validation code in 10 languages

Open Validation Code to copy the algorithm in JavaScript, TypeScript, Python, PHP, Java, C#, Go, Ruby, Kotlin or Swift instead of writing it from scratch.

CNPJ and EIN examples

Format
Example
CNPJ, numeric, head office
45.892.112/0001-32
CNPJ, same root, first branch
45.892.112/0002-13
CNPJ, alphanumeric
12.ABC.345/0001-88
CNPJ, Formatted off
45892112000132
EIN, formatted
61-4839027
Invalid CNPJ: wrong check digits
45.892.112/0001-90
Invalid EIN: prefix 00 is not on the list
00-1234567

When you'll reach for this

The most common scenarios among people who use this tool

Fill test forms and API mocks

Populate signup flows, onboarding forms and API fixtures with realistic-looking CNPJs or EINs without touching a single real business record.

QA for invoicing, payments and ERP integrations

Integrating with Brazil? Feed your CNPJ validation, head office/branch logic and supplier onboarding a mix of valid IDs and deliberately broken check digits. The same goes for EIN intake on US forms.

Stay compliant while testing

Generated IDs are correctly formatted but unregistered, so no real company's CNPJ, EIN or SIREN ever has to touch your test environment.

Make sure your stack accepts the alphanumeric CNPJ

Brazil's Receita Federal started assigning alphanumeric CNPJs to new registrations in July 2026. Generate letter-based ones and check that your database columns, input masks and validators accept them.

Build multi-country demo data

Need sample companies from seven countries for a demo or design mockup? Switch tabs and generate a consistent EIN, CNPJ, CIF or SIREN persona in seconds.

Common mistakes

Treating the CNPJ as digits only

New CNPJs can carry letters in the first 12 characters. Code that strips everything but digits, stores the CNPJ as a number or uses a digits-only mask will break on them. Only the last two characters, the check digits, are always numeric.

Expecting an EIN checksum

The IRS publishes a list of valid two-digit prefixes, not a check-digit formula, so a format check can only test the length and the prefix. It can't prove the number was ever issued. Don't reuse your CNPJ or SIREN checksum logic for an EIN.

Using a generated ID on a real form

These numbers are unregistered by design. Submitting one to a bank, payroll provider or tax authority is a compliance problem, so keep generated IDs in test and staging environments only.

Confusing EIN with SSN

An EIN identifies a business; an SSN identifies a person. Both are 9 digits, which is why the formats get mixed up, but the two use different assignment rules and different systems entirely.

Why use this tool

Most CNPJ generators stop at one random number. This one builds a head office and up to 5 branches on the same root, covers the alphanumeric format, and attaches a fictitious company with a CNAE code, address and partner, so your fixtures look like a real registration. When your test data crosses borders, the same page generates EINs and five European formats too.

Everything runs in your browser. No CNPJ, EIN or company data is ever transmitted or stored anywhere, which matters when your test fixtures need to stay clear of PII and real business records. Need IDs for people instead of companies? Use the SSN and CPF generator.

CNPJ, EIN and their international equivalents

Same idea, different algorithm per country

CNPJ (Brazil)
EIN (USA)
SIREN (France)
Partita IVA (Italy)
Check digit / checksum
yes, Modulus 11
no, prefix check only
yes, Luhn
yes
Head office/branch hierarchy
yes (matrix + branches)
no
yes (SIRET)
no
Alphanumeric format
yes, since July 2026
no
no
no
Generated in this tool
yes
yes
yes
yes

Frequently asked questions

Open the CNPJ tab, choose Alphanumeric (2026) under Format and click Generate. The 8-character root mixes digits and letters A–Z, the order stays numeric (0001 for the head office) and the two check digits are always numbers, as in 12.ABC.345/0001-88.

References

Related Tools