Generate, check or correct Brazilian CNPJ number

Brazilian registry of legal entities is called Cadastro Nacional de Pessoas Jurídicas. Acronym CNPJ is often used for this register as well as for the identification numbers assigned to Brazilian companies and their branches by national taxation agency (Secretaria da Receita Federal) and stored in this centralized registry. CNPJ consists of 14 decimal digits and usually is printed or displayed in human friendly format NN.NNN.NNN/BBBB-CC, where N-digits are defined by the body issuing this number, B denotes the company branch and the most common value is 0001 meaning the main office of the company, and C's are two checking digits calculated by some simple algorithm.

e-CPNJ A3 sample smart-card

Nowadays Brazilian Ministério da Fazenda promotes the electronic interaction with taxpayers in order to avoid the necessity of personal visits to its offices. For this purpose e-CNPJ is introduced. This digital certificate identifying electronic documents sent by companies to taxation agency is available in two forms: A1 and A3. A1 type is cheaper (approx. R$ 130) and valid only for 1 year. A3 is 2-4 times more expensive but can be used 3 years. A3 e-CNPJ is more secure as it contains cryptographic application in the smart-card or token. A1 e-CNPJ is just computer files.

Use CNPJ Consulta web-form from the Secretaria da Receita Federal site to query company information by CNPJ. Provide only decimal digits (without dividing dots, slash, hyphen) into CNPJ input box there and press Consultar button.

This service allows to generate fully random or partially defined valid but probably fake CNPJ numbers, to check entered CNPJ for compliance, to correct CNPJ with one wrong digit (many options may be offered). Enter CNPJ or its part into yellowish textbox to view results. Javascript must be enabled in your browser.