Brazil CPF Check Digit Validator & Calculator

Free tool to validate and calculate the check digits of Brazil's CPF (Cadastro de Pessoas Físicas) taxpayer registry number. Works with either 9 or 11 digits, automatically detecting which you've entered, and runs the two-round mod 11 calculation to confirm the check digits. Everything happens right in your browser.

Advertisement

What is the Brazil CPF Check Digit Validator?

This is a free online tool for validating and calculating the check digits of Brazil's 11-digit CPF taxpayer registry number. It runs a calculation called "mod 11" — multiplying the first nine digits by set weights, summing them, and dividing by 11 — twice in a row to derive the 10th and 11th check digits.

The tool automatically figures out which type of input you've given (9 or 11 digits), so there's no need to switch modes manually. If you enter a number that already includes check digits, it validates them; if you enter one without, it calculates and fills them in for you. Keep in mind this tool only confirms that the format is correct — it can't determine whether the number belongs to an actual person (for that, an ID document would be needed).

How to Use

  1. Enter the CPF You can paste it in with periods and hyphens already included.
  2. Check the type and result The detected type (with or without check digits) is shown along with the validation or calculation result.
  3. Review the repeated-pattern note If every digit is the same, a note explaining that it's a known invalid pattern will appear.
  4. Try another number Use the clear button to reset the input and check a different number.

Tips for getting more out of it

  • You can paste the number in with periods (.) and hyphens (-) still in place — they're stripped automatically before the calculation runs.
  • If you enter 9 digits without check digits, the tool works out the correct two check digits for you and shows the full 11-digit number.
  • Numbers made up of a single repeated digit, like 111.111.111-11, can sometimes produce a checksum that mathematically matches, but they're treated as a known invalid pattern since they're never actually issued.
  • This tool only checks whether the format (check digits) is correct — it can't confirm whether the number was actually issued to a real person. For that, you'd need an ID document or a lookup with Receita Federal (Brazil's federal revenue agency).
  • A CPF is sensitive personal information, similar to a Japanese My Number or a US Social Security number. If you're checking a number someone else gave you, please clear it from the field right after and avoid leaving it visible on screen.

Use Cases

Catching input errors on e-commerce and payment forms

Confirm that a CPF entered on a Brazil-facing checkout or payment form matches its check digits before it's submitted, catching transcription mistakes early.

Catching input errors in HR and payroll

Verify the check digits of a CPF received from a new hire or an employee posted to Brazil before entering it into an internal system.

Reference for designing validation logic

Use it as a reference to confirm the expected behavior of CPF validation logic (the two-round mod 11 calculation) you're implementing in a Brazil-facing form or sign-up system.

Digitizing older paperwork

When entering CPFs from paper documents into a database, use the check digits to catch any OCR misreads.

Advertisement

Glossary

CPF (Individual Taxpayer Registry)
An 11-digit number assigned to individuals in Brazil. Introduced in 1965, it's used for far more than tax filing today — from opening a bank account to everyday identity verification.
Mod 11
A calculation method that multiplies each digit by a weight, sums the results, and derives the check digit from the remainder after dividing by 11. In the CPF, it's applied twice, once for each of the two check digits.
Check digit
The two verification digits at the end of a CPF, calculated from a formula to help catch input mistakes and typos.
Repeated-digit pattern
A number made up of a single digit repeated throughout, like 111.111.111-11. Even though the checksum can sometimes mathematically match, it's a well-known pattern that's never actually issued.
Receita Federal
Brazil's federal revenue agency, responsible for issuing and managing the CPF as well as overseeing tax administration.

Frequently Asked Questions

It's the pair of verification digits in the 10th and 11th positions of a CPF, derived from the first nine digits through two rounds of the mod 11 calculation. It's designed to catch transcription and typing errors — it doesn't guarantee that the number itself was actually issued to someone.

It's most likely a transcription or OCR error, so start by double-checking the original document. If it still doesn't match, ask the person for their CPF card or ID, or, if needed, verify it on the Receita Federal (Brazil's federal revenue agency) website.

Numbers made up of a single repeated digit can sometimes produce a checksum that mathematically matches, but they're a well-known dummy or test pattern that's never actually issued as a real CPF. Most validation systems explicitly flag this repeating pattern as invalid.

No, it can't. This tool only checks whether the check digit calculation is correct — it can't verify whether the number was genuinely issued by Receita Federal. If you need to confirm a number is real, ask for an ID document instead.

No. The entire calculation runs locally in your browser's JavaScript, with no data sent to any external server. That said, since it's sensitive personal information, we'd still recommend clearing it from the field once you're done.
Tool-kun

Side Note — the simple formula behind a number used by 200 million people

The CPF (Cadastro de Pessoas Físicas) is Brazil's individual taxpayer registry number, introduced back in 1965. Today it's assigned to nearly every one of Brazil's more than 200 million citizens and residents. It started out purely as a tax ID, but these days it's become an everyday piece of infrastructure — used to open a bank account, sign up for a phone plan, shop online, or submit paperwork for a new job.

The CPF's check digits are worked out by running a calculation called mod 11 twice: each of the first nine digits is multiplied by a weight, the results are summed, and the remainder after dividing by 11 gives the check digit. Because this catches most single-digit typos and adjacent-digit swaps, it's widely used by banks and online stores to catch input errors in real time as someone fills out a form.

One quirky detail is that numbers made up of a single repeated digit, like 111.111.111-11, sometimes produce a checksum that happens to match under this formula. Because sequences like these are so often used as placeholder or sample data in mailings and paperwork across Brazil, the convention is simply to treat any number with all identical digits as invalid outright. Most real-world CPF issuing systems and validation libraries explicitly reject this repeating pattern for exactly that reason.

Advertisement