Pular para o conteúdo
Tool

CNPJ generator

Generate a valid CNPJ for testing, or validate an existing CNPJ, with formatting, batch and matrix or branch option, free of charge.

Os números gerados são aleatórios e matematicamente válidos apenas quanto aos dígitos verificadores. Não pertencem a pessoas reais e não são consultados em bases oficiais. Destinam-se exclusivamente a testes de sistemas. Utilizar documentos falsos para fraude é crime (art. 299 do Código Penal).

Updated: July 2026

CNPJ Generator is a free online tool that creates CNPJ numbers with the two check digits correctly calculated by the official algorithm. It is made for those who need example data when programming, testing registrations and validating forms, without depending on real information from companies.

What is it

CNPJ is the National Register of Legal Entities, the number that identifies each company in Brazil. It has 14 digits and ends with two check digits, which act as a "real test" to check whether the number was entered without errors.

This generator assembles numbers that pass this mathematical validation, that is, they are structurally valid. The tool allows:

  • Generate or Validate: Use the Generator tab to create new examples, or the Validator tab to check if a test CNPJ already exists and if your math is correct.
  • Format the result with dots, slash and dash (00.000.000/0001-00) or leave just the numbers.
  • Generate in batch, creating several CNPJs at once to populate test tables and spreadsheets.
  • Choose head office or branch, adjusting the part of the number that indicates the company unit (the section 0001 for head office, or higher values ​​for branches).

Important: the numbers created here are fictitious and do not belong to any company registered with the Federal Revenue Service. They are used exclusively for testing software. Using false data to impersonate another person or company, issuing documents or carrying out scams is a crime provided for by law. Use responsibly.

How to use

Generating or validating a CNPJ takes just a few seconds:

  • Choose the tab: use Generator to create new numbers or Validator to check an existing CNPJ.
  • Adjust the options: decide whether you want the formatted result (00,000,000/0001-00) or just the numbers, and choose head office or branch.
  • Define the quantity: to generate in batch, enter how many CNPJs you need at once.
  • Copy the result: click to copy and paste directly into your system, spreadsheet or test database.

How do we calculate check digits?

Validation of a CNPJ depends on two final digits, calculated using decreasing weights.

  1. We multiply the first 12 digits by a sequence of weights (from 5 to 2, and then from 9 to 2).
  2. We add up all the results.
  3. We divide the sum by 11. If the remainder of the division is less than 2, the first digit will be 0. Otherwise, it will be 11 minus the remainder.
  4. We repeat the logic with the 13 digits (including the first checker) and weights (6 to 2, and 9 to 2) to find the last digit.

Tips

  • Always prefer these numbers in homologation databases, never in production.
  • To test the validation of your system, generate a valid CNPJ and also an invalid one (e.g. change the last digit), and check the error messages.
  • If your database separates headquarters and branch, generate CNPJs with root 0002+ to cover branch scenarios.

Perguntas frequentes

Is the generated CNPJ valid?

Yes, it is valid from a mathematical point of view, as the two check digits are calculated by the official algorithm. However, it is a fictitious number that does not belong to any company registered with the Federal Revenue Service. It is only used to test systems.

Can I use the CNPJ generated to open a company or issue a note?

No. These numbers are only for testing software in a development environment. Using a false CNPJ on official documents, notes or to impersonate a company is a crime provided for by law.

Is the tool free and do I need to install something?

It's completely free, works directly in the browser and doesn't require registration or installation. You can generate as many numbers as you need, without limits and at no cost.

What is the difference between headquarters and branch in the CNPJ?

The section after the slash indicates the company unit: 0001 usually represents the head office, and subsequent numbers (0002, 0003) indicate branches. The tool lets you choose this part to simulate different test scenarios.

Can I generate several CNPJs at once?

Yes. The ** batch generation ** option creates several numbers at once, which helps you quickly fill tables, spreadsheets and approval databases.

Can you validate a CNPJ on this same page?

Yes. Switch to the "Validator" tab, paste the number and the tool instantly checks whether the check digits match the official algorithm, without having to open another page.

Sobre este conteúdo

Escrito por:
Equipe Ferramenta Grátis
Atualizado em:
3 de julho de 2026

Ferramentas relacionadas

Free Online CNPJ Generator and Validator