CPF Validator

Verify if CPF numbers are valid. Free tool for developers and testers.

Status

Waiting for validation

What is a CPF Validator?

Our CPF Validator is a free online tool that verifies if a CPF (Brazilian Tax ID) number is valid through the check digit algorithm.

The CPF (Cadastro de Pessoas Físicas) is the tax identification document used in Brazil. Each CPF has a mathematical structure that allows verification of its validity.

It's ideal for developers who need to test systems, validate forms, or create automated tests without using real people's data.

How does the CPF Validation Algorithm work?

The CPF has 11 digits, with the last two being check digits calculated from the first 9 using a specific mathematical algorithm.

The validation process works as follows:

  • Multiply each of the first 9 digits by a decreasing sequence starting at 10.
  • Add all results and calculate the remainder of division by 11.
  • If the remainder is less than 2, the first check digit is 0. Otherwise, it's 11 minus the remainder.
  • Repeat the process including the first check digit to calculate the second one.

This algorithm ensures the CPF was typed correctly, but doesn't verify if it's registered with the Federal Revenue.

What is a CPF Validator used for?

This tool is essential for various development and testing scenarios:

Form Development

Validate CPF input fields in web forms before submitting to the server.

Automated Testing

Create unit and integration tests for systems that process CPFs.

Data Cleaning

Verify and clean databases with invalid or poorly formatted CPFs.

Learning

Understand how the CPF validation algorithm works and implement it in your projects.