The CPF (Cadastro de Pessoas Físicas — Individual Taxpayer Registry) is Brazil’s national identification number, issued by the Receita Federal. Every Brazilian resident and many foreigners conducting financial transactions in Brazil hold one. The CPF appears on bank accounts, tax returns, property deeds, employment contracts, health insurance cards, and e-commerce checkouts — making it one of the most frequently validated strings in Brazilian software.
This tool recomputes both MOD-11 check digits from scratch, compares them to the digits you entered, shows you exactly which step failed (if any), decodes the fiscal region embedded in the 9th digit, and lets you step through the full arithmetic. Everything runs locally — your CPF never leaves your device.
Structure of a CPF
A CPF is always 11 digits, conventionally formatted as NNN.NNN.NNN-DD:
| Position | Digits | Meaning |
|---|---|---|
| d0 – d7 | First 8 | Base number |
| d8 | 9th digit | Fiscal region code |
| d9 | 10th digit | First check digit |
| d10 | 11th digit | Second check digit |
The dots and the dash are purely cosmetic separators. Internally the Receita Federal stores and processes the raw 11-digit string.
The MOD-11 algorithm — step by step
First check digit (d9)
- Take the 9 base digits (d0 through d8).
- Multiply each by a descending weight starting at 10:
d0×10 + d1×9 + … + d8×2. - Compute
sum mod 11. - If the remainder is 0 or 1, the check digit is 0. Otherwise the check digit is
11 − remainder.
Second check digit (d10)
- Take the same 9 base digits plus the first check digit computed above (d9).
- Multiply each by a descending weight starting at 11:
d0×11 + d1×10 + … + d8×3 + d9×2. - Compute
sum mod 11. - Same rule: remainder 0 or 1 → digit is 0; otherwise
11 − remainder.
The key design detail is that d9 itself feeds into the second sum. This creates a chain between the two check digits — if you flip a single digit anywhere in positions d0–d9, the mismatch will show up in d10 even if d9 happened not to change.
Worked example using the obviously-fake CPF 529.982.247-25
Base digits: 5 2 9 9 8 2 2 4 7
d9 calculation:
5×10 + 2×9 + 9×8 + 9×7 + 8×6 + 2×5 + 2×4 + 4×3 + 7×2
= 50 + 18 + 72 + 63 + 48 + 10 + 8 + 12 + 14
= 295
295 mod 11 = 9 → 11 − 9 = 2 ✓ matches the entered 2
d10 calculation (base digits + d9 = 2):
5×11 + 2×10 + 9×9 + 9×8 + 8×7 + 2×6 + 2×5 + 4×4 + 7×3 + 2×2
= 55 + 20 + 81 + 72 + 56 + 12 + 10 + 16 + 21 + 4
= 347
347 mod 11 = 6 → 11 − 6 = 5 ✓ matches the entered 5
Both digits match → 529.982.247-25 is a structurally valid CPF.
The fiscal region digit
The 9th digit (d8) is not random — it encodes which Receita Federal regional superintendency originally issued the CPF:
| d8 | Region |
|---|---|
| 1 | São Paulo (SP) |
| 2 | Minas Gerais (MG) |
| 3 | Rio de Janeiro / Espírito Santo (RJ / ES) |
| 4 | Rio Grande do Sul — modern series (RS) |
| 5 | Bahia / Sergipe (BA / SE) |
| 6 | Paraná / Santa Catarina (PR / SC) |
| 7 | Amazônia — AM, PA, AC, RR, AP, RO |
| 8 | Centro-Oeste / Brasília — GO, MT, MS, DF, TO |
| 9 | Nordeste — MA, PI, CE, RN, PB, PE, AL |
| 0 | Rio Grande do Sul — legacy series (RS) |
This digit is fixed at registration. Brazilians who move between states keep the same CPF, so a person with d8 = 3 living in Manaus still has a Rio de Janeiro / ES CPF — the digit reflects origin, not current location.
Privacy and limitations
Privacy: the entire calculation runs in JavaScript in your browser tab. No number you enter is transmitted, logged, or stored anywhere.
Limitations: structural validity is not the same as existence in the Receita Federal database. A CPF that passes this validator may be unregistered, suspended, cancelled, or belong to a deceased person. Only the Receita Federal public consultation confirms live registration status.