RUC Validator
Peruvian RUC (tax ID) · Issuer: SUNAT. SUNAT e-receipts, B2B customer onboarding.
Free online validator
Validated with the public algorithm; we don't store your input.Format
11 digits. Prefix 10 (individual, embeds the DNI), 15/17 (others) or 20 (company).
Check-digit algorithm
- Weights 5,4,3,2,7,6,5,4,3,2 on the first 10 digits.
- DV = 11 − (sum mod 11).
- 10 → 0, 11 → 1.
Use cases
SUNAT e-receipts, B2B customer onboarding.
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":"PE_RUC","value":"10531282766"}'
# Python
import requests
r = requests.post("https://validalatam.p.rapidapi.com/validate", json={"type": "PE_RUC", "value": "10531282766"},
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: "PE_RUC", value: "10531282766" }) });
const { valid, formatted, error } = await r.json();
# Response
{
"valid": true,
"type": "PE_RUC",
"country": "PE",
"input": "10531282766",
"normalized": "10531282766",
"formatted": "10531282766"
}
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 RUC check digit calculated?
Weights 5,4,3,2,7,6,5,4,3,2 on the first 10 digits. DV = 11 − (sum mod 11). 10 → 0, 11 → 1.
What is the RUC format?
11 digits. Prefix 10 (individual, embeds the DNI), 15/17 (others) or 20 (company).
Does a RUC starting with 10 contain the DNI?
Yes, digits 3–10 are the taxpayer's DNI.
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.