Updated 2026 · Published by e-residency (Happy Residence S.L.)

What Does a NIE Number Look Like? Format and Example

Key facts
  • A NIE has 9 characters: one letter — seven digits — one letter.
  • Example: X1234567B (illustrative, not a real NIE).
  • First letter is usually X, Y or Z; the final letter is a check character.
  • It appears on your white A4 NIE certificate and on a TIE card (if you have one).

A NIE number looks like a letter, seven digits and a final letter — for example X1234567B. It is always nine characters long and follows a fixed pattern, which is how Spanish systems validate it. For how the NIE relates to the other Spanish IDs, see our NIE vs NIF, TIE and DNI comparison.

The format, character by character

  • First character — a letter: historically X; when the X range was exhausted Spain moved to Y (from 2008) and then Z (from 2022).
  • Middle — seven digits: your unique sequence.
  • Last character — a letter: a control/check letter calculated from the digits, used to detect typos.

The number is officially written without hyphens (e.g. X1234567B). Hyphens like X-1234567-B are only for readability.

A worked example

PartValueMeaning
Prefix letterYForeigner number series
Digits2345678Your unique number
Check letterAValidation character

The values above are an illustrative example, not an assigned NIE.

Where you’ll see your NIE number

Can’t find yours? See how to find a lost NIE number.

Frequently asked questions

How many digits does a NIE have?
Seven digits, with a letter before and after them — nine characters in total.
What letter does a NIE start with?
Usually X, Y or Z.
Is the NIE format the same as a DNI?
No — a DNI is eight digits plus a letter; a NIE starts with a letter (X, Y or Z).

Related

Sources

e-residency is operated by Happy Residence S.L. (Málaga, License 62802L). We are a private firm and not a public administration; we do not issue official documents. Accurate as of 2026.