What a NIE number looks like
TL;DR
- A Spanish NIE is nine characters: a letter X, Y or Z, seven digits and a final check letter — for example X1234567B.
- Officially a NIE is written without hyphens or spaces.
- The X series ran until 2008; the Y series was introduced in July 2008 by Orden INT/2058/2008; the Z series has been issued since 2022.
- The check letter is the 8-digit number modulo 23, mapped to the table TRWAGMYFPDXBNJZSQVHLCKE.
- A NIE number is assigned once, for life, and is never reassigned.
Facts verified 9 August 2026 against the Sede Electrónica de la Policía Nacional

A Spanish NIE is always nine characters: a leading letter (X, Y or Z), seven digits, and a final check letter — for example, X1234567B. Officially it is written without hyphens or spaces, although you will still see formats like X-1234567-B on older documents.
Updated 10 August 2026
Key facts
| Structure | Letter (X/Y/Z) + 7 digits + check letter |
|---|---|
| Example | X1234567B |
| Official spelling | No hyphens, no spaces |
| First letter today | Z (issued since 2022) |
| The number changes? | Never — it is assigned once, for life |
What the first letter means
The first letter is simply a series marker — it tells you roughly when the number was issued, nothing else:
- X — the original series, used until 2008 and now exhausted
- Y — introduced in July 2008 by Orden INT/2058/2008 when the X series ran out
- Z — the current series, issued since 2022
An X-number is not "older and less valid" than a Z-number. All three series are equally valid forever. If your certificate is from 2005 and starts with X, that is still your number today.
How the check letter is calculated
The last letter is a checksum, and you can verify it yourself. Spain uses the same algorithm as for DNI numbers:
- Replace the first letter with a digit: X → 0, Y → 1, Z → 2
- You now have an 8-digit number. Divide it by 23 and take the remainder
- Match the remainder (0–22) against the letter table:
T R W A G M Y F P D X B N J Z S Q V H L C K E
Example: X1234567 → 01234567 → 01234567 mod 23 = 14 → the 15th letter (position 14, counting from 0) is Z… so a real X1234567 would end in Z, and X1234567B would fail the check. Banks and notaries run exactly this validation — a typo in one digit makes the whole number invalid.
Where to find your NIE on documents
- White A4 certificate — the number is in the centre, under your name
- Green EU registration certificate — top right, labelled NIE
- TIE card — top right corner of the card
- Visa sticker in a passport — some long-stay visas print the NIE assigned during the application; look for a 9-character X/Y/Z code
What the NIE format is NOT
- Not a DNI. Spanish citizens’ DNI has 8 digits + letter, with no leading X/Y/Z. If there’s no X, Y or Z at the front, it is not a NIE.
- Not a NUSS. The social security number is 12 digits and completely unrelated.
- Not a CIF. Company tax IDs start with other letters (A, B…) — that’s a business identifier, not a personal one.
- Not case-sensitive trickery. There are no lowercase NIEs and no NIEs with more or fewer than seven digits. Anything else is a typo or a fake.
- Not something an online "NIE generator" can issue. Generators produce strings that pass the checksum but exist in no police database — only the Dirección General de la Policía assigns real NIEs, and only on application.
Wondering what a NIE number is actually for, or ready to see how to get a NIE? Both are part of our NIE number in Spain guide.
FAQ
Are NIE numbers written with hyphens?
Officially, no: X1234567B, no separators. Hyphenated versions on old paperwork refer to the same number.
Can two people have the same NIE?
No. The number is unique and permanent — it is never reassigned.
My certificate is 15 years old. Is the number still valid?
Yes. The number never expires. If an institution insists on a "fresh" certificate, you re-request the same number on a new paper with form EX-15.
Sources:
Sede Electrónica de la Policía Nacional (NIE assignment and fee schedule), retrieved 9 August 2026; Orden INT/2058/2008 (introduction of the Y series).
Reviewed by the Happy Residence S.L. team. Every figure on this page is checked against the official source on the date shown above; we re-verify after each annual fee order.
We are an administrative assistance service, not a public administration.