NIE/NIF/CIF Verifier Spain: Spanish Tax ID Validator

Free tool to verify the validity of NIF (Spanish DNI), NIE (foreigners) and CIF (companies) in Spain. Checks the control digit and official format.

Utilities Studio

Want this utility on your website?

Customize colors and dark mode for WordPress, Notion or your own site.

Frequently Asked Questions

Is it safe to enter my NIF or NIE in this tool?

Yes, it is completely safe. Validation is performed entirely in your browser using JavaScript. Your data is never sent to any server or stored in any database.

What is the difference between NIF and CIF?

NIF (Número de Identificación Fiscal) is the current term for all tax IDs. However, CIF (Código de Identificación Fiscal) is still commonly used to refer to the NIF of legal entities (companies and organisations).

How can I find out if a NIF is valid if I don't have the letter?

Enter the 8 digits in our verifier and check whether the letter matches. The algorithm calculates the exact letter by dividing the number by 23.

Does this tool work for NIE numbers starting with Y or Z?

Yes, our verifier supports all NIE formats: the older ones starting with X and the newer ones beginning with Y or Z, applying the official numeric conversion.

Does it validate whether the number actually exists in the tax authority?

No. This tool performs algorithmic and mathematical validation. It confirms the number has a legal structure and correct control digit, but does not query the real census of the Agencia Tributaria.

# The Importance of Verifying NIF, NIE and CIF in Spain

In the administrative and business ecosystem of Spain, tax identification is the cornerstone of all transactions, contracts and public dealings. Whether you are a freelancer issuing invoices, a company managing suppliers, or an individual making a purchase, a reliable NIF, NIE and CIF verifier is an indispensable tool to avoid administrative errors and potential fraud.

# What are NIF, NIE and CIF? Key Differences

  • NIF (Número de Identificación Fiscal): The generic term for tax identification in Spain. For Spanish nationals, the NIF matches the DNI number followed by a control letter (8 digits + 1 letter).
  • NIE (Número de Identidad de Extranjero): The identification code for non-Spanish individuals with tax activity in Spain. Starts with X, Y or Z, followed by 7 digits and a control letter.
  • CIF (Código de Identificación Fiscal): The popular name for the NIF of legal entities (companies, associations). One letter indicating organisation type + 7 digits + control digit or letter.

# How the Validation Algorithm Works

For NIF/DNI, the final letter is obtained by dividing the numeric part by 23 (modulo 23) and mapping the remainder to the sequence TRWAGMYFPDXBNJZSQVHLCKE. For CIF, pairs and doubled odd-position digits are summed to verify the control character. The entire calculation runs in your browser in milliseconds.

# Common Uses of the NIE/NIF Verifier

  • Accounting and Tax Agencies: Verify identifiers before registering clients or suppliers in tax models (303, 347...).
  • E-commerce: Validate the NIF at checkout to issue correct invoices and avoid dirty data.
  • HR Departments: Confirm the NIE of foreign employees before registering them with Social Security.

# Tips for Correct Verification

  • If the verifier reports an error, check if you confused a 0 (zero) with an O (letter) — a very common mistake in NIE numbers.
  • For CIF, always include the initial letter that identifies the entity type (A = S.A., B = S.L., etc.).
  • This tool checks mathematical validity, not whether the number is currently active in the AEAT census.
  • Use the standard format without spaces or hyphens for best results.
Privacy guaranteed: Validation runs entirely in your browser. The numbers you enter are never sent to any server or stored in any database.

Bibliographic References