Peru DNI Generator
Generate 8-digit Peruvian DNI numbers with the RENIEC verification character — synthetic test data only
For Development & Testing Purposes Only - Synthetic Mock Data
Settings
1 valueGenerates 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).
Examples
Digit form
DNI · Generate10117410-2Eight digits plus the digit-form verification character.
Letter form
10117410-GValid — 10117410 requires 2 or GThe same remainder points at G in the letter table, so both forms validate.
Wrong verification character
10117410-3Invalid — verification character is 3 but 10117410 requires 2 or GThe 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
Generate a DNI
Click Generate to create eight random digits and append the verification character the weighted sum produces.
Copy or download
Copy the value for a fixture or download it as a .txt file.
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
| Part | Rule |
|---|---|
| Body | 8 digits |
| Weights | 3, 2, 7, 6, 5, 4, 3, 2 over the eight digits |
| Remainder | Weighted sum mod 11, used as a table position |
| Digit table | 65432110987 |
| Letter table | KJIHGFEDCBA |
| Generator output | Digit 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
Related tools
Peru RUC Generator
Generate synthetic 11-digit Peruvian RUC numbers for companies (20…) and individuals (10…), with the SUNAT mod-11 check digit.
VAT Number Generator
Generate VAT numbers for EU, UK, Switzerland, Norway and global tax integration testing.
Tax Number Generator
Generate valid tax identification numbers for testing (TR, US, SG, etc.)
National Identity Generator
Generate and validate national ID numbers for testing (TR, US, DE, UK, SA, AE, QA, KW, CA, ES, BR, FR, IT, NL, SE, NO, EG, SG)
Tax ID Validator
Auto-detect and validate VAT, EIN, TIN and GST identifiers with batch checksum reporting.