Diário Prático
Brazilian Tax ID · Modulo 11 Algorithm

Brazil CPF
Generator & Validator

Generate mathematically valid Brazilian CPF numbers for software testing, or validate existing ones using the official Modulo 11 algorithm.

⚡ Algoritmo Módulo 11: Instrução Normativa RFB 1.548/2015
🔢Modulo 11 Algorithm🧪Testing Only🔒100% Offline
CPF: Cadastro de Pessoas Físicas
100% Client-side

Algoritmo de validação do CPF: como funciona o Módulo 11?

O CPF (Cadastro de Pessoas Físicas) é administrado pela Receita Federal do Brasil (IN RFB 1.548/2015). O número tem 11 dígitos: 9 dígitos base + 2 dígitos verificadores calculados pelo algoritmo Módulo 11.

Como funciona a validação Módulo 11

  1. Multiplique os 9 primeiros dígitos pelos pesos 10, 9, 8 ... 2 e some os produtos.
  2. O 1º dígito verificador = resto da divisão por 11. Se resto < 2, dígito = 0; senão, dígito = 11 − resto.
  3. Repita com os 10 primeiros dígitos (incluindo o 1º verificador) com pesos 11, 10 ... 2 para o 2º dígito.
  4. CPFs com todos os dígitos iguais (ex: 111.111.111-11) são matematicamente inválidos.

Uso ético e legal

CPFs gerados aqui são matematicamente válidos mas fictícios. Uso exclusivo para testes de software, desenvolvimento de sistemas e fins educacionais. O uso indevido de CPF de terceiros é crime previsto no Art. 307 do Código Penal (falsa identidade) e sujeito à LGPD (Lei 13.709/2018).

Fonte: CPF: Receita Federal | LGPD: Lei 13.709/2018.

Orientações: Gerador e Validador de CPF

Gere e valide números de CPF brasileiros com o algoritmo oficial Módulo 11, para testes de software e fins educacionais.

Esta ferramenta do Diário Prático trata de e Validador de CPF. Os cálculos rodam no navegador, são gratuitos e não substituem orientação profissional. Revise premissas (tabelas oficiais, vigência e limites) antes de usar o número em decisões financeiras, trabalhistas ou de saúde.

Quando houver dúvida sobre legislação ou tributos, priorize Receita Federal, INSS, Banco Central, CLT e a documentação do seu empregador ou contador.

Premissas e limites do resultado

Resultados dependem dos valores informados e das regras vigentes na data do cálculo. Atualizações de alíquotas ou índices podem alterar o número em competências futuras.

⚠️ Disclaimer: For Testing Purposes Only

This tool generates mathematically valid CPF numbers using the official Modulo 11 algorithm. These numbers are not real documents and are not associated with any person. They are intended exclusively for software testing, development, and educational purposes. Using generated numbers to impersonate a real person or commit fraud is illegal under Brazilian law (Penal Code, Art. 299 and Art. 307).

How the CPF Modulo 11 Algorithm Works

1

Base Digits

The first 9 digits are the base number. The 9th digit indicates the fiscal region where the CPF was originally issued.

2

1st Check Digit

Multiply each of the 9 digits by weights 10 through 2, sum them, divide by 11. If remainder < 2, digit = 0; else digit = 11 − remainder.

3

2nd Check Digit

Repeat with all 10 digits using weights 11 through 2. Same rule: remainder < 2 → 0, otherwise 11 − remainder.

Example: Validating 529.982.247-25

Digits: 5 2 9 9 8 2 2 4 7 2 5

1st check: (5×10 + 2×9 + 9×8 + 9×7 + 8×6 + 2×5 + 2×4 + 4×3 + 7×2) = 295 → 295 mod 11 = 9 → 11 − 9 = 2 ✓

2nd check: (5×11 + 2×10 + 9×9 + 9×8 + 8×7 + 2×6 + 2×5 + 4×4 + 7×3 + 2×2) = 346 → 346 mod 11 = 6 → 11 − 6 = 5 ✓

CPF 9th Digit: Fiscal Region Map

The 9th digit of a CPF indicates the fiscal region where it was originally registered.

DigitStates / Region
0Rio Grande do Sul
1Distrito Federal, Goiás, Mato Grosso, Mato Grosso do Sul, Tocantins
2Amazonas, Pará, Roraima, Amapá, Acre, Rondônia
3Ceará, Maranhão, Piauí
4Paraíba, Pernambuco, Alagoas, Rio Grande do Norte
5Bahia, Sergipe
6Minas Gerais
7Rio de Janeiro, Espírito Santo
8São Paulo
9Paraná, Santa Catarina

Why Do Foreigners Need a CPF in Brazil?

Even if you're visiting Brazil for a short trip, you'll quickly discover that a CPF number has become practically essential for everyday life. Here's what requires one:

✈️

Domestic Flights

GOL, LATAM, and Azul require a CPF at checkout for all passengers.

📱

SIM Cards

Claro, Vivo, and TIM require a CPF to activate a prepaid SIM card.

🍔

Food Delivery

iFood, Rappi, and Uber Eats require CPF to create an account.

🛒

Online Shopping

MercadoLivre, Amazon.com.br, and most e-commerce sites require CPF.

🏦

Bank Accounts

Opening a bank account in Brazil (even digital banks) requires a CPF.

🏠

Property & Contracts

Renting an apartment or signing any legal contract requires a CPF.

How to Get a Real CPF as a Foreigner

🏢

Option 1: Visit a Receita Federal Office in Brazil

Fastest

Bring your passport (original + copy) and proof of Brazilian address (hotel booking works). Walk in, no appointment needed. It's free and usually issued on the spot in 15-30 minutes.

🏛️

Option 2: Apply at a Brazilian Consulate

From Abroad

If you're outside Brazil, visit your nearest Brazilian consulate or embassy. Bring your passport and fill out the form. Processing time varies (1-4 weeks). Some consulates charge a small fee (~$15-30 USD).

💻

Option 3: Apply Online (Limited)

Digital

The Receita Federal website (gov.br) allows CPF requests for foreigners with a Brazilian visa. You'll need to upload your passport and visa documents. Available at: servicos.receita.fazenda.gov.br

Pro tip: If you're in a hurry, some digital banks like Nubank and C6 Bank can request a CPF on your behalf during account onboarding. You'll need a valid visa and passport.

Sending Money to Brazil?

If you're a foreigner dealing with Brazilian bureaucracy, you'll likely need to send or receive money. Our International Remittance Calculator shows you the real cost including IOF tax and bank spread.

Remittance Calculator

Frequently Asked Questions

CPF stands for "Cadastro de Pessoas Físicas" (Registry of Individuals). It is Brazil's national taxpayer identification number, similar to a Social Security Number (SSN) in the United States or a National Insurance Number in the UK. Every person who pays taxes, opens a bank account, or engages in financial transactions in Brazil needs a CPF. It consists of 11 digits in the format XXX.XXX.XXX-XX, where the last two digits are mathematically calculated verification numbers.

Yes! Foreigners can obtain a real CPF number through three methods: (1) Visit a Receita Federal (Brazilian IRS) office in Brazil with your passport and proof of address, it is free and usually issued on the spot; (2) Apply at a Brazilian consulate or embassy in your home country, some charge a small fee; (3) Some banks and services can request one on your behalf when you open an account. The process is straightforward and legal for any foreigner.

Generating mathematically valid CPF numbers for software testing, development, and educational purposes is perfectly legal. These generated numbers are not associated with any real person. However, using a generated CPF to impersonate a real person, commit fraud, or bypass identity verification for commercial services is illegal under Brazilian law (Art. 299 and Art. 307 of the Penal Code). This tool is designed strictly for testing and educational use.

The CPF uses the Modulo 11 algorithm with two verification digits. The first 9 digits are the base number. To calculate the 10th digit: multiply each of the 9 digits by weights 10 through 2, sum the products, divide by 11. If the remainder is less than 2, the digit is 0; otherwise it is 11 minus the remainder. The 11th digit is calculated similarly using all 10 digits with weights 11 through 2. This mathematical validation catches typos and prevents random numbers from being accepted.

While not legally required for short tourist visits, a CPF has become practically necessary for many everyday activities in Brazil: buying domestic flights (GOL, LATAM, Azul require CPF at checkout), purchasing a local SIM card (Claro, Vivo, TIM), using food delivery apps (iFood, Rappi), making online purchases on Brazilian e-commerce sites (MercadoLivre, Amazon.com.br), and even buying tickets to some museums and attractions. Many tourists get a CPF at the Receita Federal to avoid these inconveniences.

CPF is for individuals (pessoas físicas) and has 11 digits. CNPJ (Cadastro Nacional da Pessoa Jurídica) is for companies and has 14 digits. Both use similar Modulo 11 verification algorithms but serve different purposes. A CPF is like a US Social Security Number, while a CNPJ is like an Employer Identification Number (EIN).

Receba Novidades

Inscreva-se para receber dicas exclusivas e conteúdo premium diretamente no seu e-mail.

Ao se inscrever, você concorda em receber e-mails do Diário Prático. Você pode cancelar sua inscrição a qualquer momento.

This tool generates numbers using the official Modulo 11 algorithm adopted by Brazil's Receita Federal. Generated CPFs are NOT real documents and are intended exclusively for software testing, QA, and educational purposes. All processing happens 100% client-side. No data is sent to any server.