For foreigners, Spain's tax identifier is usually the same Número de Identidad de Extranjero already used across administration. Agencia Tributaria treats that NIE as your Número de Identificación Fiscal (NIF) in most resident and non-resident filings. You are not looking for a second invented code. The work is getting the NIE assigned when required, then placing yourself correctly in Hacienda's censuses with modelo 030 or, for business activity, modelo 036.
How does the NIE become the tax ID?
Request or confirm the NIE through the immigration track that matches your case. Once Interior assigns the number, banks, notaries, employers, and AEAT all expect that same string. Opening a resident euro account, buying property, or signing a Spanish employment contract typically asks for the NIE as tax ID rather than a separate Hacienda-only number: open a bank account.
If you must complete a tax-significant act before a NIE exists, AEAT can assign a temporary NIF starting with M in limited situations, using modelo 030 with passport evidence, proof of the tax transaction, and proof that a NIE was requested or is not required. That M-number is a bridge, not a permanent parallel identity for people who must hold a NIE.
When do you use modelo 030 or 036?
Modelo 030 is the personal census form for people who are not running a business or professional activity in the entrepreneur census. Use it to register in the census of taxpayers, change fiscal domicile, update personal identification data, manage notification addresses, or request a NIF when you lack DNI or NIE. AEAT publishes the supporting document list for each checkbox, including passport packs for NIF-M requests.
Modelo 036 is the census declaration for alta, modification, and baja in the census of entrepreneurs, professionals, and withholders. If you start autónomo activity, hire staff, or otherwise enter that census, 036 is the form that carries IAE data and tax-regime options. Older materials still mention a simplified 037; AEAT withdrew that model, so new filings follow 036. Economic activity also ties into filing taxes later in the year.
Electronic filing needs Cl@ve or a digital certificate. Keep the same Spanish address line you use on padrón and immigration files so notifications do not bounce: see the wider paperwork after moving sequence.
Common misconceptions
One misconception is that every foreigner receives a brand-new tax number different from the NIE. For most people the NIE is the NIF.
Another is that modelo 030 replaces modelo 036 for autónomos. Personal census tools do not register a professional activity the way 036 does.
It is also wrong to treat a temporary NIF-M as permission to ignore a required NIE forever. When Interior must assign a NIE, the M bridge expires once the permanent foreigner number exists.
Summary
Obtain the NIE when Spanish rules require it, then use that number as your tax ID with Agencia Tributaria. File modelo 030 for personal census and domicile updates, and modelo 036 when you enter the entrepreneur or professional census. Do not invent a second identifier, and keep electronic access ready for AEAT portals.
Sources
Next in Country To Live: Browse rankings
Related questions
- Moving & paperworkHow do you apostille documents for Spain in 2026?
- Moving & paperworkHow do you bring pets to Spain in 2026?
- Moving & paperworkHow do you choose health insurance in Spain in 2026?
- Moving & paperworkHow do you enrol children in public school in Spain in 2026?
- Moving & paperworkHow do you file taxes in Spain in 2026?
- Moving & paperworkHow do you set up a Spanish digital certificate or Cl@ve in 2026?
Related countries
- Austria · Moving & paperwork
- Chile · Moving & paperwork
- Colombia · Moving & paperwork
- Costa Rica · Moving & paperwork
- Curaçao · Moving & paperwork
- Germany · Moving & paperwork
- Hungary · Moving & paperwork
- India · Moving & paperwork
- Indonesia · Moving & paperwork
- Netherlands · Moving & paperwork
- Philippines · Moving & paperwork
- Poland · Moving & paperwork
- Singapore · Moving & paperwork
- South Korea · Moving & paperwork
- Switzerland · Moving & paperwork
- Taiwan · Moving & paperwork