España · NIF / NIF-IVA
Spanish NIF Checker
Check a Spanish Número de Identificación Fiscal (NIF) for correct format and control character, and confirm whether it is registered for intra-EU VAT.
What is a Spanish NIF?
The NIF (Número de Identificación Fiscal) is Spain’s tax ID: nine characters for every taxpayer. Individuals use their DNI (8 digits + letter) or NIE (X/Y/Z + 7 digits + letter); companies have a letter for the legal form, 7 digits and a control character — for example A28015865. With ES in front it is the intra-EU VAT number.
Spanish NIF format
Nine characters. For companies: a legal-form letter, seven digits and a control character.
(A = S.A., B = S.L.)
character
Example: A28015865 (Telefónica, S.A., as printed in its legal notice). Intra-EU form: ESA28015865.
- Three shapes: DNI: 8 digits + letter. NIE: X, Y or Z + 7 digits + letter. Legal entities: letter + 7 digits + control character. K, L and M prefixes are used for individuals with neither a DNI nor an NIE.
- Control character: For DNI and NIE it is a letter calculated with modulus 23. For companies it is a digit or letter; the formula is not officially published, but most valid numbers pass a widely used, unofficial Luhn-style check.
- Province digits: NIFs assigned since 1 July 2008 use a random seven-digit number. Older NIFs keep their original digits, which often start with a province code (28 = Madrid in A28015865).
- ES prefix: The ES prefix is only valid for businesses registered for intra-EU trade. A NIF that is not in that register is still a valid Spanish tax ID — it just cannot be used for EU zero-rated supplies.
How to check a Spanish NIF
- 1 Get the NIF from the company’s invoice or its website legal notice (aviso legal).
- 2 Enter it above, with or without ES. The checker validates the format and control character, then checks whether the NIF is registered for intra-EU VAT.
- 3 A “not registered” result can mean the business only trades in Spain — ask your customer for its NIF-IVA before zero-rating an EU supply.
- 4 Want to run the official checks yourself? Our Spain NIF verification guide walks through them step by step.
Frequently Asked Questions
Is a CIF the same as a NIF? (¿Diferencia entre NIF y CIF?)
Yes, in practice. “CIF” was the code for legal entities until Royal Decree 1065/2007 replaced it from 1 January 2008; since then companies have a NIF. Most kept the same nine characters, though entities whose letter changed under Orden EHA/451/2008 were given a new number.
How do I check a Spanish company’s NIF? (¿Cómo comprobar el NIF de una empresa?)
Enter it in the checker on this page: it validates the format and control character, then checks whether the NIF is registered for intra-EU VAT. A company that only trades domestically has a valid NIF but shows as not registered. For the official checks, see our Spain NIF verification guide.
What does the first letter of a company NIF mean?
It shows the legal form: A is a sociedad anónima, B a sociedad limitada, C a general partnership, F a cooperative, G an association, H an owners’ community, J a civil partnership, U a temporary joint venture, N a foreign entity and W the permanent establishment of a non-resident. I, O and T are not used.
What is a NIF intracomunitario (NIF-IVA)?
It is the NIF with ES in front, for example ESA28015865. It only exists once the business is entered in the register of intra-Community operators (ROI). A Spanish business supplying goods to other EU countries must be in the ROI; the exemption also needs the customer’s valid EU VAT number and reporting on modelo 349.
How is the DNI or NIE letter calculated?
Divide the 8-digit number by 23 and map the remainder (0–22) to the letters TRWAGMYFPDXBNJZSQVHLCKE. For an NIE, first replace the leading X, Y or Z with 0, 1 or 2. The Ministry of the Interior publishes this rule.
Why does the check show no company name for Spanish numbers?
Spain does not allow the EU VIES system to display the holder’s name or address, so even valid Spanish numbers are confirmed without them. It can still confirm that the number is valid and, if you supply a name, whether it matches.
Last reviewed: , against official sources.
Validate EU VAT numbers at scale
Check Spanish NIF-IVA and EU VAT numbers against VIES in one API call, plus tax IDs in 120+ other countries.