CPF Generator & Validator
Validate an existing CPF's two check digits, or generate a random CPF with valid check digits for software testing — both use Brazil's official mod-11 algorithm.
This checks mathematical validity only — that the two check digits match the mod-11 formula. It cannot confirm the CPF was actually issued, belongs to a real person, or is currently active. For that, use the official Receita Federal CPF lookup (Consulta CPF).
Generate a test CPF
Generated numbers are random test data with mathematically valid check digits — they do not belong to, or identify, any real person. Use them only for software testing and form/QA purposes, such as testing a signup form's CPF field. Using a generated CPF to impersonate someone or commit fraud is illegal in Brazil.
How the CPF check digits are calculated
A CPF has 9 base digits plus 2 check digits. The first check digit multiplies each of the 9 base digits by a descending weight from 10 to 2, sums the products, takes that sum times 10 modulo 11, and maps a result of 10 or 11 to 0. The second check digit repeats the same process on all 10 digits (the 9 base digits plus the first check digit), using weights from 11 down to 2.
Sequences that repeat a single digit 11 times (000.000.000-00, 111.111.111-11, and so on) mathematically satisfy this formula but are never issued by Receita Federal, so this tool flags them as invalid even though the checksum passes — the same rule used by Brazil's Receita Federal and by other CPF validators.
How do I calculate a CPF's two check digits?
Multiply the 9 base digits by descending weights from 10 to 2, sum the products, multiply by 10, and take the remainder modulo 11 (mapping 10 or 11 to 0) to get the first check digit; then repeat the same process on all 10 digits (base plus first check digit) with weights from 11 to 2 to get the second. Example: base 111.444.777 produces check digits 3 and 5, giving 111.444.777-35.
Steps to calculate or validate a CPF
- Remove any dots and hyphen, keeping only the digits.
- For the first check digit, multiply the 1st base digit by 10, the 2nd by 9, and so on down to the 9th digit by 2; add all 9 products together.
- Multiply that sum by 10, divide by 11, and keep the remainder; if the remainder is 10 or 11, use 0 instead — this is the first check digit.
- For the second check digit, repeat the same weighted-sum process across all 10 digits (the 9 base digits plus the first check digit just computed), using weights 11 down to 2.
- If a full 11-digit CPF was entered, compare both computed digits to the two digits actually entered to determine validity; if only 9 digits were entered, display the two computed digits as the answer.
Formula
- d1..d9 = the 9 base digits of the CPF, in order
- DV1, DV2 = the first and second check digits, computed one after the other
- weight = the multiplier for each position, descending by 1 for each digit to the right
Quick CPF answers
How is a CPF's first check digit calculated?
Multiply each of the 9 base digits by weights from 10 down to 2 (in order), sum them, multiply by 10, and take the remainder mod 11; if the result is 10, the digit becomes 0. Example: 111.444.777 -> first check digit = 3.
How is the second check digit calculated?
The same method applied to all 10 digits (the 9 base digits plus the first check digit), with weights from 11 down to 2. Example: 111.444.777-3 -> second check digit = 5, giving the full CPF 111.444.777-35.
Is 111.444.777-35 a valid CPF?
Yes -- mathematically valid, confirmed by recomputing the algorithm.
Are repeated-digit numbers like 111.111.111-11 ever valid?
No -- even if the check-digit math happens to work out, this tool explicitly rejects any CPF where all 11 digits are identical, since real CPFs are never issued as all-repeated sequences.
What weight ranges are used for each check digit?
First digit: weights 10 down to 2 (9 multipliers for the 9 base digits). Second digit: weights 11 down to 2 (10 multipliers, including the first check digit).
Can the CPF checksum remainder be 10?
Yes -- when (sum x 10) mod 11 equals 10, the tool sets the digit to 0, since a check digit must be a single digit from 0 to 9.
How many digits does a full formatted CPF have?
11 digits total, formatted as XXX.XXX.XXX-DD (9 base digits + 2 check digits).
If I only enter the 9 base digits, what does this tool do?
It computes and displays both check digits directly, without you needing to enter or guess them.
Example CPF numbers and their check digits
| Base (9 digits) | DV1 | DV2 | Formatted |
|---|---|---|---|
| 111444777 | 3 | 5 | 111.444.777-35 |
| 104332181 | 0 | 0 | 104.332.181-00 |
| 960013389 | 1 | 4 | 960.013.389-14 |
| 083863794 | 9 | 9 | 083.863.794-99 |
| 123456789 | 0 | 9 (invalid check) | 123.456.789-09 |
Frequently asked questions
Why does 111.444.777-35 keep showing up as a valid test CPF?
It's a widely used example number in tutorials and QA test suites because it is easy to remember and mathematically valid, not because it has any special status with Receita Federal — it works purely because its check digits satisfy the mod-11 formula, exactly like any other correctly generated CPF.
Why does this tool reject 111.111.111-11 as invalid even though the math checks out?
Sequences that repeat a single digit 11 times happen to satisfy the mod-11 formula by mathematical coincidence, but Receita Federal's issuance rules exclude them entirely — no real CPF has ever been issued with all repeated digits, so validators, including this one, treat them as invalid despite the checksum passing.
Is it legal to use a randomly generated CPF?
Yes, for legitimate purposes such as testing software forms, database seeding, or QA automation, since a randomly generated number with valid check digits does not identify any real person. It becomes illegal the moment it is used to impersonate someone, open an account fraudulently, or otherwise deceive a person or system into believing it belongs to a real individual.
Can this tool tell me who a CPF belongs to?
No, and it never will — this tool only performs the public mod-11 checksum calculation locally in your browser. Looking up who a CPF is registered to (if anyone) requires the person's authorization and access to Receita Federal's restricted systems; there is no legitimate free public lookup for that information.
This tool implements the public mod-11 check-digit algorithm only, entirely in your browser; it does not verify that a CPF was actually issued, is currently active, or belongs to a real taxpayer, and it does not connect to any government database. Use Receita Federal's official Consulta CPF service for real identity or status verification.
Sources: Receita Federal — Consulta CPF
Privacy and safety
- Runs in your browser — Everything you type is calculated on your own device. Your inputs are never sent to a utilduck server.
- Encrypted connection — Pages are served over HTTPS, so nobody on the network can read what you load.
- Not shared with third parties — Your inputs are not passed to analytics or advertising services.
- Nothing is stored — Results are not saved to any server, and there is no account to create.
Last updated: 2026-08-17