CPF Validator - Validate Brazilian Tax ID & Check State
ValidatorValidate Brazilian CPF numbers instantly and identify the issuing state
Enter with or without formatting (dots and dash)
Enter a CPF number above to validate
CPF Region Reference
The 9th digit of a CPF number indicates the region where it was issued. Use this reference to understand which Brazilian states correspond to each digit.
How CPF check digits are calculated (validation algorithm)
The last two digits of a CPF are check digits generated with the Modulo 11 algorithm used by Brazil's Receita Federal. Each digit is multiplied by a descending weight, the products are summed, and the remainder of dividing that sum by 11 sets the check digit: a remainder below 2 gives 0, otherwise it is 11 minus the remainder.
Worked example — enter a number above to see its own calculation: 529.982.247-25
Step 1 — First check digit (DV1)
Weights 10 → 2 applied to the first 9 digits
Step 2 — Second check digit (DV2)
Weights 11 → 2 applied to the first 10 digits (including DV1)
function isValidCPF(cpf) {
const d = cpf.replace(/\D/g, '');
if (d.length !== 11 || /^(\d)\1{10}$/.test(d)) return false;
const dv = (len, start) => {
let sum = 0;
for (let i = 0; i < len; i++) sum += +d[i] * (start - i);
const r = sum % 11;
return r < 2 ? 0 : 11 - r;
};
return dv(9, 10) === +d[9] && dv(10, 11) === +d[10];
}About this tool
About CPF Validator
CPF Validator verifies Brazilian CPF (Cadastro de Pessoas Físicas) numbers using the official Modulo 11 algorithm and identifies the issuing state based on the regional digit. This essential tool validates format compliance, checksum accuracy, and provides geographical information about CPF registration regions.
Validate CPF numbers with instant verification of format and checksum digits using the official Brazilian validation algorithm. The tool automatically identifies the issuing region and corresponding Brazilian states based on the 9th digit, providing comprehensive validation feedback with detailed technical information.
Perfect for form validation in Brazilian applications, data verification in financial systems, e-commerce platforms, government services, and any system requiring CPF validation. Essential for developers building applications that serve the Brazilian market or handle Brazilian citizen data.
Instant validation prevents data entry errors and ensures CPF number integrity before processing. Regional identification helps with geographical analysis and compliance verification, while complete privacy protection ensures sensitive data never leaves your device during validation.
Key Features
- Official Modulo 11 algorithm validation
- Automatic regional digit identification
- Brazilian state mapping and display
- Format validation (with or without formatting)
- Instant validation feedback with error messages
- Complete client-side privacy protection
FAQ
CPF Validator Frequently Asked Questions
How accurate is the CPF validation?
Our validator uses the official Modulo 11 algorithm employed by the Brazilian Federal Revenue Service. It checks format compliance and verifies both check digits with 100% accuracy. However, it doesn't verify if a CPF is registered in government databases.
Can I validate CPF numbers in bulk?
Currently, our tool validates one CPF at a time for privacy and security. Each validation happens instantly in your browser. For bulk validation needs, consider implementing the same client-side algorithm in your application using our open validation logic.
What does the regional digit tell me?
The 9th digit indicates the Brazilian region where the CPF was originally issued. While historically tied to geography, modern CPF issuance may not strictly follow regional patterns. The digit helps identify possible origin states but isn't definitive for recent registrations.
Why does my valid CPF show multiple states?
Many regional digits correspond to multiple states within the same geographical area. For example, digit '1' covers DF, GO, MS, MT, and TO (Central-West region). This reflects Brazil's administrative regional grouping for CPF issuance.
Can I use this for legal verification?
No. Our validator only checks mathematical validity and format. For legal purposes, identity verification, or official transactions, you must verify CPF registration status with the Federal Revenue Service (Receita Federal) through their official channels.
What is the CPF validation algorithm?
It is the Modulo 11 check-digit algorithm defined by Receita Federal. The first nine digits are each multiplied by weights 10 down to 2, the products are summed, and sum mod 11 gives a remainder. If the remainder is less than 2 the first check digit (DV1) is 0, otherwise it is 11 minus the remainder. The second check digit (DV2) repeats the process over the first ten digits using weights 11 down to 2. This page shows the full calculation for any CPF you enter.
How are the two CPF check digits calculated?
For DV1, multiply digits 1–9 by 10, 9, 8, 7, 6, 5, 4, 3, 2, sum the products, take the remainder of dividing by 11, and use 0 if it is below 2 or 11 minus the remainder otherwise. For DV2, append DV1 and multiply digits 1–10 by 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, then apply the same remainder rule. A CPF is valid when both computed digits match the last two digits.
CPF Validation Best Practices
- Always validate CPF on both client and server sides
- Strip formatting before database storage
- Display CPF with formatting for better readability
- Implement additional verification for high-value transactions
- Educate users about CPF format requirements
- Never store or log CPF numbers unnecessarily
Explore more
Related Tools
Other tools that might be useful for your workflow