en

DNI/NIE Spain

Check the control letter of a Spanish DNI or NIE locally in your browser - with no upload, even offline.

Running locally on your device ...

This tool performs only a mathematical checksum/format check. It is not an official identity, existence, or registry verification and not a request to any authority. Any additional information derived from the number's structure is based solely on the publicly documented encoding logic of the issuing authority.

Running locally on your device ...

0%

Is my file uploaded?

No. Everything runs in your browser - your file never leaves your device. How this is verifiable

No upload100% local
Your content stays with youno third-party access
Hosted in GermanyGlobal Content Delivery
Independently auditedTLS A+ · HTTP headers A+

The DNI (Documento Nacional de Identidad, 8 digits + control letter) identifies Spanish nationals; the NIE (Numero de Identidad de Extranjero, a leading X/Y/Z + 7 digits + control letter) identifies foreign residents. Both share the same official algorithm: the 8-digit number modulo 23, the remainder maps to a letter via a fixed table - the letters I, N, O and U deliberately never appear in it (risk of confusion with 1, Ñ, 0 and the letter N).

For a NIE, the leading letter is replaced by a digit before the calculation (X becomes 0, Y becomes 1, Z becomes 2), and the resulting 8-digit number is treated exactly like a DNI. This tool auto-detects from the first character whether a DNI or a NIE number was entered. Spaces and dashes in the input do not matter.

The whole calculation runs entirely locally in your browser in pure JavaScript - the number is not uploaded, not stored, and no foreign library is loaded from a CDN. You can download the result as a JSON file or read it directly.

Specifications

Specifications
Input formatsText input
Output formatJSON
Batch processingNo
ProcessingLocally in your browser (JavaScript)
File uploadNone

In 3 steps

  1. Paste the DNI or NIE number into the text field.
  2. The tool auto-detects the type and recomputes the control letter.
  3. Read the result or download it as JSON.

Limitations: This tool performs only a mathematical checksum/format check. It is not an official identity, existence, or registry verification and not a request to any authority. Any additional information derived from the number's structure is based solely on the publicly documented encoding logic of the issuing authority.

FAQ

Is my DNI or NIE number uploaded?

No. The check runs entirely locally in your browser; the number never leaves your device and is not stored.

Does a valid result confirm the person exists?

No. The tool only checks the mathematical control letter and the format - not a lookup against an official registry.

Why do the letters I, N, O and U never appear as the control letter?

To avoid confusion: I with 1, O with 0, and because of the Spanish letter Ñ, N is also skipped. The official table deliberately leaves these four out.

How does the tool tell a DNI from a NIE apart?

By the first character: input starting with a digit is checked as a DNI; input starting with X, Y or Z is checked as a NIE.

Related tools

CURP/RFC Mexico · Calculate a checksum · UUID generator