Free CPF and CNPJ Validator
Check the check digits of a Brazilian CPF or CNPJ, including the new alphanumeric CNPJ from July 2026, and format it with the usual mask. Paste a whole column to check them all and download a CSV.
Paste a CPF or CNPJ (or a whole column, one per line). The check digits are recalculated on this page, including the alphanumeric CNPJ issued from July 2026.
This checks the arithmetic only. It does not consult the Receita Federal, so it cannot say whether a CPF is regular or a company is active.
🔒 Checked in this browser. Nothing you paste is sent, stored or put in the address bar.
How It Works
CPF and CNPJ numbers end in two check digits that are calculated from the other digits. This page recalculates them in your browser with the Receita Federal's weights, including the alphanumeric CNPJ rule where each character counts as its ASCII code minus 48, and compares them with the digits you typed.
- 1Paste the numberType or paste a CPF or CNPJ, with or without dots, slash and dash. For several, put one per line.
- 2Choose the type if neededAuto tells them apart by length. Pick CPF or CNPJ to force one.
- 3Read the resultA valid number is shown with its mask and, for a CPF, the fiscal region; a CNPJ shows head office or branch. An invalid one shows which check digits it should have had.
- 4Copy or downloadCopy the number with or without the mask, or for a list, download the results as CSV.
Your numbers are checked in this browser. Nothing is sent, stored or put in the address bar.
Guide
Worked example
Paste 529.982.247-25 with "Type" on "Auto". The tool recognizes a CPF, shows "Valid CPF", the masked number and the line "Fiscal region (9th digit 7): ES, RJ". The first check digit comes out as 2 and the second as 5, so 25 is correct. Paste 11.222.333/0001-81 and you get "Valid CNPJ" and "Head office (matriz, 0001)". "Try a sample" loads four numbers, including the alphanumeric CNPJ 12.ABC.345/01DE-35, and reports "3 of 4 valid". The last one, 111.444.777-36, is rejected with "The check digits do not match. For these first digits they would have to be 35."
Which settings to use, and the limits
- Know what a pass means. The tool recalculates the two check digits, so it catches typos and invented numbers. It does not look anything up, so it cannot tell you whether a CPF is regular, whether a company is active, or whose number it is. Nothing you paste is sent, stored or put in the address bar.
- Leave Type on Auto, or force one. Under "Type", "Auto" reads 9 to 11 digits as a CPF and 12 to 14 characters as a CNPJ. Choose "CPF" or "CNPJ" to force the kind; a number of the wrong length then fails with a length message. Dots, dashes, slashes and spaces inside a number are ignored, and full-width digits are converted.
- Letters in a CNPJ are fine. From July 2026 the Receita Federal issues CNPJs whose first 12 characters can be letters A to Z as well as digits; the last two stay digits. The tool counts each character as its ASCII code minus 48 (A is 17, Z is 42), turns lower case into upper case, and adds a note that older systems may not accept letters yet.
- Dropped leading zeros come back. Spreadsheets often strip leading zeros. An entry of only digits with 9 or 10 digits is padded to 11 and checked as a CPF, and one with 12 or 13 digits is padded to 14 and checked as a CNPJ. So 1234567890 is read as 012.345.678-90 and passes. The formatted number in the result shows exactly what was checked.
- Check a whole column. Paste one number per line; commas, semicolons and tabs also separate entries. Up to 5,000 are checked, and the table shows each formatted number, its type and the result. "Download CSV" uses semicolons so Excel with Brazilian settings opens it in columns, and has the columns input, type, formatted, valid, problem and detail. "Copy valid numbers" copies only the good ones, with the mask, one per line.
- Use the extra details and the copy buttons. A valid CPF shows the fiscal region given by its 9th digit, for example 7 gives ES and RJ and 8 gives SP. A valid CNPJ shows its branch number: "Head office (matriz, 0001)" or "Branch (filial) number 0002". "Copy with mask" gives the punctuated form, such as 529.982.247-25, and "Copy characters only" gives 52998224725, for fields that want no punctuation.
Common problems and how to fix them
- It says "It has 25 characters. A CPF has 11 digits and a CNPJ has 14 characters." (with your own count).
- Either digits are missing or extra, or two numbers share one line. A space does not separate entries, so "529.982.247-25 11.222.333/0001-81" is read as one long number of 25 characters. Put each number on its own line, or separate them with commas or semicolons.
- It says "The check digits do not match. For these first digits they would have to be 35." (with your own digits).
- The first 9 characters of a CPF, or the first 12 of a CNPJ, produce check digits that differ from the last two you typed. The message shows the pair they would need. The tool cannot tell whether the last two digits are wrong or an earlier digit is, so compare the number with the document it came from. Swapped neighbouring digits are a common cause.
- It says "All the digits are the same. Such numbers pass the arithmetic but are never issued."
- Numbers like 111.111.111-11 or 00.000.000/0000-00 satisfy the check-digit formula, so the tool rejects them on purpose: the message says they are never issued. Use the real number.
- It says "It contains characters that cannot appear here. A CPF has digits only; a CNPJ can have letters only in its first 12 characters."
- Look for a letter in the last two characters of a CNPJ, or a stray symbol such as @ picked up in a copy and paste. A letter inside a CPF is reported this way only when "Type" is set to "CPF"; in "Auto" the number is no longer 9 to 11 digits, so it usually shows up as a length message instead. A letter O typed in place of the digit 0 is an easy mistake to make.
- A number I know is right shows "Invalid CPF" or "Invalid CNPJ".
- Check the "Type" buttons. If "CPF" is selected and you paste a CNPJ, or the other way round, the number fails with a length message such as "It has 14 characters. A CPF has 11 digits and a CNPJ has 14 characters." Set "Type" back to "Auto", which picks the kind from the length.
How it compares
Official Receita Federal services can tell you whether a CPF is regular or a CNPJ is active; this tool cannot, because it only checks the formula. So a number that passes here is plausible, not confirmed, and a made-up number can pass. What it does well is catch typos and malformed numbers instantly, for a whole column at once, without sending anything anywhere. A validator written only for the older all-digit CNPJ would reject the new letter-based numbers; this one accepts both. It checks numbers you already have and does not generate them.
Related Tools
IBAN Checker
Check an IBAN's country, length and check digits, plus the national check digits for Spain, France, Belgium, Italy, Portugal and Norway. Iranian Sheba and Turkish IBANs show the bank. Checks a whole list at once.
India Income Tax & Take-Home Calculator
Estimate your India income tax and monthly take-home salary for FY 2026-27 or 2025-26 under both the New and Old regimes, with a side-by-side comparison showing which one saves you more.
Chinese ID Number Checker (身份证号码校验)
Check a Chinese resident ID number's format and check digit and read the birth date, sex and province it encodes. Upgrades old 15-digit numbers to 18, and checks Taiwan and Hong Kong ID numbers. One number or a whole list.