This CPF and CNPJ generator creates valid Brazilian tax ids for software testing and validates any number you paste. Any system built for Brazil asks for a CPF (individual taxpayer id) or a CNPJ (company id), and both carry two check digits that forms validate. To test sign-up flows, invoices, payment gateways or database seeds you need numbers that pass that check without belonging to real people. This tool generates them in bulk, with or without punctuation, lets you pick the state where a CPF would have been issued, and already supports the alphanumeric CNPJ that Receita Federal started issuing in July 2026. The validator checks one number or a whole list at once and tells you why each invalid one fails.
How to use it
- 1In Generate, choose CPF or CNPJ, the punctuation and how many numbers you need.
- 2Click Generate, then copy a single number, copy all of them or download a .txt file.
- 3In Validate, paste one number per line. Each line shows whether it is valid and the reason when it is not.
How the check digits are calculated
CPF: each of the first 9 digits is multiplied by a weight from 10 down to 2. The sum is multiplied by 10 and divided by 11; the remainder is the first check digit (10 becomes 0). The second digit repeats the process over 10 digits with weights from 11 down to 2.
CNPJ: the first 12 characters are multiplied by the weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2. If the remainder of the sum divided by 11 is 0 or 1 the digit is 0; otherwise it is 11 minus the remainder. The second digit uses the weights 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 over 13 characters.
The alphanumeric CNPJ
Since July 2026, new CNPJs may contain uppercase letters in the first 12 positions, while the last 2 remain numeric check digits. In the calculation each character is worth its ASCII code minus 48, so digits keep their usual value and A is worth 17, B 18 and so on. Existing numeric CNPJs do not change. If your system stores CNPJ as a number or strips letters, test it with the alphanumeric option before real companies with the new format reach you.
CPF and CNPJ format and length
A CPF has 11 digits and is written as 000.000.000-00. A CNPJ has 14 characters and is written as 00.000.000/0000-00: the first 8 identify the company, the next 4 the branch (0001 is usually the head office) and the last 2 are the check digits. You can generate both with or without this punctuation, depending on what your form or database expects.
Sequences with all equal digits, such as 111.111.111-11, pass the check-digit math but are rejected by Receita Federal, so the validator marks them as invalid too.
What developers and QA teams use it for
Fill sign-up and checkout forms during manual testing, create seed data and fixtures for automated tests, check that input masks and validation messages work, and load test an API with up to 100 numbers at a time. Brazilian payment flows often use a CPF or CNPJ as a Pix key, so you can also pair the test numbers with the Pix QR code generator when testing payment screens.
Frequently Asked Questions
- Are the generated numbers real?
- No. They are random numbers that satisfy the check-digit formula. A generated number may, by chance, match an existing registration, which is why they must only be used in test environments and never to identify anyone.
- Does a valid result mean the CPF or CNPJ exists?
- No. The validator only checks the math of the check digits. To know whether a number is registered and active you need to query Receita Federal, which this tool does not do.
- What does the issuing state of a CPF mean?
- The ninth digit of a CPF indicates the fiscal region where it was first issued. For example, 8 is São Paulo and 7 is Rio de Janeiro or Espírito Santo. Choosing a state fixes that digit in the generated numbers.
- Is the data I paste sent to a server?
- No. Generation and validation run entirely in your browser. Nothing is uploaded or stored.
- Can I use a generated CPF to sign up on real websites?
- No. Using a generated number to pose as someone, open an account, make purchases or avoid obligations is a crime in Brazil. The numbers are meant only for testing systems you build or maintain.
- How many numbers can I generate at once?
- Up to 100 per click, with or without punctuation. You can copy them all at once or download them as a .txt file, one number per line, ready to import into a spreadsheet or test script.