Skip to main content

How to verify NIF Number in Spain?

This post is also available in:Español中文DeutschPortuguêsFrançais

Verify a Spanish NIF-IVA on the Agencia Tributaria website​

The Agencia Tributaria (AEAT, Spain's tax agency) runs a free lookup, Consulta Operadores IVA intracomunitarios españoles, that tells you whether a Spanish VAT number (NIF-IVA) is in the Registro de Operadores Intracomunitarios (ROI), Spain's register of businesses that trade within the EU. The AEAT's page for non-resident businesses links it under "Gestiones destacadas" as "Consultar operadores intracomunitarios españoles". [1]

Access. In the AEAT's words: "Spanish intra-Community operators: this option does not require electronic identification; you will simply need to enter the VAT tax identification number of the operator you wish to consult." [2] On 2026-11-05 the form loaded with no login and no CAPTCHA; neither the form nor the AEAT help page for it mentions a limit on the number of lookups. The sibling AEAT lookup for non-Spanish EU VAT numbers is different: it needs an electronic certificate or a DNIe (Spanish electronic ID card). [3]

Source snapshot — the official lookup portal: the Agencia Tributaria's 'Consulta Operadores IVA intracomunitarios españoles' form, with the 'Número IVA del operador español a consultar' field after a fixed ES label and the Enviar and Limpiar buttons Source snapshot captured 2026-11-05 — original

Source snapshot — AEAT help for the lookup portal: the Spanish intra-Community operators option does not require electronic identification; you only enter the operator's VAT number Source snapshot captured 2026-11-05 — original

Steps​

  1. Open the Agencia Tributaria lookup, 'Consulta Operadores IVA intracomunitarios españoles'. No electronic identification is needed.
  2. In Número IVA del operador español a consultar, type the 9-character NIF without ES, for example A28015865 for the NIF-IVA ESA28015865. ES is a fixed label next to the field, and the field takes 9 characters. Click Enviar.
  3. Read the certificate: CONSTA means the NIF-IVA is in the ROI today, NO CONSTA means it is not, and 'El campo Nif no es un NIF válido.' means the number was mistyped (see What the result means). The result shows no company name or address. Click the Código Seguro de Verificación to open the PDF certificate and keep it with your records.
  4. Optionally, check the name behind the number on EU VIES: Spain does not release the name or address, so enter the trader's name and company type with the number, and VIES answers Valid, Invalid or Not processed for each field (see Check the name on EU VIES).

What the result means​

The AEAT answers with a certificate, not a search result. On 2026-11-05 the three possible answers looked like this:

You seeIt meansNext step
"CONSTA UN OPERADOR INTRACOMUNITARIO EN ESPAÑA CON EL NÚMERO DE IVA ES…", with a date and a Código Seguro de VerificaciónThe NIF-IVA is in the ROI todayKeep the PDF certificate. To check the name, use VIES (below)
"NO CONSTA NINGÚN OPERADOR INTRACOMUNITARIO EN ESPAÑA CON EL NÚMERO DE IVA ES…", with a date and a Código Seguro de VerificaciónThe number is well formed but is not in the ROI todayRead why a genuine business can be missing before you treat it as invalid
"El campo Nif no es un NIF válido." (no certificate)Wrong length, ES typed into the field, or a check character that does not matchRe-key the 9 characters with no ES and no spaces

A positive result shows "Fecha" (date and time), a 16-character Código Seguro de Verificación (Secure Verification Code, CSV) and the line "La Agencia Tributaria certifica que: A FECHA … CONSTA UN OPERADOR INTRACOMUNITARIO EN ESPAÑA CON EL NÚMERO DE IVA ES…". It shows no company name and no address. The CSV is a link to a one-page PDF certificate that repeats the certification and states: "La autenticidad de este documento puede ser comprobada mediante el Código Seguro de Verificación … en https://www.agenciatributaria.gob.es". The AEAT's document-matching service ("Cotejo de documentos mediante CSV") checks it: every AEAT document carries a code "so that the recipient can check their authenticity and validity", and it must be entered as all 16 characters. [4] Unlike a VIES consultation number, the certificate does not depend on you entering your own VAT number.

A negative result is also a dated certificate with a CSV. It adds a note that to join the ROI the holder must file modelo 036, "sin perjuicio de lo dispuesto por los Territorios Históricos del País Vasco y la Comunidad Foral de Navarra" (without prejudice to the rules of the Basque and Navarre foral territories). It means the number is not in the ROI today. It does not mean the business has no NIF.

Agencia Tributaria certificate for a registered NIF-IVA, showing the date, the Código Seguro de Verificación and the CONSTA line
A positive result (13-02-2024): date, Código Seguro de Verificación and the CONSTA line, with no name or address

Check the name on EU VIES​

The European Commission's VIES checks the same Spanish register, because VIES is "a real-time system": "when you check a number, it is the database of that Member State / Northern Ireland that is being checked" (VIES FAQ Q13), and "There is no VAT database at Community level" (Help). [1] [2] The AEAT says that once a NIF-IVA is assigned, the business "constará en el censo VIES" (will appear in the VIES census). [3]

Spain does not release the name or address. For a valid Spanish number, VIES shows "---" in both fields, which "means that the Member State / Northern Ireland that issued the VAT number does not allow to disclose this information" (Help). VIES FAQ Q22 explains: "For Spanish VAT numbers, the name, address and the type of company need to be entered together with the VAT number to be validated; Spanish database will not provide them automatically." [1]

That is how you check the name. Select ES, type the number, and fill in the trader's name, company type (from ES-1 "Persona física" to ES-18 "Establecimiento permanente de entidad no residente"), street, postcode and city. VIES answers Valid, Invalid or Not processed for each field you filled in. On 2026-11-05, the name "TELEFONICA SA" with company type ES-2 (Sociedad Anónima) came back Valid/Valid against A28015865, while "ACME SL" with ES-3 came back Invalid/Invalid against the same number. Of the AEAT and European Commission services we checked on 2026-11-05, this was the only free name check for a Spanish NIF-IVA that needs no Spanish electronic identification.

What a valid VIES result is worth. VIES confirms validity only "for the current day" (FAQ Q6). If you enter your own VAT number as requester, the reply carries a consultation number to keep as proof of the check. The Commission adds that confirming a number's validity is "only ONE of the elements of evidence" for the intra-EU exemption under Article 138(1) of Directive 2006/112/EC, so it is not a safe harbour on its own. [2] For the full VIES walkthrough, see how to verify an EU VAT number on VIES.

Source snapshot — VIES Help: entering your own VAT number returns a unique consultation number, and a valid result is only ONE of the elements of evidence for the Article 138(1) exemption Source snapshot captured 2026-09-24 — original

Check any Spanish NIF against a name: Comprobación de un NIF de terceros​

The ROI lookup and VIES cover only businesses in the ROI. To check any NIF in the AEAT census against a name, the AEAT offers "Comprobación de un NIF de terceros a efectos censales", one of the modelo 030 procedures. It is not anonymous: "Puedes acceder identificándote con Cl@ve Móvil o con certificado o DNI electrónico" (you sign in with Cl@ve Móvil, an electronic certificate or a DNIe). You can check one NIF, a list of NIFs, or a CSV file of up to 20,000 records. [1]

For a company or other entity, the answer is one of:

  • IDENTIFICADO: the NIF is identified; the service returns the current NIF and the company name (razón social).
  • NO IDENTIFICADO: the NIF is not identified; the service returns what you entered.
  • IDENTIFICADO-BAJA: identified, but the entity is deregistered.
  • IDENTIFICADO-REVOCADO: identified, but deregistered because the NIF was revoked.

For an individual, the answers are IDENTIFICADO, NO IDENTIFICADO-SIMILAR (minor differences in the name; the census name is returned) and NO IDENTIFICADO. [1] The same check is available as a SOAP web service, VNifV2 (see the FAQ).

Source snapshot — AEAT Comprobación de un NIF de terceros: you access it by identifying with Cl@ve Móvil, an electronic certificate or a DNIe Source snapshot captured 2026-11-05 — original

Source snapshot — AEAT Comprobación de un NIF de terceros: the answers for legal persons, IDENTIFICADO, NO IDENTIFICADO, IDENTIFICADO-BAJA and IDENTIFICADO-REVOCADO Source snapshot captured 2026-11-05 — original

Revoked NIFs. The AEAT also publishes free, cumulative downloadable files of revoked and rehabilitated NIFs, with their record layouts. [2] A revoked NIF still passes every format check, but once the revocation is published in the BOE (Spain's official gazette), the number loses "validez a efectos identificativos" (validity for identification) for tax purposes, and banks may not make charges or credits on the holder's accounts unless the NIF is rehabilitated. [3]

Spanish NIF format in one line​

A Spanish NIF has 9 characters. An entity's NIF is a legal-form letter, a seven-digit number and a control character (Orden EHA/451/2008 art. 2). A Spanish national's NIF is the 8-digit DNI and a check letter, and a foreign individual's NIF is the NIE: X, Y or Z, seven digits and a check letter. The NIF-IVA is ES followed by the NIF, and it is assigned only when the business asks to be included in the ROI (Royal Decree 1065/2007 art. 25.1). [1] [2] For the full table of letter keys, the K, L and M NIFs and the check characters, see the Spain tax ID guide.

Source snapshot — number format: Orden EHA/451/2008 art. 2, the NIF of legal persons and entities has nine characters, a legal-form letter, a random seven-digit number and a control character, followed by the letter keys Source snapshot captured 2026-10-12 — original

Source snapshot — number format of the NIF-IVA: Royal Decree 1065/2007 art. 25.1, the NIF is preceded by the prefix ES and assigned when the business asks to join the Register of Intra-Community Operators Source snapshot captured 2026-10-12 — original

Why a genuine Spanish business can come back "NO CONSTA"​

A "NO CONSTA" on the AEAT lookup, or "invalid" on VIES, is not proof that a NIF is fake. Rule out these causes first.

  1. The business never joined the ROI. Inclusion is requested on modelo 036, "By ticking box 582" and entering the date of the first transaction in box 584; "If the Tax Agency has not issued a decision within three months, the application for the requested number may be deemed to have been refused." [1] A business that trades only in Spain has a NIF but no NIF-IVA. The Commission makes the same point for every Member State with a separate intra-EU registration: a number "even if correct, will not be validated through VIES" if its owner is not registered for intra-EU transactions (FAQ Q7). [2]

    Source snapshot — AEAT: a business established on the mainland or the Balearic Islands joins the ROI on Form 036 by ticking box 582 and giving the first-transaction date in box 584; without a decision in three months the application may be deemed refused Source snapshot captured 2026-11-05 — original

  2. The law keeps the business out of the ROI. Article 25.3 of Royal Decree 1065/2007 says no NIF-IVA is assigned to, among others, businesses that only make supplies without a right to deduct and businesses only under the special scheme for agriculture, livestock and fishing, as long as their intra-EU purchases of goods are not subject to Spanish VAT (Ley 37/1992 art. 14: below EUR 10,000 a year unless they opt in), and non-established businesses whose Spanish operations are all ones for which the customer is liable for the VAT (Ley 37/1992 art. 84.Uno.2.º–4.º). [3]

  3. The business is in the Canary Islands, Ceuta or Melilla. The AEAT's ROI obligation applies to businesses established in the territory of Spanish VAT, "the mainland and the Balearic Islands". [1] Ley 37/1992 art. 3 excludes the Canary Islands, Ceuta and Melilla from that territory. [4] Read together, a business established only there has a normal NIF, but the ROI rule does not reach its activity there, so a missing NIF-IVA is to be expected.

    Source snapshot — Ley 37/1992 art. 3: Ceuta, Melilla and the Canary Islands are excluded from the territory where Spanish VAT applies Source snapshot captured 2026-11-04 — original

  4. The NIF is revoked or deregistered. It still looks correct. Use the revoked-NIF files or Comprobación de un NIF de terceros (IDENTIFICADO-BAJA, IDENTIFICADO-REVOCADO), above.

  5. A typing error. A wrong character usually gives "El campo Nif no es un NIF válido." rather than NO CONSTA, but a mistyped digit can still produce another well-formed number. Check the number against the invoice.

Businesses with their tax domicile in the Basque Country or Navarre may file their census declarations, including ROI inclusion, with the foral tax authority rather than the AEAT; RD 1065/2007 additional provision 4 sets out when they must file with the AEAT instead. [5] The AEAT's negative-result note and its ROI page both refer to these foral rules. [6]

Check a NIF

Enter a NIF to see whether it’s registered and who it belongs to.

Validate more tax IDs with a free account →

Frequently Asked Questions​

My Spanish supplier's documents show a CIF number starting with B. Is this the same as their NIF?​

Yes. 'CIF' was the entity code under Decreto 2423/1975, which Royal Decree 1065/2007 repealed with effect from 1 January 2008; since then the number is called the NIF. Most entities kept their nine characters. For entities whose legal-form letter changed under the new keys, Orden EHA/451/2008 required the AEAT to notify the new NIF during 2008. An entity's NIF does not change unless its legal form or nationality changes. If you hold an old number whose first letter later changed, the AEAT's VNifV2 identification web service returns the entity's current NIF when the old one is identified. Check the number on the Agencia Tributaria lookup or on EU VIES exactly as you would any NIF-IVA. [1] [2] [3] [4]

I searched a Spanish supplier's NIF-IVA on EU VIES and got no result. Does this mean the company is fraudulent?​

Not necessarily. A Spanish NIF-IVA exists only once the business asks to be included in the Registro de Operadores Intracomunitarios (ROI), by ticking box 582 on modelo 036; if the AEAT has not decided within three months, the request may be deemed refused. A business that trades only in Spain therefore has a NIF but no NIF-IVA: it shows as invalid in VIES and as 'NO CONSTA' on the Agencia Tributaria lookup. Article 25.3 of Royal Decree 1065/2007 also keeps some businesses out of the ROI, such as those that only make supplies without a right to deduct, while their intra-EU purchases of goods stay below the EUR 10,000 a year threshold of Ley 37/1992 art. 14. To check a domestic NIF against the business's name, the AEAT's route is 'Comprobación de un NIF de terceros a efectos censales', which covers any NIF in the AEAT census but needs Cl@ve Móvil, an electronic certificate or a DNIe. The AEAT also publishes free downloadable files of revoked NIFs. [1] [2] [3] [4]

Should I use EU VIES or the Agencia Tributaria lookup before issuing a zero-rated intra-community invoice?​

Both answer the same question, whether the number is in the Spanish ROI today, and both are free. VIES is a real-time system: when you check a Spanish number, it is the Spanish database that is queried, and there is no VAT database at Community level. The AEAT states that a business assigned a NIF-IVA 'constará en el censo VIES' (will appear in the VIES census). VIES gives a consultation number if you enter your own VAT number as requester; the AEAT lookup gives a PDF certificate with a Secure Verification Code without asking who you are. VIES confirms validity only for the current day, so check at the time of the transaction and keep the record. A valid result is not a safe harbour on its own: the European Commission says confirming a VAT number's validity is only ONE of the elements of evidence supporting the exemption of intra-community supplies of goods under Article 138(1) of Directive 2006/112/EC. Because Spain does not release the name and address through VIES, use the VIES name and company-type fields to confirm that the number belongs to your customer. [1] [2] [3]

A Spanish freelancer invoiced me using an NIE starting with X or Y as their NIF. Is this correct?​

Yes. Under article 20.1 of Royal Decree 1065/2007, the NIF of every individual without Spanish nationality is the foreigner identity number (NIE) assigned to them; it does not depend on registering as self-employed. An NIE is X, Y or Z, seven digits and a check letter, and it is as valid on an invoice as any other NIF. It appears in VIES or on the Agencia Tributaria lookup only if its holder has been included in the ROI. To check it against the person's name, use the AEAT's Comprobación de un NIF de terceros (Cl@ve Móvil, certificate or DNIe). Census registrations and changes are filed on modelo 036: the simplified modelo 037 was abolished with effect from 3 February 2025. [1] [2] [3]

The NIF my Spanish counterparty provided starts with N or W, and my validation library rejects it. Are these valid?​

Yes. In the letter keys of Orden EHA/451/2008, N identifies a foreign entity and W a permanent establishment of a non-resident entity. Both have the standard nine characters: a letter, a seven-digit number and a control character. A format check that accepts only the letters for Spanish legal forms will reject them wrongly. Like any NIF, an N or W number appears in VIES and on the Agencia Tributaria lookup only if its holder is in the ROI; otherwise, use the AEAT's Comprobación de un NIF de terceros or its VNifV2 web service, both of which need Spanish electronic identification. [1] [2]

Spain's SII rejects our invoice because the customer's NIF is not in the AEAT census. How do we fix this?​

It depends on the customer. For a counterparty with no NIF assigned in Spain, such as a foreign customer, the AEAT's SII FAQ says to use the IDOtro block with the country code, an identification type and the number. The types are 02 NIF-IVA, 03 passport (Pasaporte), 04 official identity document issued by the country or territory of residence, 05 residence certificate and 06 other evidentiary document; an EU customer's VAT number is type 02. For a Spanish customer whose NIF is correct but not in the AEAT census, the AEAT's technical FAQ says that once an issued invoice has been rejected on a second retry, you resend it through IdOtro with country code ES, identification type 07 (No censado), the customer's NIF and name. The invoice is then recorded as 'aceptada con errores' (accepted with errors), to be corrected once the information is available. A format error in the NIF still means the invoice is rejected. [1] [2]

Source snapshot — AEAT SII FAQ §2.16: IDOtro identification types 02 NIF-IVA, 03 Pasaporte, 04 to 06, and 07 No censado for a Spanish individual customer whose correct NIF is not in the census, recorded as accepted with errors Source snapshot captured 2026-11-05 — original

The Agencia Tributaria's NIF web service (VNifV2) needs a certificate. Which certificates does it accept, and what are the alternatives?​

The AEAT's technical manual for VNifV2, the 'Web Service de Calidad de datos identificativos', says it requires a personal certificate admitted by the AEAT's electronic office, such as public-employee or FNMT certificates, and that certificates of a company's representatives are also accepted, whatever the person's position in the company. It can also be called with a seal certificate (certificado de sello) through the www10 address. One request can identify up to 20,000 taxpayers. The same check is available on the web as Comprobación de un NIF de terceros, with Cl@ve Móvil, a certificate or a DNIe. Of the AEAT and European Commission services we checked on 2026-11-05, the free options that need no Spanish electronic identification are the Agencia Tributaria ROI lookup and EU VIES with its name and company-type fields, and both cover only businesses in the ROI. [1] [2] [3]

Source snapshot — AEAT VNifV2 technical manual: the service needs a personal certificate admitted by the AEAT electronic office (public-employee or FNMT), company representatives' certificates are accepted, and a seal certificate can be used through the www10 address Source snapshot captured 2026-11-05 — original

I sell digital services to Spanish customers. Do I need to verify their NIF, and does it change whether I charge Spanish VAT?​

It matters for business customers. For services whose place of supply depends on whether the customer is a taxable person, Article 18 of Implementing Regulation (EU) No 282/2011 lets a supplier, unless it has information to the contrary, treat an EU customer as a taxable person (a) where the customer has given its VAT number and the supplier obtains confirmation of the validity of that number and of the associated name and address under Article 31 of Regulation 904/2010, or (b) where the customer has applied for a number but not yet received it, and the supplier obtains other proof that the customer is a taxable person. Under Article 18(2), a customer who has not given a VAT number may be treated as a non-taxable person. Because VIES shows '---' for Spanish names and addresses, enter the customer's name and company type in VIES to get the name confirmation. For sales to private individuals on the Spanish mainland or the Balearic Islands there is no NIF to check. Spanish VAT, at the 21% standard rate as at 2026-11-05 (Ley 37/1992, art. 90), generally applies; an EU supplier established in only one other Member State whose cross-border B2C distance sales of goods and telecoms, broadcasting and electronic services within the EU stayed within EUR 10,000 (excluding VAT) in the previous calendar year and have not exceeded it in the current year, that ships any goods it sells at a distance only from that Member State, and that has not opted in that Member State for taxation at destination, charges its home VAT on those services instead (Ley 37/1992, arts. 70.Uno.4.º and 73). The Canary Islands, Ceuta and Melilla are outside Spanish VAT. [1] [2] [3] For the OSS itself, see the OSS guide.


How Lookuptax can help you in NIF validation?

Lookuptax NIF validation checks Spanish NIFs and other tax IDs against official sources such as VIES, so you can verify customers and suppliers in bulk and keep a record of each check.