## Spanish Fiscal Identity Number

Spanish Fiscal Identity Number ("Número de Identificación Fiscal", or "NIF" in Spanish) consists of eight digits followed by a check letter for Spanish people with DNI, or a letter, seven digits and a check letter for the rest of individuals.

If we restrict ourselves to DNI, the check letter is one of the following 23 uppercase letters:

That is, all the letters from A to Z except I, O and U. Letters I and O are not used to avoid confusion with the numbers 1 and 0, and U is not used so that the total number of letters is 23, which is a prime number and better suited to calculate the check letter.

In order to calculate this letter, we must take the DNI number modulo 23 (that is, calculate the remainder on division of that number by 23), and use that result in the following table:

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

T | R | W | A | G | M | Y | F | P | D | X | B | N | J | Z | S | Q | V | H | L | C | K | E |

If you want to see the NIF letter corresponding to a given DNI, please enter the number here: