Skip to main content
Practical guide for completing census form 036

Individuals

Natural persons of Spanish nationality

General rule: DNI

As a general rule, the NIF of natural persons of Spanish nationality is the number of their National Identity Document ( DNI ) followed by the corresponding code or verification character, consisting of a capital letter (article 19.1 of RGAT ). It follows the nine-character format: eight digits (taking into account that the first ones may be zeros) plus a control letter.

This number is assigned by the Ministry of the Interior and its basic regulations are set out in Royal Decree 1553/2005, of 23 December, which regulates the issuance of the national identity document and its electronic signature certificates, which has been modified by Royal Decree 1586/2009, of 16 October and by Royal Decree 869/2013, of 8 November, regarding the documents to be presented to prove address, electronic signature and validity period for minors.

Royal Decree 1553/2005 is issued with two objectives. Firstly, it seeks to integrate and update the regulations on national identity documents that existed at the time of its publication. Secondly, it regulates the new effects and uses of the DNI to electronically prove the identity and other personal data contained therein of its holder.

Regulation of the issuance of the national identity document

Until the entry into force of Royal Decree 1553/2005, the regulatory regulations governing the basic aspects of the DNI were contained in Decree 196/1976, of February 6, which regulates the national identity document.

Apart from the regulation of the electronic signature, Royal Decree 1553/2005 does not incorporate any important changes with respect to the regulations it replaces, so we will limit ourselves to recalling the most relevant characteristics of the DNI :

  • The DNI is the document that certifies the identity and personal data of its holder that are recorded therein, as well as the holder's Spanish nationality.
  • It is mandatory for Spaniards over fourteen years of age residing in Spain and for those of the same age who, residing abroad, move to Spain for a period of no less than six months.
  • On the front of the DNI will appear, among other data, the personal number of the DNI and the verification character corresponding to the Tax Identification Number.
  • The validity period of the DNI will be:
  1. Two years when the applicant has not reached the age of five.
  2. Five years, when the holder has not reached the age of thirty at the time of issue or renewal.
  3. Ten years, when the holder has reached the age of thirty and has not reached the age of seventy.
  4. Permanent, when the holder has reached the age of seventy

Exceptionally, a different validity may be granted to the National Identity Document in the following cases of issuance and renewal:

  1. Permanent, for people over thirty years of age who can prove that they are severely disabled.
  2. For one year in cases where, due to circumstances beyond the applicant's control, any of the required documents could not be submitted.

Royal Decree 1553/2005 came into force on 25 December 2005, except with regard to electronic signature certificates.

Electronic DNI utility

Law 59/2003, of December 19, on electronic signature, attributed new uses to the DNI, establishing the basic regulatory framework for the electronic DNI.

Article 15 of Law 59/2003 defines the electronic DNI as “the national identity document that electronically certifies the personal identity of its holder and allows the electronic signature of documents.”

Royal Decree 1553/2005 regulates the electronic DNI under the terms set out in Law 59/2003. The most relevant notes of said regulation are the following:

  • The electronic signature made through the DNI will have, with respect to data recorded electronically, the same value as the handwritten signature in relation to data recorded on paper.
  • The activation of the DNI's utility as an electronic signature will be voluntary and will be carried out using a secret personal code, which the DNI holder may enter confidentially into the system.
  • The DNI support card will have an electronic chip incorporated in order to enable it to be used as an electronic signature.
  • Recognized electronic certificates incorporated into the DNI will have a validity period of thirty months. When the validity of the electronic certificate expires, you may request the issuance of new recognized certificates, keeping the same DNI card as long as it remains valid. To request a new certificate, the physical presence of the holder must be present, in the manner and with the requirements determined by the Ministry of the Interior.
  • As a consequence of the above, the General Directorate of Police, as the Management Centre in charge of managing and issuing the new DNI, becomes a provider of electronic signature certification services, for which the Ministry of the Interior approved the “Declaration of Certification Practices and Policies”, available on the Ministry of the Interior website, www.dnielectronico.es.

Special rules: NIF K and NIF L

In accordance with the above, there are two cases in which it is not mandatory for Spanish citizens to have a DNI: minors under fourteen years of age and over that age residing abroad who move to Spain for a period of less than six months.

However, in both cases, if an operation of a tax nature or with tax implications is carried out, it is necessary, as indicated in article 19.2 of RGAT , to have your own NIF. To do this, it is possible to obtain the DNI voluntarily or, alternatively, request the tax administration to assign a NIF.

This NIF will consist of nine characters with the following composition:

  • An initial letter intended to indicate the nature of this number, which will be:
    • L, for Spanish residents abroad
    • K, for Spaniards who, residing in Spain, are under 14 years of age
  • Seven alphanumeric characters
  • An alphabetical check character

The composition of NIF K and L defined by the RGAT presents some new features with respect to its regulation in RD 338/1990.

Firstly, until 31 December 2007, the so-called “NIF L” was assigned to Spaniards over the age of fourteen and residing abroad and the “NIF K” to Spaniards under the age of fourteen (article 3.2 of RD 338/1990). That is to say, the letter K was the general one for all Spaniards under fourteen years of age, whether or not they were residents in Spain, and the letter L was for Spaniards over fourteen years of age residing abroad.

However, since January 1, 2008, when the RGAT came into force, the letter L is the general one for all Spanish residents abroad, whether they are over or under fourteen years of age, and the letter K is for Spanish citizens under fourteen years of age residing in Spain.

The amendment introduced by the Regulation will allow a Spaniard under the age of fourteen who resides abroad to be assigned a “NIF L” and to keep it, even after reaching the age of majority, unless he or she moves to reside in Spain. Under the previous regulations, a Spanish minor under the age of fourteen residing abroad had to be assigned a “NIF K” and when he or she turned fourteen he or she would have to obtain a “NIF L” with the resulting inconveniences, both for him or her and for the tax authorities.

Secondly, Royal Decree 338/1990 (article 3.2) configured the NIF including, in addition to the initial letter intended to indicate the nature of the number, two digits to contain an indicator of the province of the tax domicile of its holder or, in the case of non-residents, of the province where it had been requested, five digits that formed a sequential number within each province and an alphabetical verification character.

This configuration had certain drawbacks since the province identifier digits and the associated sequential number were close to being exhausted in some of them. Furthermore, the information provided by the NIF on the province was not relevant since it became obsolete when the taxpayer changed his tax domicile.

For this reason, the new Regulation configures the NIF, in addition to a letter, with seven alphanumeric characters (not just digits) and an alphabetical verification character, which resolves the material problems generated by the old configuration.

In addition to the new features regarding the composition of NIF K and L, the RGAT presents another important new feature: establishes the obligation for all minors who carry out any operation with tax implications to have their own NIF.

Under the previous regulations (articles 3 and 7 of Royal Decree 338/1990), minors were only required to have their own NIF if they were entrepreneurs or professionals. If they were not and did not have an ID card assigned, they could either request the ID card from the Ministry of the Interior, request a “NIF K” from the Tax Administration, or use the NIF of their legal representative.

The option of using the NIF of the legal representative generated some inconveniences in practice since, associated with the same NIF, there could be information corresponding to several people, that of the NIF holder and that of all his representatives, and when all of them were obtaining their own NIF, it was necessary to “separate” that information to associate it with its true holder. With the amendment introduced by the Regulation, the quality of the information associated with each person is improved, assigning it from the beginning to its true “owner”.

In line with the above, section 3 of article 19 of the RGAT states that, in order to identify minors under 14 years of age in their relationships of a tax nature or with tax implications, both the data of the person under 14 years of age, including their NIF, and those of their legal representative must be included.

Individuals of foreign nationality

General rule: NIE

For individuals who do not have Spanish nationality, the NIF is, in general, the foreign identity number ( NIE ) that is assigned to them or provided to them in accordance with Organic Law 4/2000, of January 11, on the rights and freedoms of foreigners in Spain and their social integration, and its implementing regulations (article 20.1 RGAT).

In accordance with article 101 of the Regulation implementing Organic Law 4/2000 of 11 January on the rights and freedoms of foreigners in Spain and their social integration, approved by Royal Decree 2393/2004 of 30 December ( BOE 7 January) and amended by Royal Decree 1162/2009 of 10 July ( BOE 23 July) the NIE is assigned to foreigners in the following cases:

  • When they obtain a document that enables them to remain in Spanish territory
  • When an administrative procedure is initiated against them under the regulations on foreigners.
  • When their economic, professional or social interests involve them in relations with Spain.

In the first two cases, the NIE is granted ex officio by the General Directorate of Police. In the third case, the foreigner must request the assignment of the number from said body, provided that two requirements are met: that the person is not in Spain in an irregular situation and that he/she can provide documentary evidence of the reasons for requesting the assignment of said number.

At this point, it is important to remember that the NIE merely serves to identify the foreigner and that, as the General Immigration and Documentation Office of the General Directorate of Police has pointed out on several occasions, the assignment of the NIE does not prove that the foreigner is in a legal situation in Spain. It also does not prejudge, even if their situation is legal, whether the foreigner is authorized to work and/or reside in Spain.

It is also advisable not to confuse the foreigner's identity number (NIE) with the foreigner's identity card ( TIE ). This card is regulated by article 105 of the Immigration Regulations and is the document intended to identify the foreigner for the purposes of proving his or her legal status in Spain. It must be requested, except for the exceptions provided for in the regulations, by all foreigners who have been issued a visa or authorization to remain in Spain for a period of more than six months.

Composition of the NIE

ORDER INT/2058/2008, of July 14 (BOE of the 15th), modifies the Order of the Minister of the Interior of February 7, 1997, which regulates the foreigner card, with regard to the foreigner identity number.

This Order includes the new composition of the NIE, which will consist of nine characters with the following details:

  • An initial letter, which will be X. Once the numerical series is exhausted, the alphabetical order will be followed: Y, Z
  • Seven digits or numeric characters
  • An alphabetical check character

Until the publication of this Order, the NIE consisted of 10 positions: the letter X, 8 digits and a verification code.

To solve the problems caused by the fact that the NIE had 10 characters and the NIF 9, the Ministry of the Interior and the Tax Agency reached an agreement in 1997 whereby only 9 characters would be printed on the NIE accreditation cards: the X, 7 digits and the control code. However, if any NIE card had a 10-character NIE, it had to be registered in the database by omitting the first zero that appeared after the X.

The agreement between the Tax Agency and the Ministry of the Interior was possible at the time because the first digit was 0 and remained valid as long as the number of NIE issued was less than 9,999,999. As the margin for rapid growth in the foreign population in Spain was exhausted, it was necessary to find an alternative formula so that the NIE would have 9 characters, the same as the NIF. Therefore, since July 2008 it is possible to find foreigner identity numbers (NIE) that begin with X or Y (and in the future with Z).

NIE accreditation

According to the General Immigration and Documentation Office, NIE accreditation can be done by showing the foreigner's identification card, the residence permit or the registration certificate issued to EU citizens, if available. Otherwise, the NIE will be accredited by means of the certificate issued for this purpose by the Ministry of the Interior, which will state the assigned number. The application form on which the number communicated verbally by the Police has been written down by hand is not valid for proving the NIE.

Justification of the need to have a NIE

In order to assign the NIE, some Immigration Offices or Police Stations request documentary justification of the facts that motivate the request for the NIE due to “economic, social or professional interests”, which includes carrying out operations with tax implications.

Obligation to have NIE for EU citizens

Royal Decree 240/2007, of February 16 (BOE February 28), regulates the entry, free movement and residence in Spain of citizens of the Member States of the European Union ( EU) and of other States party to the Agreement on the European Economic Area (EEA)

This Royal Decree was issued to incorporate into the Spanish legal system the content of Directive 2004/38/ CE , of the European Parliament and of the Council, of April 29, 2004, regarding the right of citizens of the Union and their family members to move and reside freely within the territory of the Member States.

Throughout its articles, the Royal Decree regulates the conditions for the exercise of the rights of entry and exit, free movement, stay, residence, permanent residence and work in Spain by citizens of other Member States of the EUand the remaining States party to the EEA Agreement, as well as the limitations to the above rights for reasons of public order, public security or public health. These same rights are recognized, regardless of their nationality, to family members (spouse, partner, descendants and direct ascendants in the care of the citizen or his/her spouse or partner) of citizens of those same States, when they accompany him/her or join him/her in Spanish territory, in the terms indicated in article 2 of the Royal Decree (hereinafter, we will refer to them as "family members").

The Royal Decree regulates stays of less than three months, residence of more than three months and permanent residence.

To stay in Spain for less than three months, it is sufficient to have a valid passport or identity document, both for EU citizens and their family members (article 6 RD 240/2007).

Citizens of a Member State of the European Union, or of another State party to the Agreement on the European Economic Area, who are going to reside in Spanish territory for a period of more than three months, are required to personally apply to the Foreigners' Office of the province where they intend to stay or establish their residence or, failing that, to the corresponding Police Station, to be registered in the Central Registry of Foreigners. This application must be submitted within three months from the date of entry into Spain, and a registration certificate will be issued immediately stating the name, nationality and address of the registered person, their foreign identity number (NIE) and the date of registration (article 7 RD 240/2007).

“Family members” who are not nationals of a Member State of the European Union or of another State party to the Agreement on the European Economic Area and Switzerland may reside in Spain for a period of more than three months, but are subject to the obligation to apply for and obtain a “residence card for family members of Union citizens” (Article 8 RD 240/2007).

RD 240/2007 did not include at the time all the requirements derived from Directive 2004/38/ CE , of the Parliament and the Council, of April 29, 2004. This situation has caused serious economic damage to Spain, especially in terms of the impossibility of guaranteeing the reimbursement of expenses incurred by the provision of health and social services to European citizens, as pointed out by the Court of Auditors.

In view of this circumstance, the fifth Final Provision of Royal Decree-Law 16/2012, of April 20, on urgent measures to guarantee the sustainability of the National Health System and improve the quality and safety of its services proceeds to transpose into its literal practice article 7 of Directive 2004/38/EC of the Parliament and the Council of April 29, 2004, including the conditions for exercising the right to reside for a period of more than three months.

Consequently, Order PRE/1490/2012 of 9 July has been issued, establishing rules for the application of Article 7 of Royal Decree 240/2007.

For permanent residence (articles 10 and 11) a general period is established for this purpose (5 years of continuous residence in Spain) and other special periods (for self-employed or employed workers who are in certain situations and their family members).

At the request of the interested party, a certificate of the right to reside permanently will be issued. “Family members” will be issued a permanent residence card.

To what extent does RD 240/2007 affect the obligation of EU citizens to have a NIE?

Royal Decree 240/2007 repeals Royal Decree 178/2003, of 14 February, on the entry and residence in Spain of nationals of Member States of the European Union and other States party to the Agreement on the European Economic Area.

The approval of Royal Decree 178/2003 raised certain doubts about whether the lack of need for a residence card that it contemplated affected or not the obligation to have a NIE for EU citizens.

The aforementioned Royal Decree established that, basically, nationals of the Member States of the European Union, or of Norway, Iceland, Liechtenstein and Switzerland, who were self-employed or employed, students, retirees or pensioners who had paid contributions in Spain and the relatives of these groups, as well as cross-border workers who resided in one of the aforementioned States but worked in Spain, returning every day or at least once a week to their country, could reside in Spain without needing a residence card (article 6 RD 178/2003).

The General Directorate of Foreigners and Immigration, of the Government Delegation for Foreigners and Immigration, of the Ministry of the Interior, clarified that since RD 178/2003 did not regulate the NIE, the Implementing Regulation of Organic Law 4/2000, on the rights and freedoms of foreigners in Spain and their social integration, was applied in this matter, since the aforementioned Regulation was applied in a supplementary capacity, or for the purposes that could be more favorable, to the citizens included in the scope of application of RD 178/2003.

Therefore, the lack of need for a residence card contemplated in RD 178/2003 did not affect the obligation to have a NIE in the cases provided for in the Immigration Regulations:

  1. Foreigners who obtain a document that enables them to remain in Spanish territory.
  2. Those who have had an administrative procedure initiated pursuant to the provisions of the regulations on foreigners.
  3. Those who, due to their economic, professional or social interests, are related to Spain.

RD 240/2007 does not regulate the cases in which the NIE is mandatory, so EU citizens who are in any of the cases provided for in article 101 of the Regulation of Organic Law 4/2000, approved by Royal Decree 2393/2004, of December 30 (as regards tax purposes, it is of interest to "those who, due to their economic, professional or social interests, are related to Spain"), must request the General Directorate of Police to assign the aforementioned number.

The new feature of RD 240/2007, as regards the identification of foreigners, is that, in general, the provisions of the Immigration Regulations apply to EU citizens in terms of NIE, but in particular, those who reside in Spain for more than three months are required to have a “registration certificate”, which will include, among other data, their NIE.

In short, if the EU citizen does not reside in Spain or remains in Spanish territory for less than three months, he or she will be required to have a NIE if he or she has a relationship with Spain for economic, social or professional interests.  However, if you reside in Spain for more than three months, you will obtain the NIE in any case, since it must appear on the registration certificate that you are required to request.

Special rule: NIF M

In a similar way to what happens in the case of tax identification of Spaniards, for whom the general NIF assigned by the Ministry of the Interior (DNI) coexists with the NIFs assigned in particular cases by the Tax Administration (NIF K and NIF L), in the identification of foreigners, together with the general case in which the NIF is the number assigned by the Ministry of the Interior (NIE), there is a particular case in which the NIF is assigned by the Tax Administration (NIF M).

This particular assumption is included in article 20.2 of the RGAT, which states the following:

“2. Individuals who do not have Spanish nationality and do not have a foreigner's identity number, either temporarily because they are required to have one or permanently because they are not required to have one, must request the tax authorities to assign them a tax identification number when they are going to carry out operations of a tax nature or with tax implications. This number will consist of nine characters with the following composition: an initial letter, which will be M, intended to indicate the nature of this number, seven alphanumeric characters and an alphabetical verification character.”

The RGAT introduces some NEW FEATURES with respect to the previous regulations (RD 338/1990):

  • Firstly, RD 338/1990 included another special rule for the assignment of NIF to foreigners. It provided that for foreigners under eighteen years of age who did not have a foreigner identity number (NIE), the tax authorities would assign them a number beginning with the letter K, the same as for Spaniards under fourteen years of age. However, the RGAT provides for the assignment of NIF M to foreigners in general, without distinguishing whether or not they are under 18 years of age, leaving NIF K only for Spaniards under 14 years of age and resident in Spain.
  • Secondly, the RGAT eliminates the restriction that prevented the assignment of the NIF M to foreigners residing in Spain. Now, to assign the NIF M, only the nationality of the applicant is taken into account, not his residence.
  • Thirdly, the RGAT allows the NIF M to be assigned not only to those who are not required to have a NIE, but also to those who, although required, have not yet obtained one.
  • Fourthly, the RGAT maintains that the initial letter indicating the nature of this NIF is M. However, the rest of its composition varies. Thus, the composition of NIF M would be:

    According to RD 338/1990: the letter M, two digits to indicate the province where the application was made, five digits that form a sequential number within each province, and a verification letter.

    According to the RGAT: the letter M, seven alphanumeric characters and one alphabetic check character.

The RGAT regulates the possibility of assigning the NIF M on a definitive or temporary basis.

Common rules regarding the NIF of natural persons

Article 21.1 of the RGAT states that the NIFs assigned directly by the Tax Administration (NIF K, L or M as seen) will be valid as long as their holder does not obtain their national identity document (DNI) or their personal foreign identification number (NIE).

Those who have a K, L or M type NIE (Foreign National ID) and later obtain a DNI (Spanish National ID) or the NIE (Foreign National ID) will have to communicate this circumstance to the Tax Administration and to the rest of people or bodies who should know about their new NIF (Personal Tax ID) within two months. The previous NIF will be effective up to the date of communication of the new one.

Article 21.3 of the RGAT states:

“When it is detected that a natural person simultaneously has a NIF assigned by the Tax Administration and a national identity document or a foreigner's identity number, the latter will prevail. The tax authorities must notify the interested party of the revocation of the tax identification number previously assigned in accordance with the provisions of article 147, and will inform the interested party of the obligation to communicate their valid number to all persons or entities that must have said number due to their operations.

On the other hand, the RGAT expressly establishes that the NIF K, LM will be valid as long as its holder does not obtain the DNI or the NIE and indicates in articles 19 and 20 that regulate the tax identification numbers of natural persons of Spanish and foreign nationality that: "If they do not request it, the tax authorities may proceed ex officio to register them in the Census of Taxpayers and assign them the corresponding tax identification number."

For its part, points 2 and 3 of article 144 of the RGAT indicate that the tax authorities may incorporate ex officio the data that must appear in the census when omissions or inaccuracies in the information contained in the census are revealed, in accordance with the provisions of articles 145 and 146 of the RGAT.

Thus, NIFs K, L and M cease to be valid when a DNI or NIE is available and, as regards DNI/NIE, it is up to the General Directorate of Police to decide on their validity at any given time. All of this, without prejudice to the taxpayer being informed of the official census correction carried out and the obligation to communicate their valid number to all persons or entities to whom said number must be recorded due to their operations.

Attached below is a summary table of the existing types of NIF for natural persons, as well as the competent body that assigns them.

NIF FOR INDIVIDUALS

NATIONALITY

ASSUMPTIONS

NIF TYPE

COMPETENT BODY ASSIGNMENT

Spaniards

General

DNI

Ministry of Interior

Minors under 14 years of age residing in Spain

NIF K

Tax Administration

Foreign residents

NIF L

Tax Administration

Foreigners

General

NIE

Ministry of Interior

Does not have NIE

NIF M

Tax Administration