Skip to content

What is the NAF? Spain's social security number

What the NAF (affiliation number with Spanish social security) is, where to see yours, how to request it with form TA.1 or on Import@ss, how it differs from the NUSS and the DNI or NIE, and why a self-employed worker needs it to register.

By Albert SalguedaReviewed by Equipo Melso, Revisión editorialPublished 9 min read
Card with the letters NAF, the affiliation number with Spanish social security needed to register as self-employed.

In short

  • NAF stands for número de afiliación (affiliation number). The Tesorería General de la Seguridad Social (TGSS) assigns it and, for an affiliated person, it is the same number as the NUSS.
  • It is single, lifelong and valid for all schemes: it does not change if you move from employee to self-employed.
  • You see it on Import@ss, inside your personal area or with the Certification of the Social Security Number, and also on previous payslips and contracts.
  • If you have none, it is requested with form TA.1, on Import@ss with Cl@ve, certificate, DNIe or SMS, or without them with a selfie and a photo of your DNI or NIE.
  • A self-employed worker needs it to register: the Seguridad Social asks for it among the data of the procedure and declares it mandatory before affiliating to a scheme.

What is the NAF: the short answer

What is the NAF? It is the affiliation number with Spanish social security: the one that identifies you to the Tesorería when you start an activity that includes you in the system. For an affiliated person it matches the social security number (NUSS), it is single for life, and a self-employed worker needs it before registering in the RETA.

The NAF is the piece that tends to be forgotten until registration day. This guide tells you what it is, how it differs from the NUSS and from your DNI or NIE, where to find it and how to request it if you do not have one. If you want the full procedure, see our guide to registering as self-employed.

What is the NAF and what is it for?

According to the Seguridad Social affiliation page (the Seguridad Social is the Spanish social security system), affiliation is the administrative act by which the TGSS recognises a person's inclusion in the system, the first time they carry out an activity that determines that inclusion. That person is identified with the affiliation number, the NAF.

Affiliation has four characteristics that explain almost everything else:

  • Mandatory for anyone included in the system, with their contribution rights and obligations.
  • Single and general: it is valid for all schemes, whether the General scheme or the self-employed one (RETA).
  • Lifelong: it lasts the person's whole life in the system.
  • Exclusive: each person has a single number.

In practice, the NAF is used for everything you do with the Seguridad Social. Your registration in a scheme is recorded with it. The Seguridad Social itself says the number is needed to access pensions, subsidies and benefits, and that the health system of your autonomous community uses it to register your health card.

NAF, NUSS and DNI or NIE: how they differ

The three numbers come up in the same conversation and it helps not to mix them up. The Seguridad Social also explains that the social security number becomes the affiliation number when you start working. And it sums it up like this: the TGSS assigns a social security number (NUSS) to each citizen to identify them in their dealings with it, and for affiliated people that number is the same as the affiliation number.

ConceptWhat it isWho issues itWhen you have it
NUSSSocial security number, which identifies you in your dealings with the TesoreríaTGSSFrom when it is assigned, even if you have not worked yet
NAFAffiliation number; for an affiliated person it matches the NUSSTGSSFrom when you start an activity that includes you in the system
DNI or NIEIdentity document (DNI for Spaniards, NIE for foreigners)The StateFrom when you get it; it is a different number

Source: Seguridad Social, affiliation, accessed on 4 December 2026.

Comparison of three numbers: the NUSS is assigned by the Tesorería General de la Seguridad Social and identifies you to it; the NAF is also assigned by the Tesorería and matches the NUSS for affiliated people, and the DNI or NIE is the identity document issued by the State and is a different number.(opens the image in a new tab)
Source: Seguridad Social, affiliation of workers, December 2026.

In short: if you are affiliated, NAF and NUSS are the same number with two names. Your DNI or NIE is something else: you need it to request the number, but it does not replace it. If you need to clear up the difference between your tax ID and your document, read NIF and DNI: are they the same?.

Where to find your NAF

If you have ever worked as an employee, or were covered by the Seguro Escolar (the school insurance), you most likely already have a number. These are the routes, from the most official to the quickest:

  1. Import@ss, personal area. It is the Tesorería's portal. You log in with Cl@ve, an electronic certificate or DNIe, or by SMS if you have already given your phone to the Seguridad Social. There you can see your number.
  2. Certification of the Social Security Number. It is an Import@ss service, in the section on working life and reports. It lets you check your number and download a PDF report that certifies it, according to its certification page.
  3. Work documents. A previous payslip or contract includes your affiliation number.
  4. Your working-life report, if you work or have ever worked.

A useful detail: without an assigned number you cannot identify yourself on Import@ss by SMS. If that is your case, you need Cl@ve or a certificate, or to make the request with a selfie and a photo of the document that you will see below.

Tip

If you cannot find your number, do not request a new one blindly. Affiliation is single, and the Seguridad Social reminds you that you may have one assigned without remembering it, from a previous job or from the Seguro Escolar. Check first in your personal area on Import@ss.

How to get a NAF if you do not have one

The request is made with form TA.1, the request for affiliation and social security number. The Import@ss request page says you can request it at any time, that any citizen without one assigned can request it, and that you need your DNI or NIE, a mobile phone, an email and your usual address.

  1. Gather the data. Your DNI or NIE, your mobile, your email and your usual address.
  2. Go to Request the Social Security Number on Import@ss. You choose how to identify yourself: Cl@ve Permanente, Cl@ve Móvil, DNIe, electronic certificate or SMS.
  3. If you have none of those methods, you choose the none option: you fill in your personal details, take a selfie and upload a photo of your identity document. The Seguridad Social warns that an electronic identification method speeds up the process.
  4. Send the request and keep the receipt. When the number is assigned, check it in your personal area.
Four steps to request the NAF if you do not have one: gather DNI or NIE, mobile, email and address; go to Request the Social Security Number on Import@ss and choose an identification method; if you have none, take a selfie and upload a photo of the document; send the request and check the number in the personal area.(opens the image in a new tab)
Source: Seguridad Social, Import@ss, December 2026.

The affiliation page adds two more routes. Anyone with a digital certificate can file the TA.1 online in the number-assignment service of the electronic office. And it can also be filed at the provincial office of the Tesorería, or one of its Administraciones, in the province where the self-employed worker has their establishment (or, for an employee, where the employer is based). If you need a certificate, you have the steps in how to get a digital certificate in Spain.

How long the number takes to be assigned does not appear on the official pages consulted, so we do not give a time: request it with margin before the date you want to start.

Why a self-employed worker needs the NAF to register

Registering as self-employed happens in two places that must go hand in hand: Hacienda, with the census registration, and the Seguridad Social, with affiliation and registration in the RETA. According to the practical guide to self-employment, the data you need for registration include your NUSS or NAF, your DNI or NIE, the start date of the activity, your estimated monthly net income, the address of the professional activity, your contact details, the IAE and CNAE codes and an IBAN to direct-debit the fee. If you are a foreigner, also your NIE and your work and residence permit.

The underlying reason is on the affiliation page: the number is mandatory before the request for affiliation and registration in a scheme. And the same page says that self-employed workers who start an activity and are not yet affiliated must request it themselves.

The timing set by the Seguridad Social guide:

WhatWhen
Registration in the RETAOn the day you start or up to 60 days earlier
Registration with HaciendaMust match the registration with the Seguridad Social: both, before or on the day of the start
If you have already startedIt is still processed, but it is treated as filed late for all purposes

Source: practical guide to self-employment and registration as self-employed, accessed on 4 December 2026.

In practice, the NAF is requested first. With it in hand, you fill in the RETA registration and your census registration with modelo 036. If you leave it for the last day and find you have no number, you delay the registration and risk it being processed late.

NAF for employees and for the self-employed: who requests it

You do not always request it yourself. If you are going to work as an employee and have no number, the employer does it and must do it before you start. If you are going to be self-employed, you request it. And if nobody does, the Tesorería can affiliate you ex officio, for example after an action by the Labour Inspectorate, according to article 16 of the General Social Security Law; and if whoever should have requested it does not, you can ask directly for your affiliation yourself.

Since the number is single and lifelong, the same one serves you when you combine employment and self-employment, which is common if you come from a job as an employee. There is more on that situation in being employed and self-employed in Spain.

Example: Irene requests her number before registering

Irene is a photographer in Zaragoza, is 24, has never worked as an employee and wants to start her activity on 1 February 2027. This is her calendar (illustrative example, with invented dates):

  1. 7 December 2026. She logs in to Import@ss with Cl@ve, checks in her personal area that she has no number assigned and sends the request with her DNI, mobile, email and address.
  2. When she receives the number. She notes it down. It is her NAF and it will never change. Since it is the same as her NUSS, she can already identify herself by SMS if she gives her phone number.
  3. 14 December 2026. With the NAF, she gathers her IAE, her CNAE, her activity address and her IBAN, and files the registration in the RETA and with Hacienda. She does it before starting and with more than a month of margin: the Seguridad Social allows up to 60 days in advance.
  4. 1 February 2027. She starts her activity with both registrations already done.

If she had waited until 1 February to request the NAF, she would have started without being registered and her filing would have been treated as late.

Irene requests her social security number on 7 December 2026, receives it later, registers in the RETA and with Hacienda on 14 December 2026 and starts her activity on 1 February 2027, with more than a month of margin against the maximum of 60 days in advance.(opens the image in a new tab)
Illustrative example. The response time for the number is not set on the official pages.

How Melso helps

What most often holds up a registration is gathering the data before the start date. With Melso you collect what the registration needs and a Melso gestor files your registration as self-employed with Hacienda and the Seguridad Social. If you have a question about your number, ask your team of gestores in the chat.

Common mistakes with the NAF

  • Requesting a new number when you already have one. Affiliation is single: check first in your personal area.
  • Confusing it with the DNI or NIE. They are different numbers, and only the second is your document.
  • Leaving it for the last day of registration. The NAF comes before the registration request, and the Seguridad Social allows processing the registration up to 60 days in advance.
  • Sharing it on unreliable websites. It is a piece of your working life: use it only on the official portals.
  • Expecting SMS to work without a number. Without a NUSS you cannot identify yourself by SMS; use Cl@ve or a certificate.
  • Assuming the employer does it. Only in employment. As a self-employed worker, you request it.

How Melso helps

Melso is your online gestoría, with an AI agent and human professionals behind it. On WhatsApp you send it receipts and invoices, Melso organises your income and expenses, spots what is missing and warns you about the tax calendar. If you are not registered yet, Melso collects what the registration needs and a Melso gestor files your registration as self-employed with Hacienda and the Seguridad Social. See the pricing, get started at melso.ai or tap Chat on WhatsApp.

This article is for information only and does not replace professional advice for your case. Last reviewed: 4 December 2026.

Sources

  1. Affiliation of workers, Seguridad Social (accessed )
  2. Social security number: useful information, Seguridad Social (accessed )
  3. Royal Legislative Decree 8/2015, consolidated General Social Security Law (article 16), BOE (accessed )
  4. Request the Social Security Number, Seguridad Social (Import@ss) (accessed )
  5. Certification of the Social Security Number, Seguridad Social (Import@ss) (accessed )
  6. Practical guide to self-employment, Seguridad Social (Import@ss) (accessed )
  7. Registration as self-employed, Seguridad Social (Import@ss) (accessed )
Back to top

Frequently asked questions. What people ask us most.

NAF stands for número de afiliación, the affiliation number with the Seguridad Social, the Spanish social security system. It is the number the Tesorería General de la Seguridad Social uses to identify you once you are affiliated, that is, once you have started an activity that includes you in the system. For affiliated people it matches the social security number, the NUSS, and stays with you for your whole working life.

Illustration of a receipt and a retirement pension table.

Getting started

Autónomo pension in Spain: how much and how to raise it

How much a self-employed autónomo gets as a retirement pension in Spain in 2026 and 2027: age, years of contributions, how the base is calculated, minimum and maximum pension, a worked example, early and active retirement and how to raise it.

14 min read

How to deregister as an autónomo in Spain without mistakes

Getting started

How to deregister as an autónomo in Spain without mistakes

The two steps to deregister as an autónomo in 2026 (Seguridad Social within 6 days, Hacienda within one month), the returns still to file, unemployment benefit for the self-employed and a worked example of closing on 31 December with real dates.

13 min read

Illustration of an invoice and a grant application form for the self-employed.

Getting started

Grants for the self-employed in Spain 2026

Which grants self-employed workers in Spain can get in 2026: the tarifa plana, capitalising or combining unemployment benefit, cuota bonuses, IRPF incentives, the status of regional grants on 4 December 2026 and what is already published for 2027.

12 min read

Less paperwork.
More time for you.

Start with Melso or tell us about your case on WhatsApp.

Chat on WhatsApp (opens in a new tab)
  • No lock-in
  • Real professionals
  • Mistakes covered