CNPJ Generator & Validator
Generate and validate Brazilian company IDs (CNPJ), including the new alphanumeric format (from July 2026).
The link keeps what is on screen.
Fictitious data generated by algorithm, valid only in format. Use for testing only — never to impersonate a person or company.
Result
Validate
How is it calculated?
The first 12 characters (root + branch) accept letters and digits; each is worth its ASCII code − 48. The 2 check digits use weights 5→2 and 9→2 (modulo 11), just like the numeric CNPJ.
See the code ↗Processed in your browser; nothing is sent.
⌨️ Use from the terminal (JSON)
This tool also runs outside the site: the cli.js script uses the same logic as this page and returns the result as JSON. Parameters are the same as this page's URL — copy the command below with the values on screen.
Deno
deno run -q "https://thecodecodex.com/cli.js?tool=cnpj"
Node.js / Bun
curl -s https://thecodecodex.com/cli.js | node --input-type=module - cnpj q=…
| Parameter | Description | Default |
|---|---|---|
| q | quantidade (1-50) | 1 |
| kind | numeric | alphanumeric | numeric |
| mask | 1 = com máscara | 1 |
| v | CNPJ para validar | — |
Requires Deno, Node.js or Bun. With Deno the script runs with no permissions: it cannot read files or access the network. Central Bank indicators are from the day the site was published.