CNPJ Generator
Generate valid CNPJ numbers for testing and development. Bulk generation, formatted or digits-only output. Built for developers and QA engineers.
Enter 14 digits (with or without formatting)
Was this tool helpful?
Thank you for your feedback!
CNPJ Generator for Testing
Our CNPJ generator creates mathematically valid CNPJ numbers (Cadastro Nacional da Pessoa Jurídica) for use in software testing and development environments. Each generated 14-digit number follows the official Module 11 algorithm from Brazil's Receita Federal, with correctly calculated check digits that pass any standard validation routine. Brazil has over 58 million registered CNPJs, with approximately 22 million currently active — our generator produces numbers structurally identical to those issued by the government.
The generation process is fully random and client-side: the tool produces a random 8-digit root using the browser's crypto.getRandomValues() for true cryptographic randomness, appends a branch number (0001 for headquarters), computes the two verification digits via weighted sums and modulo 11, and formats the result as XX.XXX.XXX/XXXX-XX. Everything runs in your browser — no data is sent to any server, ensuring complete privacy and LGPD compliance.
You can generate CNPJs individually or in batches of up to 50, with or without formatting. Each generated CNPJ is guaranteed unique within the same batch — duplicates are automatically discarded and replaced. This is perfect for populating test databases, validating business registration forms, running integration tests against payment APIs, testing ERP systems, simulating company registrations in staging environments, or verifying that your invoice generation system correctly handles CNPJ formatting.
Understanding CNPJ structure: A CNPJ consists of a root (8 digits identifying the company), a branch number (4 digits — 0001 for headquarters, 0002+ for branches), and two check digits. The generator uses branch 0001 by default since most testing scenarios involve headquarters. The first check digit is calculated using Module 11 with multipliers (5,4,3,2,9,8,7,6,5,4,3,2) applied to the first 12 digits — the sum of products is divided by 11, and if the remainder is less than 2 the digit is 0, otherwise 11 minus the remainder. The second check digit follows the same logic with multipliers (6,5,4,3,2,9,8,7,6,5,4,3,2) applied to the first 13 digits, ensuring mathematical validity identical to real CNPJs issued by the Receita Federal.
Legal notice: All generated CNPJs are fictitious and do not correspond to any real company registered with the Receita Federal. Using fabricated CNPJs for fraud or any illegal purpose is a crime under Article 304 of the Brazilian Penal Code. This tool is intended exclusively for development and testing.
Need to verify an existing CNPJ? Use our CNPJ Validator. For the new alphanumeric format (effective July 2026 per IN RFB 2.119/2022), try the Alphanumeric CNPJ Generator. For individual taxpayer numbers, see our CPF Generator. To look up actual company data, visit our CNPJ Lookup. You can also format existing numbers with our CNPJ Formatter tool.