Spanish NIF, CIF and NIE validator

Type a DNI, an NIE or a company's CIF: we check the format and the control letter or digit and tell you what kind of person or entity it is.

This tool checks the format and the control letter or digit. It does not check that the number is registered with the Spanish Tax Agency: a valid NIF does not mean it exists.

Everything is calculated in your browser: we do not send or store what you type.

How it works

In a DNI, the letter comes from dividing the eight digits by 23 and looking the remainder up in a table. In an NIE, the first letter (X, Y, Z) is replaced by 0, 1 or 2 and the same calculation is made.

In a CIF, the first letter shows the type of entity, the next seven digits are combined with an odd and even calculation and the last character is the control: a digit, a letter or either, depending on the entity type.

Frequently asked questions

What is the difference between NIF, CIF and NIE?

The NIF is the tax identification number in general. For Spanish individuals it is the DNI with its letter, for foreigners it is the NIE, and for companies and other entities it is the former CIF, which has been part of the NIF since 2008.

Does a valid NIF mean it exists?

No. This check only verifies that the number is well formed: that the letter or control digit matches. To know whether it is registered you have to ask the Tax Agency.