How to generate and validate a CPF
Choose a state, punctuation, and a batch size from 1 to 50. Copy the batch or export JSON and CSV. To validate a test value, enter its eleven digits with or without punctuation; the browser recalculates both check digits without querying official records.
What is a fictional CPF used for?
Generated CPFs help developers test forms, input masks, validation rules, imports, APIs, and staging environments without using real personal data. They are also useful in automated test fixtures.
A mathematically valid CPF does not necessarily identify a person and must not be used for real registrations, fraud, or impersonation.
Check-digit example
A CPF contains nine base digits followed by two check digits. Base 529982247 produces 25 through two weighted modulo-11 steps, resulting in 529.982.247-25.
CPF generation by state
When a state is selected, the tool uses the digit associated with its Brazilian Federal Revenue fiscal region in the ninth position of the CPF base. Multiple states can share the same region digit.
Formatted and unformatted CPF
Use a value such as 529.982.247-25 to test masked fields. Disable punctuation to get the 11-digit representation commonly used in APIs, databases, and data files.
Official reference and related test data
The Brazilian Federal Revenue explains the fiscal-region digit in its official CPF material. Use the Brazilian Person Generator for complete fictional records or the CNPJ Generator and Validator for company identifiers.
Frequently asked questions
Does a generated CPF belong to a real person?
Not necessarily. The tool creates a fictional sequence with mathematically valid check digits without querying the Brazilian Federal Revenue database.
Can I use generated CPFs for testing?
Yes. They are intended for development, staging environments, form masks, validators, APIs, and test fixtures.
Can I generate a CPF without punctuation?
Yes. Disable punctuation to receive only the 11 digits.
Can I choose the CPF state?
Yes. The tool uses the fiscal-region digit associated with the selected state when building the CPF base.
Can I validate or export CPFs?
Yes. Validation checks the format and check digits, and generated batches can be copied or downloaded as JSON and CSV.
Are generated CPFs stored?
Only the latest 10 are kept in your browser local storage. Results are never sent to CosmoTools.