Skip to content

CPF generator and validator

Generate valid-format CPF numbers for testing, by fiscal region, or check whether a CPF's two check digits are right; everything runs in your browser.

Document

CPFCadastro de Pessoas Físicas

Individual taxpayer number · written like 123.456.789-09

Where the rules come from

Options

Up to 10,000 at a time

Valid format only · belongs to no one · for testing

Pick the options and press Generate. The numbers pass every rule this page checks, so they suit forms, fixtures and QA.

Receita Federal publishes no test range for CPF, so by chance a random number can equal one already issued: use them only in test systems. Numbers made of one repeated digit are never generated.
Runs in your browser · no uploadHow it works

How to use CPF generator

  1. 1

    Set how many

    The page opens on the CPF generator. Type a count or pick 1, 10, 100, 1,000 or 10,000.

  2. 2

    Fix the fiscal region if you need one

    Leave Any region, or set the ninth digit, for example 8 for São Paulo or 7 for Rio de Janeiro and Espírito Santo.

  3. 3

    Copy or download

    Copy the list with or without dots and hyphen, or download TXT, CSV or JSON; the CSV and JSON include each number's region.

  4. 4

    Check CPFs that were rejected

    On the Check tab paste the CPFs a form refused: each line says which check digits were expected instead.

Limits and Pro

Free: up to 10,000 CPFs per batch and 10,000 lines per check, with or without punctuation; anything over 500 runs in a background worker.

Pro takes the ads away; the generator has no caps to lift. See Pro

About CPF generator

Brazilian checkouts, payroll systems and CRM imports all ask for a CPF, and they refuse one whose check digits don't add up. When you are building or testing such a system you need numbers that get past that gate without belonging to anyone, and when a real customer's CPF is rejected you need to know which digit is wrong.

A CPF has eleven digits. The first nine are the registration number and the last two are check digits: the first is the remainder rule mod 11 applied with weights 10 down to 2, the second does the same with weights 11 down to 2 over the first nine digits plus the first check digit. The ninth digit records the fiscal region where the CPF was first registered, from 0 for Rio Grande do Sul to 9 for Paraná and Santa Catarina, which says nothing about where the person lives today.

This page generates up to 10,000 CPFs per batch, optionally all from one fiscal region, with or without the dots and hyphen. Numbers made of one repeated digit, such as 111.111.111-11, are skipped because they satisfy the arithmetic but are never issued. The Check tab accepts a whole column pasted from a spreadsheet and reports each line separately.

What it cannot do is tell you whether a CPF is active, suspended or cancelled at the Receita Federal: that status lives only in the Receita's own systems, which the page never contacts.

Privacy

Every CPF is generated and checked by code running in this page. No number is sent to the Receita Federal or any other server, and the list you generate disappears when you leave or reload the page.

CPF generator: frequently asked questions

Is it legal to generate CPF numbers?
Producing numbers that satisfy the CPF check digits is a routine part of testing Brazilian software, and these are labelled as test data that belongs to no one. What is not acceptable is using any CPF that isn't yours, generated or real, to open an account, buy something or deal with a government office: that is fraud.
How are the two CPF check digits calculated?
Multiply the first nine digits by 10, 9, 8 and so on down to 2 and add the results; a remainder mod 11 below 2 gives 0, otherwise 11 minus the remainder. For 123.456.789 the sum is 210, remainder 1, so the first digit is 0. Repeat with weights 11 to 2 over ten digits: 255, remainder 2, second digit 9, giving 123.456.789-09.
What does the ninth digit of a CPF mean?
It is the fiscal region of the Receita Federal where the CPF was first issued: 0 Rio Grande do Sul, 1 the Federal District, Goiás, both Mato Grossos and Tocantins, 2 most of the North, 3 Ceará, Maranhão and Piauí, 4 Alagoas to Rio Grande do Norte, 5 Bahia and Sergipe, 6 Minas Gerais, 7 Rio and Espírito Santo, 8 São Paulo, 9 Paraná and Santa Catarina.
Can this page tell me whether a CPF is active?
No. The registration status (regular, suspended, cancelled or pending) can only be read from the Receita Federal's own consultation, which also asks for the holder's birth date. This page only applies the published arithmetic, so a typo that happens to land on another valid combination will pass here too.
Why is 111.111.111-11 reported as invalid?
Ten CPFs made of a single repeated digit, from 000.000.000-00 to 999.999.999-99, happen to satisfy both check digits, yet none of them is ever assigned to a person. Most validators reject them for that reason, so the generator never produces one and the checker flags them even though the arithmetic works.

Other tasks with this tool

All developer tools