Skip to content

Spanish NIF, NIE and CIF checker.

In Spain every person and company has a tax ID, the NIF: Spaniards use their DNI, foreigners their NIE, and companies a NIF still called CIF. Type one to see which it is, whether its check character matches and which one it should have.

With or without spaces, dots and hyphens. The ES prefix of an EU VAT number works too.

Try an example

Check result

Valid DNI: the letter matches.

Its parts
  • 12345678Number
  • ZCheck
TypeThe tax ID of a Spanish national, from their identity card.
DNI
Without separators
12345678Z
As an EU VAT numberOnly valid in VIES if it is on the register of intra-EU operators (ROI).
ES12345678Z
Ask Melso

An estimate under 2026 rules. Your case may have details that change it, so check before you decide. Calculated in your browser: nothing you type is sent or stored.

  1. We clean the number.

    Spaces, dots and hyphens go, and so does the ES prefix of an EU VAT number. A NIF has 9 characters.

  2. We see which kind it is.

    A number first means a DNI; X, Y or Z means an NIE. One of the letters in Orden EHA/451/2008 means a company or other entity (the old CIF), and the letter gives its legal form.

  3. The DNI and NIE letter.

    The number is divided by 23 and the remainder picks the letter from TRWAGMYFPDXBNJZSQVHLCKE. In an NIE, X, Y and Z count as 0, 1 and 2.

  4. A company’s check character.

    Of its seven digits, those in even positions are added, and those in odd positions are doubled with the digits of each double added. The check is what is left to the next ten, as a digit, a letter or either, depending on the kind of entity.

Would you rather Melso did it?

Your agent gathers invoices and expenses on WhatsApp, and your advisors prepare and file your taxes after you approve them in the app.

Questions

What people ask us most.

The DNI number is divided by 23 and the remainder, from 0 to 22, picks the letter from TRWAGMYFPDXBNJZSQVHLCKE. For example, 12345678 divided by 23 leaves 14, which is Z.

Leave the maths to your tax advisor.

Tell us about your situation. We confirm the scope before work starts.