🇧🇷 CPF & CNPJ Validator and Generator
Check Brazilian CPF (individuals) and CNPJ (companies) numbers, including the new alphanumeric CNPJ, and generate valid test numbers for your forms. Everything runs locally in your browser.
The type is detected automatically (11 digits = CPF, 14 characters = CNPJ). Dots, slashes and dashes are optional.
ℹ️ Validation checks the format and check digits only. It does not tell you whether a number is registered or active at the Receita Federal. Generated numbers are for testing software and must never be used to identify a person or a company.
Support TinyToolWeb
Help us keep these tools free and ad-free!
About the CPF & CNPJ Validator
The CPF (Cadastro de Pessoas Físicas) identifies individual taxpayers in Brazil, and the CNPJ (Cadastro Nacional da Pessoa Jurídica) identifies companies and organisations. Both end with two check digits calculated with a modulo 11 algorithm, which this tool verifies instantly.
Since July 2026, the Receita Federal issues alphanumeric CNPJs: the first 12 characters can contain letters, while the last two remain numeric check digits. This tool supports both the classic and the new format.
Key Features
- Automatic detection: the tool recognises a CPF or a CNPJ from its length.
- Alphanumeric CNPJ: letters are converted with the official rule (ASCII code minus 48).
- Detailed result: formatted number, check digits, CPF fiscal region, CNPJ root and establishment.
- Test generator: up to 50 valid CPF or CNPJ numbers at once, with or without punctuation.
How to Use the Tool
- Step 1: Paste a CPF or CNPJ, with or without punctuation.
- Step 2: Click Validate to check the check digits.
- Step 3: To get test data, choose a type and a quantity, then click Generate.
- Step 4: Copy a single number or the whole list with the 📋 buttons.
Formats
| Number | Format | Example |
|---|---|---|
| CPF | 000.000.000-00 | 529.982.247-25 |
| CNPJ (numeric) | 00.000.000/0000-00 | 11.222.333/0001-81 |
| CNPJ (alphanumeric) | AA.AAA.AAA/AAAA-00 | 12.ABC.345/01DE-35 |
Common Use Cases
- Validating Brazilian customer data in an e-commerce checkout or a CRM
- Checking the registrant document required for a .br domain name
- Generating test data for QA and automated tests
- Preparing a system for the alphanumeric CNPJ transition
Tips & Best Practices
- Store CNPJs as text, not numbers: alphanumeric CNPJs and leading zeros break numeric columns.
- Sequences such as 000.000.000-00 pass the modulo 11 test but are rejected, as by the Receita Federal.
- The 9th digit of a CPF indicates the fiscal region where it was issued, not the holder's current state.
Privacy & Security
Everything runs locally in your browser. Numbers you check are never sent to a server, stored or logged, and test numbers are generated with the browser's cryptographic random generator.