Spanish DNI, NIE and NIF Validator (and Letter Calculator)
Check whether a Spanish DNI, NIE or NIF has a valid format and control letter/digit, or calculate the control letter of a DNI or NIE from its digits. This only validates or calculates structure — it never checks any registry or confirms the document actually exists.
Which document types this validates
An individual's NIF is always the same as their DNI or NIE. A legal entity's NIF (sometimes still called CIF) uses a different algorithm, with a control character that depends on the organization type.
| Document | Format | Who has it |
|---|---|---|
| DNI | 8 digits + letter | Spanish citizens |
| NIE | X/Y/Z + 7 digits + letter | Foreign residents in Spain |
| Company NIF (CIF) | Letter + 7 digits + control letter or digit | Legal entities (companies, associations...) |
How the control letter/digit is calculated
For DNI and NIE, the letter comes from dividing the number by 23 and looking up the remainder in a fixed 23-letter table. For a company NIF, the control digit or letter is derived from the 7 central digits, following an algorithm that depends on whether the first letter identifies a public company, a limited company, an association...
What this tool does NOT check
A valid format doesn't mean the document exists, is currently active, or belongs to a specific person or company. Confirming that would require checking the electronic DNI, the Civil Registry or the Commercial Registry — none of which this tool does or can do.
Privacy
Whatever you type never leaves your browser: it's not sent to Numelto, not logged, and not stored anywhere.