Spanish Tax ID (NIF): Complete Structure, CIF Transition & Trade Invoicing Guide
The Spanish Tax Identification Number (*Número de Identificación Fiscal* or NIF) is the universal fiscal identifier issued by the Spanish Tax Agency (*Agencia Estatal de Administración Tributaria - AEAT*). Whether you operate a Spanish company (SL or SA), are a sole trader (*autónomo*), or an international supplier exporting custom garments into Spain, a validated NIF is legally required for customs clearance (DUA), European EORI registration, and compliant commercial invoicing.
Spanish Corporate NIF Anatomy: Character-by-Character Breakdown
A Spanish company NIF contains 9 structured positions revealing its legal structure, province of incorporation, and algorithmic verification key:
1 Entity Legal Type
Identifies corporate form (e.g. A for Corporation, B for Limited Liability S.L., N for non-resident foreign company).
2 Provincial Code (2 Digits)
National Institute of Statistics (INE) code for province of origin (e.g. 28 Madrid, 08 Barcelona, 46 Valencia).
3 Sequential Digits (5 Digits)
Chronological registration number assigned in the AEAT provincial tax census.
4 Check Character
Calculated algorithmic digit or letter confirming the mathematical validity of the tax ID.
What is the Spanish NIF and Why it Replaced the CIF
The NIF is the primary tax and customs identity key required for all trade with Spain:
Universal Fiscal Identifier
Mandatory for corporate tax, personal income tax (IRPF), Value Added Tax (IVA 21%), and Spanish social security administration.
Royal Decree 1065/2007
Unified all corporate codes under the NIF framework in 2008, officially retiring the separate corporate CIF terminology.
Customs Clearance Essential
The buyer's Spanish NIF is required on commercial invoices and Single Administrative Documents (DUA) for clearance at Valencia, Algeciras, and Barcelona.
Intra-Community VIES
Enrolled on the Spanish Intra-Community Operators Registry (ROI), enabling EU-wide VAT validation as `ES` + NIF.
Comparison: NIF vs CIF vs NIE vs DNI
Clear distinctions across Spanish fiscal and legal terminology:
NIF
Tax Identification Number
Official legal term for all taxpayers in Spain: individual citizens, foreign residents, and commercial corporations.
CIF
Fiscal Identification Code
Historical term for companies abolished in 2008. Still used in everyday business conversation to describe a company's NIF.
NIE
Foreigner Identity Number
Issued by the Spanish police to foreign residents and business operators. Acts directly as their personal NIF for tax filings.
DNI
National Identity Document
Identity card for Spanish citizens. The 8 digits plus 1 control letter serve directly as their personal NIF.
Spanish Corporate Entity Letter Prefixes
The initial letter in a Spanish corporate NIF reveals its legal structure under commercial law:
| Prefix | Legal Entity Type in Spain | Commercial Context |
|---|---|---|
| A | Sociedades Anónimas (S.A.) | Public limited companies, listed corporations, large industrial enterprises |
| B | Sociedades de Responsabilidad Limitada (S.L.) | Standard private limited companies, SMEs, brand distributors, fashion retailers |
| C | Sociedades Colectivas | Commercial general partnerships with unlimited liability |
| D | Sociedades Comanditarias | Commercial limited partnerships |
| E | Comunidades de Bienes | Joint property management entities and small shared businesses |
| F | Sociedades Cooperativas | Worker cooperatives, agricultural producers, and service cooperatives |
| G | Asociaciones y Fundaciones | Non-profit associations, sports clubs, federations, and foundations |
| J | Sociedades Civiles | Civil partnerships and collective professional services |
| N | Foreign Entities (Without Permanent Establishment) | International corporations registered in Spain for VAT or import purposes |
| W | Permanent Establishments of Non-Resident Entities | Physical branch offices and operating facilities of foreign corporations |
Spanish NIF to European EORI Number Mapping
Under UCC Regulation EU 952/2013, customs clearance in Spain requires an active EORI identifier:
Active AEAT Census
The Spanish company must be registered on the AEAT tax census as an active commercial entity.
Formula: ES + NIF
Spanish customs builds the EORI code by prefixing country code `ES` to the 9-character NIF (e.g. `ESB12345678`).
EU EOS Database
DG TAXUD validates the EORI across all European Union member state border inspection posts.
DUA Clearance with REX
The Spanish customs broker files the DUA using this EORI, applying PHShirt's REX statement for 0% GSP+ duty.
Want complete technical details on the EU EORI system?
Read our comprehensive guide to Economic Operators Registration and Identification.
Commercial Invoicing Rules for Trade with Spain
Under Royal Decree 1619/2012, import invoices must contain specific mandatory tax data:
Spanish Importer
- Full registered legal corporate name
- Complete 9-character NIF / CIF
- Full fiscal address and postal code
- European EORI code (`ES` + NIF)
PHShirt (Philippines)
- Registered corporate exporter name
- Philippine Tax Identification Number (TIN)
- EU Registered Exporter (REX) number
- Factory and dispatch facility address
Garment Line Items
- Harmonized TARIC code (e.g. 6109.10)
- Garment description & fiber breakdown
- Quantities and size breakdown
- Unit prices and total value in EUR or USD
Incoterm 2020 Protocol
- Agreed Incoterm rule (FOB, CIF, DAP)
- Port of loading (Manila / Davao)
- Port of arrival (Valencia / Algeciras)
- Certified REX statement on origin
Official Verification Services for Spanish NIF & EORI
Direct verification links from the Spanish Government and European Commission:
AEAT Census Portal
Official Spanish Tax Agency tool to verify if a third-party NIF is active and matches the registered corporate name.
Open Sede AEAT →EU VIES Validator
European Commission service to check intra-community VAT numbers across Spain and the 27 EU member states.
Validate on VIES →DG TAXUD EORI Validation
Central EU customs database to verify if an `ES` + NIF code is authorized for border clearance.
Validate EORI →AEAT Customs Portal
Official customs department portal for electronic Single Administrative Document (DUA) filing.
AEAT Customs Portal →Frequently Asked Questions: Spanish Tax ID (NIF)
Technical guidance for international trade teams, sourcing agents, and financial controllers:
Is a CIF still legally valid in Spain?
The term CIF was formally abolished by Royal Decree 1065/2007, unifying all codes under the NIF framework for legal entities. The alphanumeric format remained unchanged, and Spanish businesses still colloquially use the word CIF. On legal invoices and customs entries (DUA), it must be labeled as NIF.
What is the difference between a Spanish NIF and NIE?
An NIE (*Número de Identidad de Extranjero*) is an identification code issued by the Ministry of the Interior to foreign nationals. For tax and customs purposes before the AEAT, a foreign individual's NIE acts directly as their personal NIF.
Can a foreign company get a Spanish NIF without a local subsidiary?
Yes. Foreign corporations operating in Spain without a permanent establishment can apply to the AEAT for an *NIF with letter N* (foreign entity without permanent establishment), allowing them to settle Spanish VAT and act as an importer of record.
Why is the buyer's NIF mandatory for export shipments from the Philippines?
The Spanish Single Customs Window (VUA) automatically rejects any customs declaration (DUA) that lacks the importer's registered NIF/EORI. Missing NIF details cause immediate terminal holds and demurrage charges at Spanish ports.
Does having a Spanish NIF guarantee 0% duty under EU GSP+?
No. The NIF identifies the Spanish taxable entity, but 0% duty on apparel requires the Philippine manufacturer (PHShirt) to hold an active Registered Exporter (REX) number and certify origin on the commercial invoice.
How can I confirm if a Spanish company's NIF is active?
You can verify it instantly on the AEAT electronic headquarters (*Sede Electrónica de la Agencia Tributaria*) using their census check tool (*Comprobación de un NIF de terceros*).
Ready to Source Apparel from the Philippines to Spain?
PHShirt prepares fully compliant export documentation, including your verified Spanish NIF, REX origin declarations for 0% EU GSP+ duty, REACH chemical compliance certifications, and door-to-port or door-to-door delivery across Spain.
