A RUC (Registro Único de Contribuyentes) is the 11-digit tax identification number that Peru’s tax authority, SUNAT, assigns to every taxpayer — individuals and companies alike. It appears on every comprobante de pago (electronic invoice, boleta, factura) and is required for electronic invoicing. This validator checks that an RUC is internally well-formed using SUNAT’s official modulo-11 check digit, entirely in your browser.
How it works
SUNAT computes the 11th digit (the check digit) from the first 10 digits using a weighted modulo-11 algorithm:
- Strip spaces and dashes so you have 11 digits.
- Multiply each of the first 10 digits by the fixed weights
5, 4, 3, 2, 7, 6, 5, 4, 3, 2. - Add the 10 products together to get the weighted sum.
- Compute
11 - (sum mod 11). - If that value is
10, the check digit is0; if it is11, the check digit is1; otherwise it is the value itself. - The RUC is valid if the computed check digit equals the actual 11th digit.
The tool also verifies the type prefix: valid leading pairs are 10 and 15 (natural persons), 17 (non-domiciled), and 20 (legal entities).
Example
Validate 20100066603. The first 10 digits are 2 0 1 0 0 0 6 6 6 0 with weights 5 4 3 2 7 6 5 4 3 2:
(2×5)+(0×4)+(1×3)+(0×2)+(0×7)+(0×6)+(6×5)+(6×4)+(6×3)+(0×2)
= 10 + 0 + 3 + 0 + 0 + 0 + 30 + 24 + 18 + 0 = 85
85 mod 11 = 8, so 11 - 8 = 3. The expected check digit is 3, which matches the 11th digit, so the RUC is valid.
Notes
A valid check digit confirms the RUC is consistent, not that the taxpayer is registered or active — use SUNAT’s official consulta RUC for that. The prefix check is informational: a number can pass the modulo-11 test with an unusual prefix. Everything runs locally, so your RUC never leaves your device.