Spanish DNI & NIE Generator
Private by design — runs entirely in your browser
A DNI/NIE is the Spain national ID for citizens (DNI) and foreigners (NIE). Toova generates syntactically valid DNI/NIEs in your browser — perfect for testing, fixtures, and demo data. The generated values pass front-end validators but are not registered with any official authority.
What it is
DNI (Documento Nacional de Identidad) is the Spanish national ID for citizens — 8 digits plus a check letter. NIE (Número de Identidad de Extranjero) is the foreigner equivalent — a prefix letter (X, Y, or Z) plus 7 digits plus a check letter. Both share the same check-letter algorithm.
How the algorithm works
Take the numeric portion (for NIE, prepend 0/1/2 for X/Y/Z) and compute its value modulo 23. Map the result to the letter at that position in TRWAGMYFPDXBNJZSQVHLCKE — the letters I, Ñ, O, U are skipped to avoid visual confusion. Toova picks the digits randomly and computes the correct check letter.
Frequently Asked Questions
- Are these DNI/NIE numbers real?
- No. They satisfy the official algorithm but are not registered in any Spain authority's database. Front-end validators accept them; an official lookup would reject them.
- Can I use a generated DNI/NIE in production?
- Only for testing — fixtures, demo screens, form validators. Using a generated DNI/NIE to impersonate someone or evade tax law is fraud.
- Why does my validator accept these?
- Because most DNI/NIE validators check the mathematical formula (or format for prefix-based IDs), not the registry. Toova's outputs pass the math.
- Does Toova store or log the DNI/NIEs I generate?
- No. All generation runs in your browser via crypto.getRandomValues. There are no outbound requests.