Back to countries
Country guide

Spain

Spain uses the N煤mero de Identificaci贸n Fiscal (NIF) as the tax identifier for natural persons and for legal persons or entities. For natural persons, the NIF generally corresponds to the DNI for Spanish nationals or the NIE for foreign nationals; the Tax Administration assigns K, L, or M NIFs in specified cases where the holder does not have a DNI or NIE. Legal persons and entities without legal personality receive a separate nine-character NIF.

ES ESP 6 TIN types Last reviewed 2026-05-14

TIN types

6 published formats. Open a type to see examples, structure details, and official sources.

Validate Spain TIN
Spain NIF for Spanish Nationals (DNI)
Current Individuals

Ministerio del Interior (Ministry of the Interior)

NIF used by Spanish natural persons when their tax identifier is their DNI number plus the control letter.

Details
Examples
12345678Z
Where to find it

On the Spanish national identity document and on Spanish tax documents using the holder's NIF.

Common names
DNI NIF NIF-DNI
Structure
1-8 DNI number Eight-digit DNI number; leading zeros may appear.
9 Control letter Letter derived from the DNI number.
Official source
oecd.org sede.agenciatributaria.gob.es interior.gob.es boe.es
Spain NIF for Foreign Residents (NIE X/Y/Z)
Current Individuals

Direcci贸n General de la Polic铆a (Directorate-General of Police), Ministerio del Interior (Ministry of the Interior)

NIF used by foreign natural persons when their Spanish tax identifier is their NIE.

Details
Examples
X1234567L
Where to find it

On the foreign identity card, residence permit, EU citizen registration certificate, or the certificate issued by the Ministry of the Interior.

Common names
NIE NIF-NIE
Structure
1 Series letter X, Y, or Z series used for NIE numbers.
2-8 Serial Seven-digit NIE body.
9 Control letter Letter derived from the series and serial digits.
Official source
oecd.org sede.agenciatributaria.gob.es interior.gob.es boe.es
Spain NIF for Minors (letter K)
Current Individuals

Agencia Estatal de Administraci贸n Tributaria (State Tax Administration Agency)

NIF assigned by the Tax Administration to Spanish residents under 14 who do not have a DNI and need a tax identifier.

Details
Examples
K1234567J
Where to find it

On the Tax Administration document assigning the NIF and related tax correspondence.

Common names
NIF K
Structure
1 Type letter K identifies this NIF type for Spanish residents under 14 without a DNI.
2-8 Identifier body Seven alphanumeric characters assigned by the Tax Administration.
9 Verification character Alphabetic verification character.
Official source
oecd.org sede.agenciatributaria.gob.es boe.es
Spain NIF for Spaniards Residing Abroad (letter L)
Current Individuals

Agencia Estatal de Administraci贸n Tributaria (State Tax Administration Agency)

NIF assigned by the Tax Administration to Spanish nationals resident abroad who are not required to obtain a DNI and need a Spanish tax identifier.

Details
Examples
L1234567J
Where to find it

On the Tax Administration document assigning the NIF and related tax correspondence.

Common names
NIF L
Structure
1 Type letter L identifies this NIF type for Spanish nationals resident abroad without a DNI.
2-8 Identifier body Seven alphanumeric characters assigned by the Tax Administration.
9 Verification character Alphabetic verification character.
Official source
oecd.org sede.agenciatributaria.gob.es boe.es
Spain NIF for Foreign Individuals without NIE (letter M)
Current Individuals

Agencia Estatal de Administraci贸n Tributaria (State Tax Administration Agency)

NIF assigned by the Tax Administration to foreign natural persons who do not have a NIE but need a Spanish tax identifier.

Details
Examples
M1234567G
Where to find it

On the Tax Administration document assigning the NIF and related tax correspondence.

Common names
NIF M
Structure
1 Type letter M identifies this NIF type for foreign individuals without a NIE.
2-8 Identifier body Seven alphanumeric characters assigned by the Tax Administration.
9 Verification character Alphabetic verification character.
Official source
oecd.org sede.agenciatributaria.gob.es boe.es
Spain NIF for Legal Persons and Other Entities
Current Entities

Agencia Estatal de Administraci贸n Tributaria (State Tax Administration Agency)

NIF assigned by the Tax Administration to legal persons, entities without legal personality, foreign entities, and qualifying permanent establishments in Spain.

Details
Examples
A12345674 N1234567D
Where to find it

On Tax Administration census or NIF assignment documents and related tax correspondence.

Common names
NIF CIF
Structure
1 Entity key Letter identifying the legal form, foreign-entity status, or permanent-establishment status.
2-8 Identifier body Seven-digit number assigned to the entity.
9 Control character Digit or letter determined by the entity key.
Official source
oecd.org sede.agenciatributaria.gob.es boe.es caib.es