Home Models News About Contact

Spain DNI / NIE Check

Local processing · not uploaded

Validate Spanish DNI and foreigner NIE numbers online: 8 digits + 1 check letter, verified by the mod-23 letter-lookup algorithm.

Sample (click to fill): 12345678Z

Number—
Type—
Expected letter—
Validation—

DNI / NIE structure and checksum

A Spanish DNI is 8 digits + 1 check letter. A foreigner NIE starts with X/Y/Z followed by 7 digits and 1 check letter.

Algorithm: the letter table is TRWAGMYFPDXBNJZSQVHLCKE; index it with number mod 23 to get the letter and compare with the final letter of the input.

How to use

1

Paste or type the ID number above (use the sample to try it out)

2

Click “Check”, and the tool verifies structure and check digit locally in your browser

3

See instantly whether it is valid — nothing is uploaded, no real identity is looked up

✅What this tool does

  • Supports both DNI (digits) and NIE (X/Y/Z prefix)
  • Map the 8-digit number mod 23 to a check letter
  • Compare the entered letter with the computed one

💡Tips

  • Valid does not mean it exists: only encoding rules and checksum are verified, no personal data is looked up
  • Do not enter other people’s real ID numbers — protect personal privacy
  • Numbers are processed locally in your browser, never uploaded — no signup, no install

🔒 Local processing · numbers not uploaded · only structure and checksum are checked

← Back to Global ID Validator

FAQ

Q1What is the difference between DNI and NIE?
DNI is the ID number for Spanish citizens (8 digits + letter); NIE is the identity number for foreigners, starting with X/Y/Z. They share the same check-letter algorithm; NIE first converts its prefix letter to a digit.
Q2Does a valid result mean it exists?
No — it only means the check letter is consistent with the number; no real identity is looked up.
Q3Is the number uploaded?
No, everything is computed locally in your browser and the number never leaves your device.