Brazil: company identifier formats (CNPJ)

Shape, check digit, accepted and refused examples and the API call for CNPJ in Brazil. Every example on this page is run through the same validators as the free identifier validator, so a value shown as accepted is a value the validator accepts.

CNPJ

FieldValue
RegisterReceita Federal (CNPJ)
ShapeX{12} C{2}
Check digitEnforced. 14 characters: 8 for the root, 4 for the order, 2 check digits. First digit: weights 5,4,3,2,9,8,7,6,5,4,3,2 over 12 characters; second: weights 6,5,4,3,2,9,8,7,6,5,4,3,2 over 13; each is 0 when the sum mod 11 is below 2, else 11 minus it.
Worked example (accepted)33.000.167/0001-01
Normalised form33000167000101
Also accepted as input33000167000101
A one-character slip33.000.167/0001-02 is refused
Regex (normalised form)^[0-9A-Z]{12}[0-9]{2}$
API callGET /companies/search?country=BR&company_number=33.000.167/0001-01
VAT numberThe register data holds no VAT number for this identifier.

Notes and scope

Since July 2026 root and order may carry capital letters; the check digits stay digits. An 11-digit CPF (a person) is refused. One record per CNPJ root: the 8-digit root finds the head office.

Call it from code

curl "https://api.prometiam.com/functions/v1/risk-api/companies/search?country=BR&company_number=33.000.167%2F0001-01" \
  -H "Authorization: Bearer YOUR_API_KEY"

Shape notation: N digit · L letter · X digit or letter · C check digit or character · {n} repeat n times.

A valid shape and check digit prove that a number is well-formed, not that a company holds it. Only a lookup in the register answers that.

Source and credit

Register data that the API serves for Brazil carries this credit:

Contains data from the Cadastro Nacional da Pessoa Jurídica (CNPJ), Receita Federal do Brasil, published as open data (CC BY). Adapted by Prometiam.

Related pages

Start your 14-day free trial · API documentation

The free trial lasts 14 days and includes 500 credits. A card is required and nothing is charged during the trial; it then continues as Starter (EUR 9.99/month) unless you cancel.

Frequently asked questions

How is the CNPJ checked?
14 characters: 8 for the root, 4 for the order, 2 check digits. First digit: weights 5,4,3,2,9,8,7,6,5,4,3,2 over 12 characters; second: weights 6,5,4,3,2,9,8,7,6,5,4,3,2 over 13; each is 0 when the sum mod 11 is below 2, else 11 minus it.