CNPJ generator and validator
Generate just a CNPJ or a complete company to use in tests, or check whether a CNPJ is valid.
A valid CNPJ is generated when the page opens. Choose the quantity and the format, or click "Generate CNPJ" to create another one.
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"
]
}A fake company with CNPJ, state registration, contact details and address. Choose the state or leave it on "Any state".
How it works
- The company is generated on the server and is not stored anywhere.
- The CNPJ and the state registration are valid, and the registration follows the rules of the company's state.
- The address is real: the CEP exists and matches the street, neighborhood and city. The phone number uses the city's area code.
- The email uses domains reserved for testing (example.com), so no message ever reaches a real person.
- The data is for testing only and does not belong to any real company.
How to use the API
You can integrate the company generator into your app through our REST API.
Endpoint
GET /api/generators/company
Query parameters
- state
- Optional. The state abbreviation, such as "SP". Without it, the state is picked at random.
curl example
curl "https://devtools.vmotta.dev/api/generators/company?state=RS"
Response
{
"company": {
"name": "Santos Logística Ltda",
"tradeName": "Santos Logística",
"cnpj": "47.870.299/7915-54",
"stateRegistration": "416/9121979",
"foundedAt": "10/01/2016",
"email": "contato.santoslogistica@example.com",
"website": "www.santoslogistica.com.br",
"phone": "(51) 2984-4088",
"cep": "91510-090",
"street": "Avenida Rocio",
"number": "2583",
"neighborhood": "Vila João Pessoa",
"city": "Porto Alegre",
"state": "RS"
}
}Enter a CNPJ and click "Validate CNPJ" to find out whether it is valid.
How it works
- Validation runs on the server and nothing is stored.
- The validator checks whether the CNPJ follows the rules of the Federal Revenue Service.
- Both the format and the check digits are verified.
- The CNPJ can be entered with or without punctuation (00.000.000/0001-00 or 00000000000100).
- The result shows up right below the field.
How to use the API
You can integrate the CNPJ validator into your app through our REST API.
Endpoint
POST /api/validators/cnpj
Request body
- cnpj
- Required. The number, with or without punctuation.
curl example
curl -X POST https://devtools.vmotta.dev/api/validators/cnpj \
-H "Content-Type: application/json" \
-d '{"cnpj":"00.111.222/0000-00"}'Example body
{
"cnpj": "00.111.222/0000-00"
}Response
{
"isValid": false
}