How to use DNI letter calculator
- 1
Type the eight digits
The page opens on the DNI letter calculator. Enter the number with or without dots; shorter old numbers are padded with zeros.
- 2
Read the full NIF
The number appears with its letter, ready to copy, together with a check that confirms it.
- 3
Switch to NIE if needed
For a foreign resident choose NIE and type X, Y or Z followed by seven digits.
- 4
Check a list
Paste DNIs or NIEs one per line on the Check tab to find every wrong or missing letter at once.
Limits and Pro
Free: one calculation as you type, and checks of up to 10,000 DNIs, NIEs or company NIFs pasted at once.
Pro hides the ads; the calculator has no limits to lift. See Pro
About DNI letter calculator
The letter at the end of a Spanish DNI is not chosen: it is the remainder of the eight-digit number divided by 23, looked up in the fixed sequence TRWAGMYFPDXBNJZSQVHLCKE. The Ministry of the Interior's own example is 12345678, whose remainder is 14 and whose letter is therefore Z. Because the letter depends on every digit, it catches every typo in a single digit, which is why banks, the tax agency and online forms reject a DNI with the wrong one.
Foreign residents' NIE numbers use the same table after replacing the leading X, Y or Z with 0, 1 or 2, so X1234567 is computed as 01234567. Only 23 letters can appear: I, O, U and Ñ never do.
This page opens on the calculator: type the digits of a DNI, with or without dots or a leading zero, and the full NIF appears with its letter. Switch the document to NIE to calculate a foreigner's number, or to the company NIF, which follows a different rule: a letter for the legal form, seven digits and a control character from a Luhn sum. The Check tab takes a whole column of DNIs pasted from a spreadsheet and marks every wrong letter with the one it should have been.
A correct letter only proves the number is consistent. Whether a DNI was actually issued, or to whom, is known only to the Policía Nacional, which this page never asks.
Privacy
The DNI and NIE digits you type are turned into letters by this page itself. Nothing is sent to any server or kept after you leave, so it is safe to use with real numbers from your own records.