1001Ferramentas
📋 Generators

Batch CPF Generator

Generate multiple valid CPFs at once (up to 1000) for software testing. With or without formatting.

What is batch CPF generation for?

If you work in QA or development, you've probably run into the same recurring need for lots of valid CPFs to fill a test database. This tool hands you up to 1,000 distinct CPFs in a moment, each carrying the correct check digits.

Keep in mind these numbers belong to no one. They're just mathematically valid combinations, so confine their use to test environments.

Everything runs in your browser. Once you're done, copy the list or save it as a .txt file.

Bulk CPF generation for developers and QA

A bulk CPF generator outputs dozens, hundreds or thousands of mathematically valid Cadastro de Pessoas Físicas numbers in one shot — useful when one CPF at a time is not enough. Typical scenarios include stress-testing a Brazilian-document validator, seeding a staging database with realistic-looking rows, exercising pagination and search limits on a customer listing, demonstrating the throughput of a parsing routine, or building fixtures for automated test suites that simulate dozens of distinct users.

Each number is produced with the standard modulo-11 algorithm: nine pseudo-random base digits, followed by two check digits computed with the descending weights 10→2 and 11→2. We do not repeat the full math here — see the /gerador-cpf page for a step-by-step walkthrough — but the output of this tool passes every standard validator (Faker, Bogus, factory_bot, dry-validation, and most front-end mask libraries).

Avoiding duplicates in large batches

When you request thousands of CPFs, naive random generation will eventually produce collisions. The Birthday Paradox kicks in earlier than people expect: for 100,000 random nine-digit roots, the probability of at least one duplicate is already around 0.5%. The standard fix is a Set (or a hash table) keyed by the eleven-digit string — push a candidate, check membership, retry on hit. This generator already de-duplicates inside the requested batch, but if you concatenate multiple batches you should keep your own seen-set across runs.

Statistical distribution

Because the first nine digits are sampled uniformly at random, each of the ten fiscal regions encoded by the ninth digit (DF/GO/MT/MS/TO, North, CE/MA/PI, PE/RN/PB/AL, BA/SE, MG, RJ/ES, SP, PR/SC, RS) appears with roughly equal probability. If your test suite depends on geographic distribution, do not rely on the generator alone — filter or seed by region.

Mock-data best practices

  • Never reuse real numbers from employees or customers — even in dev environments, an exposed log can leak PII.
  • Avoid trivial sequences like 111.111.111-11 — most production validators reject repeated-digit CPFs.
  • Pair each generated CPF with a fictitious name (Faker, Bogus) so it is obvious in screenshots that the data is synthetic.
  • Tag mock rows in the database (a boolean is_synthetic column or a _test prefix) so a future cleanup script can wipe them.

Worked example: paginating a 1,000-row listing

// Generate 1,000 CPFs, insert into staging DB
const cpfs = await fetch('/api/bulk-cpf?count=1000').then(r => r.json())
const rows = cpfs.map((cpf, i) => ({ id: i + 1, cpf, name: faker.person.fullName() }))
await db.insert('customers', rows)
// Now hit the listing endpoint and verify pagination
expect(await page.locator('tbody tr')).toHaveCount(25) // page size
await page.click('[data-testid="next-page"]')
// 40 pages total — exercise the upper bound

Legal limits

Generated CPFs satisfy the algorithm but are not registered with the Receita Federal. Using one in a real transaction, financial product, public benefit, NF-e issuance or any binding contract is identity fraud and a crime under Código Penal arts. 299 and 307 (falsidade ideológica and falsa identidade). The output of this tool is for unit tests, mock data, training environments and validator development only.

FAQ

Will the tool produce duplicates? Within a single batch, no — every number is checked against a Set before being added. Across separate batches the collision probability is extremely low for small counts but non-zero; keep your own seen-set if you concatenate runs.

Is there a maximum batch size? Yes, 1,000 CPFs per request. The limit keeps the browser responsive and avoids freezing on low-end devices. For higher volumes, run the tool multiple times or call the underlying algorithm directly from your fixture script.

Can I download the result as CSV? Yes — the Download button exports a plain-text file with one CPF per line, which imports cleanly into Excel, Google Sheets, psql \copy and most ETL tools.

Does anything leave my browser? No. Generation happens entirely client-side in JavaScript — the server never sees the numbers.

Related Tools

Generate many valid CPFs at once

When testing a system calls for lots of records, generating CPF after CPF is no way to go about it. Here you produce several in one shot, up to a thousand per run, all passing the check-digit calculation, yet belonging to no real person.

Set the quantity and say whether you want them with or without the dot-and-dash formatting, depending on what the target field asks for. It works well to populate development databases, run load tests or prepare staging data. And the usual reminder: fictitious data is for testing, never for fraud.

The numbers are all born in the browser, with no database lookup at all. Generate the whole list and take it over to your test environment in one go.