CNPJ Validator
CNPJ (Brazilian company tax ID) · Issuer: Receita Federal. B2B supplier onboarding, invoicing, Brazilian ERP integrations.
Free online validator
Validated with the public algorithm; we don't store your input.Format
14 positions 00.000.000/0001-00: 8-digit root, 4-digit branch (0001 = HQ) and 2 check digits. Alphanumeric CNPJ is accepted from 2026.
Check-digit algorithm
- Each character's value is ASCII − 48 (digits 0–9, letters A=17…).
- 1st check: weights 5,4,3,2,9,8,7,6,5,4,3,2; mod 11 remainder < 2 → 0, else 11 − remainder.
- 2nd check: weights 6,5,4,3,2,9,8,7,6,5,4,3,2.
Use cases
B2B supplier onboarding, invoicing, Brazilian ERP integrations.
Code examples
# curl (RapidAPI)
curl -X POST "https://validalatam.p.rapidapi.com/validate" -H "Content-Type: application/json" \
-H "X-RapidAPI-Key: $RAPIDAPI_KEY" -H "X-RapidAPI-Host: validalatam.p.rapidapi.com" \
-d '{"type":"BR_CNPJ","value":"80532224000183"}'
# Python
import requests
r = requests.post("https://validalatam.p.rapidapi.com/validate", json={"type": "BR_CNPJ", "value": "80532224000183"},
headers={"X-RapidAPI-Key": KEY, "X-RapidAPI-Host": "validalatam.p.rapidapi.com"})
print(r.json()["valid"], r.json()["formatted"])
// JavaScript (fetch)
const r = await fetch("https://validalatam.p.rapidapi.com/validate", { method: "POST",
headers: { "Content-Type": "application/json", "X-RapidAPI-Key": KEY, "X-RapidAPI-Host": "validalatam.p.rapidapi.com" },
body: JSON.stringify({ type: "BR_CNPJ", value: "80532224000183" }) });
const { valid, formatted, error } = await r.json();
# Response
{
"valid": true,
"type": "BR_CNPJ",
"country": "BR",
"input": "80532224000183",
"normalized": "80532224000183",
"formatted": "80.532.224/0001-83"
}
API plans on RapidAPI
Free plan to get started; paid plans for production volume and batch validation (up to 1000 per request).
FAQ
How is the CNPJ check digit calculated?
Each character's value is ASCII − 48 (digits 0–9, letters A=17…). 1st check: weights 5,4,3,2,9,8,7,6,5,4,3,2; mod 11 remainder < 2 → 0, else 11 − remainder. 2nd check: weights 6,5,4,3,2,9,8,7,6,5,4,3,2.
What is the CNPJ format?
14 positions 00.000.000/0001-00: 8-digit root, 4-digit branch (0001 = HQ) and 2 check digits. Alphanumeric CNPJ is accepted from 2026.
Is the new alphanumeric CNPJ supported?
Yes, letters in the first 12 positions are accepted per the Receita rule.
Is this validator free?
Yes, the web tool is free. To integrate it, use the API: there's a free plan on RapidAPI.
Does the API store the numbers I validate?
No. Validation is deterministic, with no storage and no third-party lookups.