Peru RUC validator
Check the prefix and the check digit of a Peruvian RUC before you create the customer or vendor in SAP Business One.
Tool
This tool checks the format and the check digit; it does not query the SUNAT register. To confirm the taxpayer’s name, status and condition, use SUNAT’s RUC lookup at sunat.gob.pe.
How do you validate a Peruvian RUC?
A Peruvian RUC has 11 digits. Check two things: that it starts with 10 (individual), 20 (legal entity), 15 or 17, and that the last digit matches the check digit calculated with weights 5, 4, 3, 2, 7, 6, 5, 4, 3, 2 and modulo 11. This tool runs both checks; only SUNAT confirms that the RUC is active and “habido”.
Step by step: how to calculate the check digit
- Take the first 10 digits of the RUC.
- Multiply them, from left to right, by 5, 4, 3, 2, 7, 6, 5, 4, 3 and 2.
- Add up the results and take the remainder of dividing the sum by 11.
- Subtract that remainder from 11. If the result is 10, the digit is 0; if it is 11, the digit is 1.
Example (made up): 2060123456. 2×5 + 0×4 + 6×3 + 0×2 + 1×7 + 2×6 + 3×5 + 4×4 + 5×3 + 6×2 = 105. 105 mod 11 = 6. 11 − 6 = 5, so the full RUC is 20601234565.
Individual RUC and DNI
An individual’s RUC is 10, the 8 digits of their DNI and the check digit. When you type a RUC that starts with 10, the tool shows the DNI inside it.
Checking the format vs. checking with SUNAT
This tool checks that the number is typed correctly. A RUC with the right format may be deregistered, “no habido” or not belong to your customer. To confirm the company name, status and condition, use SUNAT’s RUC lookup at sunat.gob.pe.
The RUC in SAP Business One
In SAP Business One, a customer’s or vendor’s RUC is stored in the business partner’s tax ID field (LicTradNum in the OCRD table). Checking it when you create the partner avoids duplicates and errors in reports. If you want this validation inside SAP B1, see our SAP Business One development service or SAP Business One by country.
Other LatAm validators
- Chile RUT validator (including K)
- Mexico RFC and CURP validator
- Colombia NIT validator (DIAN check digit)
- Guatemala NIT validator (modulo 11, including K)
- Ecuador cédula and RUC validator
- El Salvador DUI and NIT validator
Three steps, no signup
Paste the RUC
All 11 digits, with or without spaces: 20601234565, or 10 + DNI + digit for an individual.
We check the RUC
The prefix (10, 15, 17 or 20) and the check digit, with weights 5, 4, 3, 2, 7, 6, 5, 4, 3, 2.
Register it cleanly
Use the correct RUC on the business partner in SAP Business One, and confirm its status with SUNAT.
Questions about this tool
How do you validate a Peruvian RUC?
Type the 11 digits of the RUC. The tool checks that it starts with a valid prefix (10, 15, 17 or 20) and recalculates the last digit with weights 5, 4, 3, 2, 7, 6, 5, 4, 3, 2 and modulo 11. If it matches, the RUC is typed correctly. Its status and condition are looked up with SUNAT.
How is the RUC check digit calculated?
Multiply the first 10 digits by 5, 4, 3, 2, 7, 6, 5, 4, 3 and 2, in that order. Add the results and compute 11 minus the remainder of dividing the sum by 11. If the result is 10, the digit is 0; if it is 11, the digit is 1.
What do the first two digits of a RUC mean?
10 is for individuals (personas naturales) and 20 for legal entities (companies). 15 and 17 also exist for other kinds of taxpayer. A RUC that starts with any other number is not valid.
Does an individual’s RUC contain their DNI?
Yes. An individual’s RUC is 10, the 8 digits of the DNI and a check digit. The tool shows the DNI inside any RUC that starts with 10.
Does this tool confirm that the RUC is active and “habido”?
No. It only checks the format and the check digit. The taxpayer’s name, status (activo) and condition (habido) are looked up with SUNAT.
Does the validator store my data?
No. The calculation runs in your browser and the RUC is not sent to Kodenova or to any server.
Built for SAP Business One teams
SAP Business One in Peru
We build add-ons, reports and integrations for SAP B1 on SQL Server and HANA. Tell us what you need and get a fixed price per phase.
