Spanish DNI generator online (with valid check letter)
A DNI generator creates Spanish national ID numbers (DNI): 8 digits plus a check letter from the official algorithm. The number is divided by 23 and the remainder points to a letter in the table TRWAGMYFPDXBNJZSQVHLCKE. DNIs generated by DataMockSeed are fake: they pass any form validation, but belong to no real person.
Each DNI is generated with 8 digits and the real check letter, calculated by dividing the number by 23. The data is fictitious: it does not belong to any real person.
How it's calculated
8 digits + check letter, computed from the remainder of dividing the number by 23.
The check letter comes from the remainder of dividing the number by 23, looked up in a fixed table.
- 1Number (8 digits)55619530
- 2Remainder of number ÷ 2310
- 3Letter at the remainder's position (TRWAGMYFPDXBNJZSQVHLCKE)X
Frequently asked questions
Do the generated DNIs belong to real people?
No. The 8-digit number is random and the letter is calculated with the official algorithm, but the DNI is not linked to any real record held by Spain's National Police (Dirección General de la Policía).
How is the DNI letter calculated?
By dividing the 8-digit number by 23: the remainder (from 0 to 22) gives the position of the letter in the table TRWAGMYFPDXBNJZSQVHLCKE. For example, 12345678 divided by 23 leaves a remainder of 14, which corresponds to the letter Z.
Is it legal to use a generated DNI?
Yes, for software testing, test forms, demos and database seeds. Using a generated DNI for real-world paperwork, to impersonate someone or to deceive others is illegal.
Can I generate a DNI with a wrong letter to test error handling?
Yes. The full generator can force an invalid check letter so you can see how a validator reacts to an incorrect DNI.
Keep exploring
Looking for more data types? Try the full generator.