Registro Único de Contribuyentes
Peru · Individuals and companies
Paste or type the number — punctuation is optional.
Other identifiers
Europe
Asia and the Middle East
Oceania
What this check does — and what it cannot do
This tool checks the number's structure and its check digit, using the published algorithm for that document. A number that passes is well formed: it is arithmetically consistent and could have been issued.
It cannot tell you whether the number was actually issued, whether it is active, or who it belongs to. Only the issuing tax authority can confirm that, through its own lookup service. Treat a passing result as "worth submitting", never as proof of identity.
The generator produces numbers that satisfy the same checksum, for filling forms while developing and testing software. They are arithmetic, not records: they are not drawn from any register and do not correspond to a real holder. No generator is offered for the US Social Security Number.
Peru's RUC reuses four weights, and every blind spot lands exactly there
The RUC weights run 5, 4, 3, 2, 7, 6, 5, 4, 3, 2 — the last four repeat the first four. Testing every swap of two positions, three went undetected, and all three were pairs sharing a weight: positions 1 and 7, 3 and 9, 4 and 10. Nothing else slipped through. The theory that repeated weights create transposition blind spots is visible here as an exact list.
How it works
- Computes the eleventh digit of a Peruvian RUC from the first ten.
- Validates a supplied RUC and reports the expected check digit on mismatch.
- Checks the leading prefix, which distinguishes natural persons from companies.
weights, left to right: 5, 4, 3, 2, 7, 6, 5, 4, 3, 2 sum = Σ digitᵢ × weightᵢ over the first ten digits DV = 11 − (sum mod 11) 10 → 0, 11 → 1 prefix 10 = natural person, 20 = company, 15 and 17 = other registered entities
Worked example
Computing check digits, then measuring which errors the scheme misses.
- 2010010023 → DV 2, giving 20100100232
- 1012345678 → DV 1
- 2050014521 → DV 9
- 90 single-digit substitutions tested → 0 undetected
- 33 swaps of any two positions tested → 3 undetected
Every single-digit error is caught, as mod 11 guarantees. The three undetected swaps are positions 1 and 7 (both weight 5), 3 and 9 (both weight 3), and 4 and 10 (both weight 2). Exchange two digits that carry the same multiplier and the sum does not move.
Reading the result
- This is the same weakness Luhn has with 09 and 90, arriving by the same route. Any scheme that reuses a weight cannot see a swap between the positions sharing it — the only fix is a distinct weight per position, which is what Colombia's NIT does with primes.
- The blind spots are predictable rather than random, which makes them manageable. Swapping digits four positions apart is a far rarer mistake than swapping neighbours, and every adjacent transposition in a RUC is detected because no two neighbouring positions share a weight.
- The prefix carries real meaning and is worth validating separately. A RUC beginning 10 belongs to a natural person and one beginning 20 to a company, so a prefix that contradicts the rest of your record is a signal even when the check digit passes.
- A valid check digit does not mean the RUC is registered or active. Only SUNAT can confirm that, and a taxpayer's status — active, suspended, de-registered — is exactly the kind of thing arithmetic cannot see.
Common questions
- Which typing errors does the RUC check digit miss?
- Only swaps between positions that share a weight — 1 with 7, 3 with 9, and 4 with 10. All 90 single-digit substitutions were detected, and so was every adjacent transposition, because neighbouring positions never carry the same multiplier.
- What does the first pair of digits mean?
- It identifies the type of taxpayer: 10 for a natural person, 20 for a company, with 15 and 17 used for other registered entities. It is worth checking against what you expect, since a mismatched prefix indicates a wrong record even when the arithmetic is sound.