Free online tool

CNPJ Generator and Validator

Generate, validate, and export fictional Brazilian CNPJ numbers in alphanumeric or numeric format.

Generate CNPJ

Create valid fictional data for software testing.

Generated result

Validate CNPJ

Check format and check digits without querying official records.

Numbers are generated locally. Only the latest 10 are saved in this browser, and no data is sent to CosmoTools.

Prefer Portuguese? Use o gerador de CNPJ em português.

How to generate and validate a CNPJ

Choose alphanumeric or numeric format, punctuation, and a batch size from 1 to 50. Copy or export the batch as JSON and CSV. The validator normalizes letters and recalculates both check digits locally without querying the Brazilian Federal Revenue.

Alphanumeric and numeric CNPJ

A CNPJ still contains 14 positions: a 12-character base followed by two numeric check digits. New registrations may contain letters and numbers, while existing numeric CNPJs remain valid.

Use numeric mode for legacy integrations and alphanumeric mode when testing systems prepared for the current format.

Safe use in development

The generated values are intended for forms, APIs, ERP integrations, imports, databases, and automated tests. Correct check digits do not prove that a company exists or is in good standing.

Do not use these numbers to issue documents, open real accounts, or impersonate an organization.

Official check-digit example

The final two digits use two modulo-11 steps. For alphanumeric values, each base character uses its ASCII value minus 48. Official example base 12ABC34501DE produces 35, resulting in 12.ABC.345/01DE-35.

Official references and related tools

See the Brazilian Federal Revenue pages for the alphanumeric CNPJ project and its check-digit manual. For personal test identifiers, use the CPF Generator and Validator.

Frequently asked questions

Does a generated CNPJ belong to a real company?

Not necessarily. The generator creates a fictional structurally valid registration but does not query or confirm companies with the Brazilian Federal Revenue.

Does the generator support alphanumeric CNPJ?

Yes. You can generate the current alphanumeric format or the legacy numeric-only format.

Are existing numeric CNPJs still valid?

Yes. Adoption of the alphanumeric format does not change existing numeric registrations.

Can I generate a CNPJ without punctuation?

Yes. Disable punctuation to receive all 14 characters without separators.

Does the validator query the Brazilian Federal Revenue?

No. It checks format and check digits locally; that does not confirm registration or tax status.

Are generated CNPJs stored?

Only the latest 10 are kept in your browser local storage. No result is sent to CosmoTools.

How the tool works

Choose alphanumeric or numeric format, punctuation, and a batch size. Generate fictional values, copy them, or export JSON and CSV. The validator normalizes letters to uppercase and recalculates both check digits locally.

Supported input and output

A CNPJ has twelve base positions and two numeric check digits. Existing numeric registrations remain relevant, while systems must also be prepared for the alphanumeric format. Punctuation is only a display convention.

Practical example

The official example base 12ABC34501DE produces check digits 35 and the formatted value 12.ABC.345/01DE-35. Use both formats to test an ERP, API, database column, import, and input mask.

Common use cases

Fictional CNPJs are useful in software development, staging, automated testing, demos, and data migrations where a structurally valid value is needed without deliberately copying a company registration.

Limits and important checks

Check digits confirm structure only. The generator does not query the Brazilian Federal Revenue, confirm that a company exists, or establish tax status. Never issue documents, create real accounts, or impersonate an organization with generated data.

Privacy and local processing

Unless the tool explicitly identifies an external lookup, input and generated output are processed in your browser and are not uploaded to CosmoTools. Avoid placing secrets in any web page and review downloaded results before using them in production.