Ontoom

CPF generator

Click generate and you’re done — a valid CPF for tests.

Generated CPF

Generating…

Important: synthetic numbers for testing. They do not correspond to real people.

CPF validator

On the same page — no need to open another tool.

Frequently asked questions

Need to check an existing number? CPF validator.

Valid CPF generator

A “valid” CPF in this tool means the check digits pass the official algorithm (mod 11). That is what most forms and validation libraries check in test environments — it does not guarantee the number is registered or active with the tax authority.

Masked CPF generator

The mask formats the result as 000.000.000-00. Use it when pasting into UI fields, docs, or demos where human readability matters. Enable “With punctuation” in the generator above.

Unmasked CPF generator

Without a mask you get only the 11 digits. Ideal for JSON payloads, DB seeds, API tests, and numeric comparison. Turn punctuation off and copy the clean value.

CPF generator for tests

Ideal for QA, staging, and fixtures: generate one or many CPFs, export, and clean up data at the end of the test cycle. Combine with the person generator when you need name, address, and documents together.

How to generate a valid CPF

  1. Choose whether you want punctuation (mask) and, optionally, a state (UF).
  2. Click Generate CPF — check digits are computed in the browser.
  3. Copy the result or use batch/export in the advanced options.
  4. To check a typed number, open the CPF validator.

How the algorithm works

A CPF has 11 digits: 9 base + 2 check digits. Each check digit is obtained by multiplying previous digits by weights, summing, applying mod 11, and treating remainder 10 or 11 as 0. Sequences with all identical digits (e.g. 111.111.111-11) are rejected even if mod 11 “closes”.

The ninth base digit historically indicates the tax region of issue (e.g. 8 for SP). Useful for regional demos, but it does not prove the document’s real origin.

What is a CPF?

Cadastro de Pessoas Físicas is Brazil’s individual tax identifier. In software, mathematical validation avoids junk in forms; checking official existence is a separate step, done via authorized integrations when needed.

Best practices

  • Use only in test and development environments.
  • Do not use generated numbers to open accounts or commit fraud.
  • Prefer local generation when you do not need to persist data.
  • Clean fixtures automatically after tests.

Frequently asked questions

Is the generated CPF real?
No. It is synthetic and only mathematically valid by check digits. It does not exist in the Receita Federal database just because it was generated here.
Can I use it in production?
Use generation in tests and staging. In production, validate the CPF provided by the user with the algorithm (or an official service, if business rules require it).
How do I validate a CPF?
Compute both check digits with mod 11 and reject sequences with all identical digits. On Ontoom, you can also use the dedicated validator.
Does the generator query Receita Federal?
No. Processing is local in the browser, with no official registry lookup.
Can I generate a CPF by state?
Yes. The UF option sets the 9th digit from the historical tax-region convention, useful for regional fixtures.
What is the difference between masked and unmasked CPF?
Masked format is 000.000.000-00 (human-readable). Unmasked is just the 11 digits, better for APIs, databases, and fixtures.

See also