CPF Generator

Brazilian CPF generator for software testing and development. Generate a random CPF or several at once, by state, with or without punctuation. Free, no sign-up.

Click Generate CPF to create a number

About this tool

Free online CPF generator built for developers and software testing. The tool generates mathematically valid CPF numbers, with check digits calculated by the official modulo 11 algorithm, so they pass any form validation or business rule. The whole process runs in the browser, with no sign-up and no connection to real people. You can generate a random CPF, restrict the result to a specific state, or create batches of up to 100 numbers at once.

Features

Generate valid CPF by state
Batches of up to 100 unique CPFs
Formatted or numbers-only output
Check digits calculated via modulo 11
Fiscal region table by digit

How the CPF algorithm works

The CPF algorithm consists of 11 digits: 9 identification digits and 2 check digits at the end. The first 9 are sequential by fiscal region, and the 9th indicates the state where the document was issued. The last two are derived from a modulo 11 calculation over the preceding digits: each digit is multiplied by a weight, everything is summed, divided by 11, and the remainder determines the check digit. The method was designed to detect typing errors. Changing one digit or swapping two almost always breaks validation, allowing any system to reject invalid numbers without querying the tax authority.

CPF 9th Digit by Fiscal Region

DigitStates
0Rio Grande do Sul (RS)
1Distrito Federal (DF), Goiás (GO), Mato Grosso (MT), Mato Grosso do Sul (MS), Tocantins (TO)
2Acre (AC), Amapá (AP), Amazonas (AM), Pará (PA), Rondônia (RO), Roraima (RR)
3Ceará (CE), Maranhão (MA), Piauí (PI)
4Alagoas (AL), Paraíba (PB), Pernambuco (PE), Rio Grande do Norte (RN)
5Bahia (BA), Sergipe (SE)
6Minas Gerais (MG)
7Espírito Santo (ES), Rio de Janeiro (RJ)
8São Paulo (SP)
9Paraná (PR), Santa Catarina (SC)

Use Cases

The most common practical applications of the CPF generator in development and QA workflows are:

  • Form and UI validationTest input masks, real-time validators (JavaScript, React, Angular, etc.), error messages, and frontend behavior with data that passes every business rule.
  • Automated testing (Unit, Integration & E2E)Populate fixtures, test databases, and scenarios with valid CPFs, eliminating real data and reducing the risk of data leaks.
  • Development and staging environmentsCreate test users in staging, local databases, or demo environments without violating data protection laws or touching production data.
  • API and integration testingSend realistic payloads to endpoints that require a CPF: registrations, credit checks, invoice issuance, and third-party services.
  • Mockups, prototypes, and presentationsFill Figma, Adobe XD screens, or client slide decks with visually convincing data, without exposing real information.
  • Performance and load testingGenerate hundreds of CPFs quickly to simulate large registration or query volumes in a controlled environment.
  • Studies, training, and coursesTeachers and students use generated CPFs for hands-on examples in programming classes, database courses, and form validation exercises.

How to Use

1

Generate a CPF quickly

When you open the page, the first CPF is already ready. To generate another, click "Generate CPF" — the number is available to copy with a single click.

2

Generate several at once

Check "Generate Multiple CPFs", choose how many (between 2 and 100), and click "Generate CPFs". The "Copy All" button sends the entire list to your clipboard.

3

Choose the format

By default, the CPF is formatted with dots and a dash. If you need the raw number (database, JSON, etc.), enable "Numbers Only" before generating.

Questions and Answers

What is a CPF and what is this generator for?

The CPF (Cadastro de Pessoas Físicas) is the Brazilian individual taxpayer registry number, the equivalent of a national ID/tax number for individuals. This generator produces numbers that follow the CPF's mathematical rules so they pass form validation and business logic during development. It is meant for software testing, learning, and demos — not for real identification.

Are the generated CPFs valid and registered with the Brazilian tax authority?

The number is mathematically valid, meaning it passes check-digit verification because the modulo 11 calculation is correct. But it is fictitious, with no connection to real people and no registration with the Receita Federal. It exists to validate forms and business rules during development, and nothing more. Using a generated CPF in official registrations does not work and, under Brazilian law, may constitute fraud.

How does the generator set the state, and what does the 9th digit of the CPF mean?

The 9th digit of the CPF, just before the two check digits, corresponds to the fiscal region where the document was issued. São Paulo is 8, Rio Grande do Sul is 0, Paraná and Santa Catarina are 9, and so on. The state selector fixes that digit to generate numbers consistent with a specific region. Left on "All States", the digit is chosen at random.

When should I use the formatted CPF and when numbers only?

It depends on where the number will be used. Forms and screens that display the CPF to the user typically use the formatted version (999.999.999-99). Databases, APIs, and backend validations tend to store the raw number without special characters. The "Numbers Only" option handles this at generation time, with no need to strip the string afterward.

What is the difference between a fake, false, and random CPF?

In practice, all these terms describe the same tool: a utility that generates numbers following the CPF's mathematical rules without belonging to anyone. "Fake" and "false" are the most common searches, while some developers prefer "fictitious", "random", or "test CPF" as they sound less suggestive. The result and the purpose are the same in every case.

See also