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
Quantity
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
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
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.
Select Branch (0002+), set Number of Branches (1 to 5) and generate. You get the head office (/0001) and the branches (/0002, /0003…) on the same root, each with its own check digits. Copy All and the CSV/JSON export include the whole list.
Yes. Receita Federal began assigning alphanumeric CNPJs to new registrations in July 2026, and companies that were already registered keep their numeric CNPJ. For the check digits, each character is worth its ASCII code minus 48 (A = 17, Z = 42), not base 36. Both the generator and the validator here use that rule.
The IRS publishes a list of valid two-digit prefixes but no check-digit formula, so this tool validates an EIN by length and prefix only. CNPJ (Modulus 11) and SIREN (Luhn) do have check digits, which is why the validator shows expected vs. actual digits for those two.
Generating correctly formatted numbers for QA, demos or sample data is standard engineering practice, as long as they stay in test and development environments. Using one to open a bank account, file taxes or pose as a real business is a different matter entirely. Keep generated IDs out of production and out of any real submission form.
Yes. Switch tabs to generate NIPC (Portugal), CIF (Spain), Partita IVA (Italy), USt-IdNr (Germany) or SIREN/SIRET (France), each with its own check-digit algorithm and a matching fictitious company. Those tabs (and EIN) can generate 1, 5, 10 or 50 IDs at once; SIREN comes with 1 to 5 SIRETs.
This tool only checks the length and the prefix. A system that looks the number up in IRS records will reject a generated EIN, because it was never issued. Some validators also use a different prefix list than this tool's 85 prefixes.
References
Official page (in Portuguese) on the alphanumeric CNPJ, assigned to new registrations since July 2026.
The IRS list of valid two-digit EIN prefixes.
Official IRS overview of what an EIN is and who needs one.
Generate and validate SSN, CPF, NIF, DNI, Codice Fiscale and NIR for development testing.
Related Tools
- Fake SSN & CPF Generator for Test Data, with Validator Developer Generate test SSNs and Brazilian CPFs, plus NIF, DNI, Codice Fiscale, Steuer-IdNr and NIR. Bulk CSV/JSON export, fake identity and a live validator.
- Email Syntax Validator Developer Validate any email address format instantly against RFC 5322 rules — local part, @ symbol, domain, and TLD. Free, browser-only, private.
- JSON Formatter & Validator: Fix Errors, Tree View Developer Format, validate and minify JSON with errors shown by line and column, one-click fixes for trailing commas and quotes, and tree or graph views.
- JSON Schema Validator Online: Draft-07, 2019-09, 2020-12 Developer Paste JSON and a schema to see every error with its exact path as you type. Supports Draft-07, 2019-09 and 2020-12 via Ajv, with no upload.
- XML Formatter & Validator: Pretty Print, Tree, XPath Developer Paste XML to pretty print or minify it, spot the line with the error, browse it as a tree, run XPath queries, diff two files or convert to JSON.