Spanish DNI and NIE letter

Calculate or check the control letter of a Spanish DNI or NIE.

Loading tool…

Recommended next step

Complete your calculation

After using Spanish DNI and NIE letter, continue with 50/30/20 rule.

Open next

Tools selected to complete the same task.

4 steps

Tool guide

Spanish DNI and NIE letter: how it works

Practical information to understand the result and use this tool correctly.

About Spanish DNI and NIE letter

The control letter is the official 23-letter table at the remainder of the number divided by 23: TRWAGMYFPDXBNJZSQVHLCKE.

A NIE replaces the first letter before the division: X is 0, Y is 1, Z is 2, then the seven digits.

Eight-digit DNI values keep leading zeros. A missing letter is filled in. A wrong letter is flagged with the expected one. Empty input stays blank.

How to use it

  1. 1Type a DNI such as 12345678 or a NIE such as X1234567.
  2. 2Add the letter only if you want to check it.
  3. 3Copy the full number with the control letter.

Frequently asked questions

What letter does 12345678 get?
Z. 12345678 divided by 23 leaves remainder 14, and index 14 in the table is Z.
How is a NIE letter calculated?
X, Y, and Z become 0, 1, and 2. X1234567 is treated as 01234567, which gives L.
Does this store the number?
No. The check runs in the browser and nothing is uploaded.