Peruvian RUC Validator
Validate a Peruvian RUC (11 digits), the SUNAT taxpayer registry number, by checking the checksum. Useful for invoicing and trading with Peruvian companies.
RUC: Peru's 11-digit taxpayer registry number
The RUC (Registro Único de Contribuyentes) is the 11-digit number that identifies every taxpayer in Peru — people and companies alike — administered by SUNAT. The first two digits announce the taxpayer type, and the last digit is a mod-11 check digit. This tool validates the prefix, length and checksum; 20100070970 is a sample company RUC.
For an individual, the RUC is usually their DNI (national ID) prefixed with 10 and given a check digit — so the RUC and DNI are tightly linked for natural persons.
The type prefix
- 10: persona natural (an individual, typically DNI-based).
- 15 / 17: persona natural no domiciliada (non-resident individual).
- 20: persona jurídica (a company/legal entity).
- Check digit: weights
5,4,3,2,7,6,5,4,3,2over the first 10, then(11 − sum mod 11) mod 10.
Where it matters
- Invoicing: every Peruvian factura/boleta electrónica carries the issuer's and buyer's RUC.
- Tax filing: SUNAT keys all declarations and payments to the RUC.
- Business checks: the RUC reveals the entity type and tax status (active/suspended).
- Mock data / testing: validating prefix + checksum before a SUNAT lookup.
Common pitfalls
- Prefix must be valid: only
10,15,17,20are accepted types. - Checksum ≠ active: a valid RUC can still be a suspended or de-registered taxpayer.
- Leading digits matter: store as an 11-character string, never an integer.
- RUC vs DNI: the 8-digit DNI is embedded in a
10-type RUC but isn't the same field.
FAQ
How is the RUC check digit computed? Weights 5,4,3,2,7,6,5,4,3,2 over the first ten digits, then (11 − sum mod 11) mod 10.
What does a 20 prefix mean? A persona jurídica — a registered company or legal entity.
Is an individual's RUC their DNI? Essentially yes — a 10 prefix plus the 8-digit DNI plus a check digit.
Related Tools
DUNS Number Format Validator
Validate the 9-digit Dun & Bradstreet D-U-N-S Number, accepting hyphens and spaces. Rejects reserved placeholders like 000000000 and 999999999.
RG-UF Format Validator
Validate the generic format of a Brazilian RG ID with the state (ex: 12.345.678-9/SP). Checks the number and state pattern, useful for forms and sign-ups.
Google Ads Customer ID Validator
Validate Google Ads Customer ID format: 10 digits with hyphens (XXX-XXX-XXXX). Format only — no existence check.
Brazilian State Tax ID Validator
Validate Brazilian State Tax IDs (Inscrição Estadual) for SP, RJ, MG, RS, PR and BA. Browser-side verification.
OAuth Scope Checker
Check whether a requested scope is present in the space separated list a token came back with, matched literally as OAuth 2.0 requires.
Promo Code Validator
Check a promo code against configured format: length, allowed chars (alnum/hyphen) and optional Luhn checksum.