The validator accepts Spanish DNI values with eight digits plus a control letter, and NIE values beginning with X, Y, or Z followed by seven digits and a control letter. NIE prefixes are mapped to 0, 1, or 2 before the checksum calculation.
The numeric base is reduced modulo 23 and mapped to the official letter sequence. The generator can create DNI or NIE samples and rejects repeated digit sequences, but generated values are fictional format samples and cannot prove identity, residency, or legal eligibility. Since the current value can travel in a share URL, do not share links containing real documents.
Common questions and answers about this topic.
Yes. It generates numbers with a correct control letter (modulus 23) for testing and development. Choose DNI or NIE and optionally fix the NIE prefix; the rest is randomized.
Only for software testing, sample forms, or learning. The numbers do not correspond to real people and must not be used for impersonation or any unlawful purpose.
The number is divided by 23, and the remainder (0–22) selects the letter from an official table. The tool shows this calculation step by step.
No. All validation and generation happen in your browser — nothing is uploaded or stored.