Spanish ID numbers
Find the letter of any DNI
Type the 8 digits of a DNI, or a NIE for foreign residents, to get its check letter. Add the letter at the end to check that a complete ID is right.
How the letter works
The number is divided by 23 and the remainder picks the letter from this table. For a NIE, the X, Y or Z at the start counts as 0, 1 or 2.
12345678 mod 23 = 14 → Z
Examples
- 12345678 gives the letter of a DNI.
- 12345678Z checks a complete DNI.
- X1234567 or X1234567L work the same for a NIE.
- Spaces, dots and dashes are ignored: 12.345.678-Z.