Developer Tools / CNPJ Validator

CNPJ Validator

Check if a CNPJ is mathematically valid by verifying its check digits.

more character(s) needed

API Endpoint

GET /api/tools/validate/cnpj/{cnpj}

Response includes: isValid, formatted, unformatted

How CNPJ Validation Works

The CNPJ (Cadastro Nacional da Pessoa Juridica) is the Brazilian tax identification number for companies. It consists of 12 alphanumeric characters followed by two numeric verification digits.

CNPJ Structure

  • First 8 characters: Company root
  • Next 4 characters: Establishment order
  • Last 2 digits: Check digits (calculated from the first 12)

Check Digit Algorithm

The check digits are calculated using weighted multiplication and modular arithmetic (mod 11). Our validator performs this calculation and compares the result with the provided digits.

Important Note

A mathematically valid CNPJ doesn't guarantee the company exists or is active. To verify if a company is registered with Receita Federal, search our database or use our full verification tool.