A little context. A clearer answer.
When this calculator is useful
For DNI, divide the eight-digit number by 23 and use the remainder as an index into the official control-letter sequence. For NIE, replace initial X/Y/Z with 0/1/2 first. Leading zeros are retained; letter case is normalized. For a related calculation, try Euclidean modulo calculator.
What to enter
| Input | What it means | Example value |
|---|---|---|
| DNI / NIE | DNI / NIE: 00000000A / X0000000A | 12345678Z |
How the calculation works
- Change the inputs to explore your own scenario. DNI / NIE: 00000000A / X0000000A.
- r=N mod 23; alphabet=TRWAGMYFPDXBNJZSQVHLCKE; NIE: X→0, Y→1, Z→2
- Supported format is eight digits plus a letter, or X/Y/Z plus seven digits and a letter. Checks syntax and control letter only, not issuance, identity or register status. Other NIF types and historical longer NIE formats are excluded. Identifier input is excluded from shared links.
r=N mod 23; alphabet=TRWAGMYFPDXBNJZSQVHLCKE; NIE: X→0, Y→1, Z→2A worked example
Official Ministry example: 12345678 mod 23=14; table entry 14 is Z; 12345678Z passes the checksum. 12345678A does not.
Example you can load
What to enterThis is a fixed example; changing the form above does not change these numbers.
Assumptions & limits
Supported format is eight digits plus a letter, or X/Y/Z plus seven digits and a letter. Checks syntax and control letter only, not issuance, identity or register status. Other NIF types and historical longer NIE formats are excluded. Identifier input is excluded from shared links.
Frequently asked questions
Does a passing result prove that the document exists?
No. A structural checksum test cannot confirm an issued identity document or its holder.
Which NIE prefixes are supported?
X, Y and Z followed by seven digits and the control letter. They are converted to 0, 1 and 2 for the remainder calculation.
Is my identifier included in a shared link?
No. This tool uses the existing local-only sharing policy and does not encode the identifier in a result URL.