CPF Generator and Checksum Validator – Free

This CPF generator creates Brazilian CPF numbers with correct check digits for test data, and it can also verify the checksum of a number you paste. No registry is consulted.

How to use the CPF generator tool

  1. To check a number, leave Operation on Validate checksum and type the 11 digits into Brazilian CPF, with or without dots and the hyphen.
  2. To create test data, set Operation to Generate test numbers and enter a quantity from 1 to 50 in Test numbers to generate.
  3. Select Process number to run the operation you picked.
  4. Read the verdict or the list of generated CPFs in the Result box, one number per line.
  5. Select Copy to put the result on your clipboard.

How CPF check digits are calculated

A CPF (Cadastro de Pessoas Físicas) is the 11-digit taxpayer number that Brazil's Receita Federal assigns to individuals. The first nine digits are the base number and the last two are check digits, usually written as 000.000.000-00. The ninth digit records the fiscal region where the number was issued.

Both check digits use a weighted sum modulo 11. For the first, multiply the nine base digits by the weights 10 down to 2 and add the products. If the sum leaves a remainder below 2 when divided by 11, the digit is 0. Otherwise it is 11 minus the remainder. The second digit repeats the process over ten digits, the base plus the first check digit, with the weights 11 down to 2.

Worked example: 529.982.247-25

Take the base 529982247. With the weights 10 to 2 the products add up to 295. Dividing 295 by 11 leaves 9, so the first check digit is 11 - 9 = 2. Append it and weight the ten digits 5299822472 with 11 to 2: the sum is 347, the remainder is 6 and the second check digit is 11 - 6 = 5. The full number is 529.982.247-25.

5*10 + 2*9 + 9*8 + 9*7 + 8*6 + 2*5 + 2*4 + 4*3 + 7*2 = 295
295 mod 11 = 9   ->  11 - 9 = 2
5*11 + 2*10 + 9*9 + 9*8 + 8*7 + 2*6 + 2*5 + 4*4 + 7*3 + 2*2 = 347
347 mod 11 = 6   ->  11 - 6 = 5

Input:  529.982.247-25
Result: Checksum valid. Assignment status is unknown.

What the validator accepts and rejects

Validation removes spaces, dots, slashes and hyphens, then expects exactly 11 digits. The possible outcomes are listed here.

  • A number whose last two digits match the calculation returns Checksum valid. Assignment status is unknown.
  • A number with wrong check digits returns Invalid Brazilian CPF number.
  • Repeated-digit numbers such as 111.111.111-11 are rejected even though their arithmetic is consistent.
  • Any other length, or a letter anywhere in the field such as a pasted CPF: label, stops with Enter 11 digits.

How the CPF generator builds test numbers

In generate mode the tool draws nine random digits with the browser's crypto.getRandomValues function, discards a draw in which all nine digits are equal, and appends the two calculated check digits. Output is plain digits without punctuation, one CPF per line, and an empty quantity yields a single number. The Brazilian CPF field is ignored in this mode.

These numbers are meant for filling forms in staging systems, seeding databases and writing unit tests for validation code. They are random, so one of them can coincide with a number that belongs to a real person. Do not use generated values to sign up for services.

Frequently asked questions

Are generated CPF numbers real?

They are random base digits with mathematically correct check digits. The tool does not consult Receita Federal, so it cannot tell whether a number has been issued. A generated value may match a real CPF by chance, which is why it should only appear in test environments.

Does a valid checksum mean the CPF exists?

No. The checksum only proves the 11 digits are internally consistent, which catches typing mistakes. Whether the number is registered, regular or suspended is known only to Receita Federal. The result text adds Assignment status is unknown for that reason.

Can I paste a CPF with dots and a hyphen?

Yes. Dots, hyphens, slashes and spaces are stripped before the check, so 529.982.247-25 and 52998224725 give the same answer.

Why is 000.000.000-00 reported as invalid?

The validator refuses any CPF made of one repeated digit. Those values satisfy the modulo 11 formula, but they are not issued to anyone and Brazilian systems commonly block them, so this tool treats them as invalid too.

Is the CPF I type sent anywhere?

No. The calculation is a few lines of JavaScript that run inside the page. The number you validate and the numbers you generate stay in your browser tab.

Related tools