CPF generator
CPF State
Generated CPF | Action | Status |
|---|---|---|
08771231447 | Not copied | |
88003950155 | Not copied | |
68738242249 | Not copied |
Need to validate an existing CPF?
Patient sign-ups usually ask for a CPF and a CNS. Need a CNS (SUS card) for the same test?
Need a phone number with a valid area code for the same test sign-up?
Validating a CPF in a form or extracting it from a log?See the CPF regex
How to use the CPF Generator?
Configure Generation
Set the quantity of CPFs (up to 100) and select the state of origin to define the fiscal region on the 9th digit.
Set Punctuation
Check 'Generate with Punctuation' to include dots and hyphen (000.000.000-00) or leave unchecked for numbers only.
Generate CPFs
Click 'Generate CPF' to instantly create valid numbers calculated using the official Modulo 11 algorithm.
Copy Results
Copy any individual CPF with a single click, copy all at once, or download the full list as a TXT file.
Features of the CPF Generator
Origin by State
Generate CPFs associated with a specific Brazilian state or fiscal region via the 9th digit, or choose the random option.
Batch Generation
Generate from 1 to 100 CPF numbers simultaneously to quickly populate forms and test databases.
With or Without Punctuation
Easily switch between masked format (000.000.000-00) and raw numeric digits according to your system requirements.
1-Click Copy & Download
Copy individual CPFs with a single click, copy the entire list, or download all generated results in a TXT file.
What is CPF?
The CPF (Cadastro de Pessoa Física) is a personal identification number used by the Brazilian government to recognize citizens and foreign residents in Brazil. Composed of 11 digits, it is essential for various activities such as opening bank accounts, making purchases, hiring services, and other processes that require identification.
CPF Structure and Validation
The CPF is structured as follows: the first nine digits are arranged into three groups of three numbers, separated by periods, followed by a hyphen and the last two digits, which are known as check digits (DV).
For example, the number 12345678909 is presented as 123.456.789-09.
Important Rules:
- The first nine digits of the CPF cannot all be the same.
- The two check digits must follow a specific formation rule.
How to Determine the State of Issuance of a CPF
The Brazilian state where a CPF was issued can be identified by the last digit before the two check digits.
| Reference Table of Numbers for Each State: |
|---|
| 1: Federal District, Goiás, Mato Grosso, Mato Grosso do Sul, and Tocantins |
| 2: Acre, Amapá, Amazonas, Pará, Rondônia, and Roraima |
| 3: Ceará, Maranhão, and Piauí |
| 4: Alagoas, Paraíba, Pernambuco, and Rio Grande do Norte |
| 5: Bahia and Sergipe |
| 6: Minas Gerais |
| 7: Espírito Santo and Rio de Janeiro |
| 8: São Paulo |
| 9: Paraná and Santa Catarina |
| 0: Rio Grande do Sul |
Practical Example:
Consider the fictitious CPF 987.654.321-00. The last digit before the check digits (1) indicates that this CPF was issued in one of the following states: Federal District, Goiás, Mato Grosso, Mato Grosso do Sul, or Tocantins.
How the Modulo 11 calculates the check digits
The last two digits of a CPF come from a calculation on the first nine, and systems repeat that calculation to tell whether a CPF is valid. Here is the calculation using the base 123.456.789.
First check digit
Multiply the nine digits by the weights 10, 9, 8, 7, 6, 5, 4, 3 and 2, then add them up: 1×10 + 2×9 + 3×8 + 4×7 + 5×6 + 6×5 + 7×4 + 8×3 + 9×2 = 210. The remainder of 210 divided by 11 is 1. When the remainder is less than 2, the digit is 0; otherwise, it is 11 minus the remainder. Here, the first digit is 0.
Second check digit
The base now has ten digits (1234567890), with the 0 from the previous step at the end, and the weights run from 11 to 2: 1×11 + 2×10 + 3×9 + 4×8 + 5×7 + 6×6 + 7×5 + 8×4 + 9×3 + 0×2 = 255. The remainder of 255 divided by 11 is 2, so the digit is 11 − 2 = 9.
Result
With both digits at the end, the CPF becomes 123.456.789-09. The generator runs this same calculation for every number in the list. Sequences of eleven identical digits, such as 111.111.111-11, also pass the calculation, but validators reject them.
To add this validation to your own code, see how to validate a CPF with JavaScript.
Valid CPF, real CPF and fictional CPF
Valid CPF
Any 11-digit number whose check digits match Modulo 11. Being valid only means the format is correct, not that the CPF exists.
Real CPF
A number the Receita Federal issued to a person and that is in their record. Only a lookup at the Receita Federal confirms whether a CPF exists and what its status is.
Fictional CPF
A valid number created with no link to any person, like the ones on this page. The Receita Federal has already issued hundreds of millions of CPFs, so a generated number may match someone's. Use it for testing only.
Where to use the generated CPF
Almost every Brazilian system has a CPF field, and using your own number or someone else's in a test environment spreads personal data for no reason. These are the most common uses.
Sign-up and checkout
Filling in e-commerce, marketplace and customer area forms in staging.
Payment methods
Test-mode integrations that ask for the buyer's CPF to issue a Pix, boleto or card charge.
Automated tests
Data for Cypress, Playwright or Selenium scripts, with a different number on each run.
Test database
Populating seeds and fixtures in bulk: generate up to 100 CPFs, download the list as TXT and import it.
Form validation
Checking the mask, the error message and how the field behaves with and without punctuation.
Study
Algorithm and database exercises that call for a Brazilian document.
Frequently Asked Questions about the CPF Generator
Everything you need to know about generating CPFs for testing and development.