Spanish DNI letter calculator
Find the DNI or NIE letter and check whether a Spanish NIF or CIF is valid.
How to use it
Type only the DNI or NIE number to get its letter, or the full document (DNI, NIE or CIF) to check whether it is correct.
Result
The result shows the matching letter or whether the document is correct, with the full number ready to copy. The data never leaves the browser and is not stored.
Formats and limits
DNI with 8 digits, NIE starting with X, Y or Z plus 7 digits, and CIF for organizations with a leading letter and check digit. Spaces, dots and hyphens are accepted.
If something goes wrong
A correct letter only proves the number is well formed, not that the person or company exists. Special NIFs starting with K, L or M are not checked.
How is the DNI letter calculated?
The number is divided by 23 and the remainder points to the letter in the official table TRWAGMYFPDXBNJZSQVHLCKE. For example, 12345678 leaves 14, which gives Z. For a NIE, the X, Y or Z is replaced with 0, 1 or 2.
What happens to what you type
What you type is processed on this page and is not sent to any server. It is cleared when you reload or close the page.