Extranjeros
Guides Consultation Contact ES · EN · UK

How to get a digital certificate with NIE in Spain (FNMT) and Cl@ve

How to get a digital certificate with NIE in Spain (FNMT) and Cl@ve
Comisaría Provincial de la Policía Nacional, Málaga. Foto: Tyk / Wikimedia Commons, CC BY-SA 3.0 (recortada).

Reviewed against the official source: · Author: · How we check facts

In short: Cl@ve is Spain's official electronic identification system for online procedures with public administration. It allows foreigners with TIE/NIE to access AEAT (taxes, IEDMT, DUA), DGT (registration, fines), Social Security (health card, benefits), SEPE (unemployment), regional and municipal authorities, without going to offices. It's free. With a TIE/NIE, online registration without a certificate goes through an invitation letter, which arrives by post. If you are after a digital certificate with NIE in Spain, the most common one with an NIE or TIE is the FNMT Electronic Certificate, further below; you sign with it using AutoFirma.

In person or by representative? With a TIE/NIE you register Cl@ve online with an invitation letter (sent by post) or with an electronic certificate, or in person at a registration office. Video identification is, for now, only for Spanish citizens with a DNI. The FNMT certificate does require one in-person accreditation (by appointment, usually at AEAT). Cl@ve registration is personal, with no representative; for the FNMT, someone else can go on your behalf only if you first have your signature on the certificate contract certified by a notary.

Three Cl@ve modes

  • Cl@ve PIN: one-time code sent by SMS or app, valid for a session. Simple, no permanent password.
  • Cl@ve Permanente: username + password + SMS second factor; the password expires after 2 years and must then be changed. For frequent use.
  • Cl@ve Móvil: authentication via the official Cl@ve app (formerly Cl@ve PIN) on your phone, the most convenient.

Once registered, all three modes are available: you pick which to use for each procedure.

📶 Just arrived? Cl@ve sends its codes by SMS, and several procedures ask for a mobile number. A Spanish eSIM gives you a number and data from day one, with no contract or prior padrón — one option is Sim Local. 🤝 Our partner. (Cl@ve itself is free.)

FNMT Electronic Certificate (Fábrica Nacional de Moneda y Timbre), alternative or complement: a digital file (.pfx/.p12) installed in your browser or device. More powerful (allows digital signatures), universally accepted, but requires in-person verification during application.

Diagram of Cl@ve registration: automatic video identification, invitation letter, manual review, electronic certificate or DNIe, and in-person registration office
The five Cl@ve registration paths according to clave.gob.es.

How to register Cl@ve (5 paths, deep links per path)

Index page: clave.gob.es: How to register.

  1. Automatic video identification: for now only for Spanish citizens with a valid DNI; it is not available with a TIE/NIE. It is done in the Cl@ve app (formerly Cl@ve PIN).
  2. Invitation letter: if you don't have an electronic certificate, this is the online path with a TIE/NIE. Request it from the link above and you receive a postal letter with a code at your tax address (domicilio fiscal), the address the Tax Agency has on file, which may not be your padrón address. The code in the letter is valid for 60 days after you receive it. Then enter the code at clave.gob.es to complete. You need a mobile phone; a foreign number with the country prefix is accepted.
  3. Video identification with manual review: after a successful automatic video identification, a public employee reviews the video and you get the advanced level. It depends on video identification, so for now it doesn't work with a TIE/NIE either.
  4. With existing electronic certificate or DNIe: if you already have one, use it to register Cl@ve instantly.
  5. In person at a registration office: AEAT, Social Security, INSS, some City Councils. Many offices require an appointment. Bring TIE.

How to get FNMT Electronic Certificate (4 sequential steps)

  1. Step 1 — Prior configuration: install the FNMT software/configurator in your browser (Firefox/Chrome). Required before next steps.
  2. Step 2 — Request certificate: enter NIE/TIE + create a password (write it down, it can't be recovered). Receive the request code by email.
  3. Step 3 — Accredit identity: appointment at authorised office (mainly AEAT). Office list on this same page. Bring TIE + passport + request code.
  4. Step 4 — Download certificate: ~1h after accreditation. With your code + NIE + password created in step 2. It installs automatically in your browser. Save a backup copy (.pfx).
  5. Expiry: 4 years. Online renewal is only possible in the 60 days before expiry. If you have already renewed once, for the next certificate you must prove your identity in person again (a new application as in steps 1-4; at the office, TIE, passport and request code).

AutoFirma: what it is and how to download AutoFirma

AutoFirma is an electronic signature app from Spain's digital transformation ministry. You pick the file you want to sign and the program chooses the signature format on its own. It does not replace the certificate: AutoFirma signs with your digital certificate or your DNIe, so you need one of the two first.

  1. Open the official downloads page: firmaelectronica.gob.es, Downloads.
  2. Choose your system: Windows, macOS or Linux (Debian, Fedora and OpenSUSE). For Android and iOS there is the "Autofirma Apps" app on Google Play and the App Store. There is a separate version for older macOS; the page says so.
  3. Install it with the user installation manual linked on that same page. When you sign on an electronic office, AutoFirma can run from the browser.

Where AutoFirma is asked for in immigration procedures: on Mercurio, the Public Administrations office asks you to have AutoFirma installed to sign the form and the attached documents before registering the application. In other procedures, AutoFirma comes up when the office asks you to sign with a certificate.

What it's for

  • AEAT: forms 05/06/576 (IEDMT), IRPF declaration, tax certificates.
  • DGT: registration appointments, miDGT, fines, temporary vehicle deregistration.
  • Social Security: TGSS (self-employed registration, work history report, which can also be requested by SMS or by post without Cl@ve), INSS (pensions).
  • SEPE: unemployment benefits, training courses.
  • City Council: padrón, IBI, IVTM, local aid.
  • Autonomous communities: health, education, regional aid.

Official source: Cl@ve — Electronic identification system + FNMT — Individual certificate.

Informational only; check the official source for your specific case.

Frequently asked questions

What is the difference between Cl@ve and the FNMT Electronic Certificate?

Cl@ve is an identification system with username and password, SMS PIN or mobile app: easy to get and enough for most procedures (AEAT, DGT, Social Security). The FNMT Electronic Certificate is a digital file (.pfx/.p12) installed in your browser or device: more powerful, it lets you sign documents and is accepted by all administrations. For complex procedures such as the customs DUA, it's worth having both.

Can I get Cl@ve as a Ukrainian with Temporary Protection?

Yes. You need a TIE with an NIE number (your Temporary Protection card is one). Video identification by smartphone is, for now, only available to Spanish citizens with a DNI, so with a TIE your options are: an invitation letter by post (sent to your tax address, the one the Tax Agency has on file; the code is valid for 60 days after you receive it), an electronic certificate, or in person at a registration office (AEAT, Social Security, SEPE or some city councils), many of which require an appointment.

What do I need Cl@ve for as a Ukrainian Temporary Protection holder?

It's the entry key for almost all Spanish online procedures: filing tax forms at AEAT (Modelo 05/06/576 for vehicle), booking cita previa at DGT, accessing Seguridad Social (health card, employment records), filing for unemployment benefits, applying for social aid. Without Cl@ve or an FNMT certificate, many procedures can only be done in person, with a cita previa and a trip to the office. There are exceptions: the vida laboral can also be requested by SMS (if your mobile is registered with Seguridad Social) or by post to your address, see [how to get the vida laboral](vida-laboral-como-obtener-extranjeros.md).

How do I get a digital certificate with NIE in Spain as a foreigner?

The most common digital certificate you can request with an NIE or TIE is the FNMT Electronic Certificate for individuals. You configure your browser, request it with your NIE and a password, prove your identity once in person (usually at an AEAT office, by appointment, with your TIE and passport) and download it. It expires after 4 years. To file on Mercurio you need a digital certificate or a DNIe; Cl@ve is not listed as a way in.

What is AutoFirma and how do I download it?

AutoFirma is the Spanish government's electronic signature app: you pick the file and the program chooses the signature format. You download it from firmaelectronica.gob.es (versions for Windows, macOS and Linux; on Android and iOS, the Autofirma Apps app in the official stores). It signs with your digital certificate or DNIe, so you need the certificate first. The Mercurio office asks you to have it installed to file an immigration application.

Official source: clave.gob.es

On video: this guide explained

How to get a digital certificate with NIE in Spain (FNMT) and Cl@ve

Order the guide

—

💳 Pay by Bizum, bank transfer or card — €9No Telegram: leave a phone number or email and we send the payment details 📲 Pay in Telegram — €9With ⭐ Stars or Bizum; the guide arrives in the bot

We’ll write with the details and payment options. No spam.

Order a guide or ask a question

Tell us which guide you need or your question — we’ll get it and reply on Telegram.

No spam. This is not individual legal advice.

General information, not individual legal advice. Check the official source and consult a professional for your case.

Have a question about your case?

Describe your situation and your questions — we study them and reply in writing. The first look is free.

Leave my questions →

If you prefer, also directly to @spain_asesor on Telegram (the form is better).

📣 News and regulation changes — on the channel: Join the Telegram channel

Get the free guide

Guide «Cl@ve and FNMT certificate in Spain» (PDF), instantly

No spam · privacy

or on Telegram
Get it on Telegram

Can’t find what you need? Message us on Telegram →