CNPJ Generator and Validator
Validate a Brazilian CNPJ, including the new alphanumeric CNPJ, and generate valid CNPJ numbers for testing. Shows head office or branch. Free, in your browser.
What it does
The CNPJ (Cadastro Nacional da Pessoa Jurídica) identifies companies and other legal entities in Brazil. It has 14 characters written as 00.000.000/0000-00: eight for the root of the company, four for the establishment (0001 is the head office, the others are branches) and two check digits calculated with modulo 11. Since July 2026 new registrations can receive letters in the first twelve positions (IN RFB 2.229/2024); each character then counts as its ASCII code minus 48, and the check digits are still numbers.
Everything happens in your browser: the numbers you type are not sent or stored.
Frequently asked questions
Does a valid number mean that the person or company exists?
No. It only means the check digits are correct, which catches typing mistakes. Whether the number was actually issued, and to whom, can only be checked with the authority that issues it.
What are the generated numbers for?
For testing: filling in forms in development, testing databases and validation code. They are made at random with correct check digits, so by chance one may coincide with a real number. Never use them to identify yourself, sign up for anything or deceive anyone.
How does a check digit work?
It is calculated from the other digits with a fixed formula, usually multiplying each digit by a weight and taking the remainder of a division (modulo 11, or modulo 23 for the Spanish DNI letter). If one digit is typed wrong or two are swapped, the check digit no longer matches.
Other documents
- 🇧🇷 CPF Generator and Validator
- 🇲🇽 CURP Validator and Generator
- 🇲🇽 RFC Validator and Generator
- 🇨🇱 RUT Validator and Generator (Chile)
- 🇨🇴 NIT Check Digit Calculator (Colombia)
- 🇦🇷 CUIT and CUIL Validator (Argentina)
- 🇵🇪 RUC Validator and Generator (Peru)
- 🇪🇸 DNI and NIE Letter Validator (Spain)
- 🇵🇹 NIF Validator and Generator (Portugal)
- 🇨🇳 Chinese ID Number Validator (身份证)
- 🇹🇷 TC Kimlik No Validator (Turkey)
- 🇮🇩 NIK Validator (Indonesia)