Brazil CPF validator and generator (validar CPF)

Validate a CPF from Brazil (validar CPF): modulo 11 check digits, the reason a number fails, tax region from the 9th digit and a test number generator.

How CPF check digits are calculated in Brazil

In Brazil, the CPF has 11 digits: 9 base digits followed by 2 check digits computed with modulo 11. The first weights the first 9 digits by 10 down to 2, the second weights the first 10 digits by 11 down to 2; a remainder below 2 gives 0, otherwise the digit is 11 minus the remainder. The 9th digit shows the tax region where the CPF was registered.

The calculation

First check digit: add digits 1 to 9 multiplied by 10, 9, 8… 2 and take the remainder of the sum divided by 11; a remainder of 0 or 1 gives 0, otherwise the digit is 11 − remainder. The second digit works the same way on the first 10 digits (including the first check digit) with weights 11 down to 2.

Worked examples

  • 529.982.247-25: 5×10 + 2×9 + 9×8 + 9×7 + 8×6 + 2×5 + 2×4 + 4×3 + 7×2 = 295, remainder 9, first digit 2; then 347, remainder 6, second digit 5. Valid, 9th digit 7: region 7 (ES, RJ).
  • 529.982.247-26: invalid, the tool says 25 was expected.
  • 100.000.001-08: the first sum is 12, remainder 1, so the digit is 0; the second sum is 14, remainder 3, digit 8.

Tax regions (9th digit)

1: DF, GO, MS, MT, TO; 2: AC, AM, AP, PA, RO, RR; 3: CE, MA, PI; 4: AL, PB, PE, RN; 5: BA, SE; 6: MG; 7: ES, RJ; 8: SP; 9: PR, SC; 0: RS (region 10). The digit reflects the address at registration, not the current home.

Generator and limits

Repeated digits (111.111.111-11…) pass the arithmetic but are rejected because they are not issued. The generator produces fictitious numbers for testing a form; a valid number is not necessarily assigned and the tool checks no register.

Sources and dates: check digit rule and tax region table published by Brazil's Receita Federal (tax education leaflet "CPF"); calculations redone on the examples above (checked on 15/10/2026).

Frequently Asked Questions

How are the last two digits of a CPF calculated?

Multiply the first 9 digits by 10 down to 2, add them and take the remainder of the sum divided by 11: a remainder of 0 or 1 gives 0, otherwise the digit is 11 minus the remainder. Repeat on the first 10 digits with weights 11 down to 2 for the second digit. For 529.982.247 you get 2 then 5.

What does the 9th digit of a CPF mean?

It is the Receita Federal tax region where the CPF was registered: 8 for São Paulo, 7 for Rio de Janeiro and Espírito Santo, 0 for Rio Grande do Sul, for example. It reflects the address at registration, not the current home.

Why is 111.111.111-11 rejected when the arithmetic works?

The 10 runs of identical digits satisfy the formula but are not issued, and most forms reject them. The tool flags them as invalid with that reason.

Can I use a generated CPF?

Only to test software or a form. A generated number is arithmetically valid but may belong to a real person or to nobody; using it to identify yourself is fraud.

Is this tool really free?

Yes, all tools on Kristools are 100% free and accessible without registration.

Is my data protected?

Yes. All processing is performed directly and securely inside your browser. No personal data is sent to our servers.