NIE number

The NIE is a tax identification number in Spain, known in Spanish as the NIE, or more formally the Número de identidad de extranjero. The Spanish government have linked the NIE number to residence, where the NIE appears on the "tarjeta de residencia" ("residence card"), and to social security in Spain.
Use.
The number itself is made up of an initial letter followed by seven digits followed by a verification letter. The initial letter is an X before July 2008 and a Y afterwards. It is issued by the National Police of Spain. The NIE, which in accordance with Article 101 of the Rules for foreigners in Spain, was approved by Royal Decree 2393/2004 on December 30, 2004, is required for the purchase or sale of real estate, vehicle and boats, or in order to work or study. There are many other transactions that require the parties involved to possess an NIE Number.  In some cases, alternate identification, e.g., passport number, may be used.  The NIE number itself is issued on a standard A4 page, with the recipients full name (as written on the passport used during the application process), their place of birth, their nationality, and the number itself, along with a stamp and signature provided by the National Police.
Applying for NIE.
An NIE can be applied for in three ways:
There are two main requirements to make the application:
The application form requires an address; this need not be permanent; e.g., a hotel may be used.  The form also requests phone number and e-mail, but the physical address may be used for notification (so it is unwise to give an address from which you cannot retrieve mail).  The form also asks for a reason for requesting the NIE. 
In the case of presenting the application in Spain personally, some bigger localities (like Valencia) require an appointment to be booked online beforehand.
Foreigners with an NIE can use it to register with the municipal register of inhabitants.