TOOL · DEV
Validate and generate CPF and CNPJ
Check whether a Brazilian CPF or CNPJ is mathematically valid and generate test numbers for your software. All in your browser — nothing is looked up or sent anywhere.
Validation only checks the check-digit math. We never query the Brazilian tax authority — nothing you type leaves your browser.
Legitimate use only: generated numbers are valid only in the check-digit math, created at random for software testing. They belong to no one, do not exist in any registry and cannot be used for real sign-ups — using an ID that is not yours is fraud.
Processed in your browser — your files never leave your computer.
How it works
-
Pick validate or generate
On the validate tab, paste the number — dots optional. The tool detects whether it is a CPF or a CNPJ by its length.
-
Read the verdict instantly
The check digits are recalculated as you type, and the answer tells you whether it is valid, invalid and why.
-
Generate test numbers
On the generate tab, pick CPF or CNPJ, the amount (up to 50) and copy them one by one or all at once — with or without punctuation.
Frequently asked questions
Is it legal to use a CPF generator?
For software testing, yes. The numbers come from a random draw followed by the check-digit math — they are meant for validating forms and systems under development. Using an ID that is not yours to sign up for a real service is fraud, and then the problem is not the tool.
Does the generator create real CPFs?
No. It creates numbers that pass the check-digit math, nothing more. We never query the Brazilian tax authority, we have no idea whether the number exists, and it belongs to no one by design — it is math, not registration.
Does validating here confirm the CPF exists in the registry?
No. Validation only checks the check-digit math — a number can pass the math and never have been issued. Registry status can only be checked on the official Receita Federal website.
Is the number I type sent anywhere?
No. The whole calculation happens in your browser. You can even turn off Wi-Fi after the page loads — nothing is sent, stored or looked up.
Why does 111.111.111-11 show as invalid?
It would pass the check-digit math, but CPFs with all identical digits are never issued — so the tool rejects those cases on purpose.
What is the difference between the CPF and CNPJ math?
A CPF has 11 digits and uses modulo 11 with descending weights from 10 and 11. A CNPJ has 14 digits and uses the 5..2 and 6..2 weights. In both, the last two digits are the check digits — exactly what the tool computes.