Peru RUC Validator and DNI to RUC Converter

Type a RUC to check its digit step by step and see its type, type a DNI to get the RUC of a natural person, or paste a list to validate, flag duplicates, clean it and export CSV.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Type

    Enter a RUC, ten digits or a DNI.

  2. 2
    Check

    Read the status and the steps.

  3. 3
    Convert

    Get the RUC from a DNI.

  4. 4
    Batch

    Paste a list.

  5. 5
    Export

    Clean the list and download CSV.

About this tool

The RUC, registro único de contribuyentes, is the 11-digit tax number SUNAT gives to every person and company with tax obligations in Peru. It appears on invoices, receipts, contracts and supplier lists, and a single mistyped digit can make an electronic invoice or a payment fail. The first two digits show the type of taxpayer: 10 for individuals with a DNI, 20 for companies and other legal entities, and 15, 16 and 17 for other cases such as individuals without a DNI. The next eight digits identify the taxpayer, and for individuals they are the DNI number itself. The last digit is a check digit calculated from the first ten with a module 11 algorithm that catches most typing errors. This tool uses that rule in three ways. Type an 11-digit RUC and it tells you whether the check digit is correct, shows the multiplication step by step and names the type of taxpayer. Type ten digits and it calculates the missing check digit. Type an eight-digit DNI and it gives you the RUC that corresponds to that person, 10 plus the DNI plus the check digit. In batch mode, paste a whole column from a spreadsheet to validate every line, flag duplicates, produce a clean list and export a CSV with the status of each entry.

The algorithm

| Step | What to do | |---|---| | 1 | Take the first 10 digits | | 2 | Multiply them by 5, 4, 3, 2, 7, 6, 5, 4, 3, 2 | | 3 | Add the products | | 4 | Calculate 11 − (sum mod 11) | | 5 | 10 gives 0, 11 gives 1, any other result is the digit |

Worked example

For 2013131295, the products are 10, 0, 3, 6, 7, 18, 5, 8, 27 and 10, which add up to 94. 94 divided by 11 leaves 6, and 11 − 6 = 5, so the full RUC is 20131312955. A list containing 20131312951 would show that line with a wrong digit and the correct one, 5.

Prefixes

| Prefix | Taxpayer | |---|---| | 10 | Individual with DNI | | 15, 17 | Individual with another ID | | 16 | Other entity | | 20 | Company or legal entity |

A valid digit is not enough

Passing the check digit test shows only that the RUC is well formed. To check that a RUC is active and its address is valid (habido), use SUNAT's RUC lookup.

Cleaning supplier lists

Before uploading suppliers or customers to an accounting or invoicing system, run the column through the batch mode. Removing wrong digits and duplicates first avoids rejected documents and repeated records.

Privacy

Numbers are processed in your browser and never uploaded.

Limits

The tool checks format and check digit only. It does not calculate the separate check digit printed on the DNI card. Not legal advice.

Worked example

2013131295 → products sum 94 → 94 mod 11 = 6 → 11 − 6 = 5 → RUC 20131312955.

Quick facts

Frequently asked questions

How is the RUC check digit calculated?

Multiply the first ten digits by 5, 4, 3, 2, 7, 6, 5, 4, 3, 2, add them and subtract the remainder of dividing by 11 from 11; 10 gives 0 and 11 gives 1.

What does a RUC starting with 10 mean?

It belongs to an individual with a DNI.

How do I get a person's RUC from their DNI?

Put 10 before the DNI and add the check digit.

Does a valid digit mean the RUC is active?

No, check its status in SUNAT's RUC lookup.

Can I check a whole list?

Yes, paste it in batch mode and export a clean CSV.

Is my list uploaded?

No, everything runs in your browser.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages