← Back to home

CPF / CNPJ Validator

Validate Brazilian tax ID numbers instantly — free, no sign-up, no rate limits.

Validate a number

Formatted: Type: Digits:

What are CPF and CNPJ?

CPF (Cadastro de Pessoas Físicas) is the Brazilian individual taxpayer identification number — an 11-digit number issued by the Receita Federal (Federal Revenue) to every Brazilian citizen and resident. It is used in banking, tax filings, government services, and most commercial transactions in Brazil.


CNPJ (Cadastro Nacional da Pessoa Jurídica) is the Brazilian business tax ID — a 14-digit number assigned to legal entities (companies, nonprofits, government bodies). It is required for any business operating in Brazil and appears on invoices (Notas Fiscais), contracts, and bank accounts.


Both numbers include check digits computed via the mod-11 algorithm, which allows offline validation without querying any government database.

Free Validation API

No authentication. No API key. No rate limits. CORS enabled. Just GET requests.

Validate CPF

GET https://fastsoftware.uk/api/v1/cpf/validate?cpf={cpf}
Pass the CPF with or without formatting. Digits-only also accepted.

Example request:

curl "https://fastsoftware.uk/api/v1/cpf/validate?cpf=529.982.247-25"

Response (valid):

{"valid": true, "formatted": "529.982.247-25"}

Response (invalid):

{"valid": false, "formatted": "123.456.789-00"}

Validate CNPJ

GET https://fastsoftware.uk/api/v1/cnpj/validate?cnpj={cnpj}
Pass the CNPJ with or without formatting (dots, slashes, dashes).

Example request:

curl "https://fastsoftware.uk/api/v1/cnpj/validate?cnpj=11.222.333/0001-81"

Response (valid):

{"valid": true, "formatted": "11.222.333/0001-81"}

Notes

Invalid numbers return valid: false with HTTP 200. A missing query param returns HTTP 400 with {"error": "..."}. All responses include Access-Control-Allow-Origin: * — safe to call from browsers. Validation is purely algorithmic (mod-11 check digits) — no external database lookups.

cpf validation api cnpj validator validar cpf online validate cnpj free brazilian tax id mod-11 algorithm cpf checker receita federal