DevTools Logo

Peru DNI Generator

Peru DNI Generator

Generate 8-digit Peruvian DNI numbers with the RENIEC verification character — synthetic test data only

Runs in your browser

For Development & Testing Purposes Only - Synthetic Mock Data

Settings

1 value

Generates one value with a valid checksum. Press ⌘/Ctrl+Enter for a fresh one.

Generated value

No value yet

Set options, then press Generate.

Generated values are valid in shape but randomized (Test Data).

Legal Disclaimer: Generated data is for software testing and validation purposes only (e.g. verifying input masks, form validation, or database seeding). It is randomly generated and not taken from any real record, but a random value can coincidentally match a real, issued number, so never use it in real applications, payments, KYC or official forms. Using it to impersonate real people or for any fraudulent activity is illegal. DevTools accepts no liability for how generated data is used.

    Examples

    Digit form

    Input
    DNI · Generate
    Output
    10117410-2

    Eight digits plus the digit-form verification character.

    Letter form

    Input
    10117410-G
    Output
    Valid — 10117410 requires 2 or G

    The same remainder points at G in the letter table, so both forms validate.

    Wrong verification character

    Input
    10117410-3
    Output
    Invalid — verification character is 3 but 10117410 requires 2 or G

    The validator prints both accepted characters for the number.

    About this tool

    The Peru DNI Generator produces Documento Nacional de Identidad numbers in the form RENIEC prints on the card: eight digits followed by a verification character. The character comes from a weighted sum over the eight digits with weights 3, 2, 7, 6, 5, 4, 3 and 2; the remainder mod 11 selects a position in the digit table 65432110987 or the letter table KJIHGFEDCBA.

    Because both tables describe the same remainder, a number can be written in digit or letter form — 10117410-2 and 10117410-G are the same DNI. The generator emits the digit form, and the validator accepts either. Many real forms ask for the eight digits alone, but validating a value needs the verification character, so the tool explains that when only eight digits are pasted.

    These are synthetic values for QA and development, never for real applications, KYC checks, tax filings or identity documents; a random value can coincidentally match a real, issued number, and DevTools accepts no liability for how generated data is used. Everything runs locally in your browser.

    What this tool does not do

    • Validation confirms the verification character only, not whether RENIEC issued the DNI.
    • The generator emits the digit form, never the letter form.
    • Eight-digit input alone cannot be validated; the tool asks for the verification character.
    • No external lookup is performed, so a valid value carries no identity information.

    How to use this tool

    1. Generate a DNI

      Click Generate to create eight random digits and append the verification character the weighted sum produces.

    2. Copy or download

      Copy the value for a fixture or download it as a .txt file.

    3. Validate either form

      Switch to Validate and paste a digit-form or letter-form value; both are accepted for the same number.

    Use cases

    Identity field fixtures

    Fill DNI fields in onboarding and account forms with values that pass the RENIEC check.

    Digit and letter input

    Verify that your parser accepts whichever verification character a user copies from a card.

    Eight-digit-only guards

    Test the message your form shows when a user leaves off the verification character.

    DNI parts and verification tables

    PartRule
    Body8 digits
    Weights3, 2, 7, 6, 5, 4, 3, 2 over the eight digits
    RemainderWeighted sum mod 11, used as a table position
    Digit table65432110987
    Letter tableKJIHGFEDCBA
    Generator outputDigit form, for example 10117410-2

    The letter form 10117410-G is the same DNI as 10117410-2.

    Common mistakes

    Mistake:Storing only the eight digits

    Fix:The verification character is part of the check; validation needs it to confirm the number.

    Mistake:Assuming the letter and digit forms are different DNIs

    Fix:Both map to the same remainder, so they identify the same number.

    Mistake:Applying the letter table to a digit

    Fix:Use the remainder to look up either table; do not convert one character into the other by hand.

    Frequently asked questions

    Are these real DNIs, and can I use them in production?

    No. They are synthetic test values for QA and development, never for real applications, KYC checks, tax filings or identity documents; a random value can coincidentally match a real, issued number, and DevTools accepts no liability for how generated data is used.

    Why do the same digits appear with a number or a letter?

    The weighted sum mod 11 selects a position in two tables. The digit table 65432110987 and the letter table KJIHGFEDCBA describe the same remainder, so 10117410-2 and 10117410-G are the same DNI.

    Which form does the generator produce?

    The digit form, such as 10117410-2. The validator accepts either the digit or the letter that matches the computed remainder.

    Why does validation ask for a ninth character?

    Many forms collect only the eight digits, but the RENIEC verification character is required to confirm the number, so the tool asks you to add it.

    Is the letter check case-sensitive?

    No. The validator uppercases the input before comparing it with the expected character.

    References & standards