CNPJ generator and validator

Generate just a CNPJ or a complete company to use in tests, or check whether a CNPJ is valid.

What do you want to do?

A valid CNPJ is generated when the page opens. Choose the quantity and the format, or click "Generate CNPJ" to create another one.

Options

How it works

  • The CNPJ is generated on the server and is not stored anywhere.
  • The number follows the rules of Brazil's Federal Revenue Service (Receita Federal).
  • The check digits are calculated correctly.
  • The number is for testing only and does not belong to any real company.
  • The latest generated values are listed below the button until you leave the page.

How to use the API

You can integrate the CNPJ generator into your app through our REST API.

Endpoint

GET /api/generators/cnpj

Query parameters

quantity
Optional. From 1 to 50. When set, the response has the "cnpjs" list instead of "cnpj".
formatted
Optional. "false" generates digits only. Default: "true".

curl example

curl "https://devtools.vmotta.dev/api/generators/cnpj?quantity=2&formatted=false"

Response

{
  "cnpjs": [
    "11222333000181",
    "45723174000110"
  ]
}