NIE generatorGenerador de NIE

Valid test Spanish foreigner identity numbers (Número de Identidad de Extranjero) for Spain, with the correct structure and check digits. Generate up to 100 at once, copy them or download a CSV, and check any NIE against the rules. Everything runs in your browser.

  1. X3577817Y
  2. X2583736P
  3. Y5568979A
  4. X0216266C
  5. Y2123588N
  6. X2914422T
  7. Z4257582B
  8. X9655330E
  9. Y2094013S
  10. X9353972X
Type or paste a number

Checked in your browser against the published rules. Nothing is sent anywhere, and a valid result does not mean the number was ever issued.

Synthetic test values for software testing. Not issued by any authority and not linked to any person or company.

How a NIE is built

Pattern: X1234567L

X, Y or Z (read as 0, 1, 2), seven digits and the same mod-23 control letter as the DNI.

Valid and invalid example

ValueResult
X3577817YValid
X3577817AInvalid last character changed

About the NIE

Foreign residents in Spain get a Número de Identidad de Extranjero. It starts with X, Y or Z, which count as 0, 1 and 2 when the control letter is calculated with the same mod-23 table as the DNI.

Typical test cases: Spanish forms that accept residents as well as citizens: rentals, utilities, employment and bank accounts.

More sample NIE numbers

X2583736P · Y5568979A · X0216266C · Y2123588N · X2914422T · Z4257582B · X9655330E · Y2094013S · X9353972X

Common questions

Are these real NIE numbers?
They follow the published structure and pass the check-digit rule, so validators accept them. They are generated at random and are not taken from any register. A random value can still coincide with a number issued to someone, so use them only in test systems.
Can I use a generated NIE on a real application?
No. Using an identity or tax number that is not yours on a real application, tax return or bank form is fraud in most countries. These values are for developers and testers working on their own systems.

Related tools

Other personal ID formats

SSN (US) · ITIN (US) · NINO (GB) · SIN (CA) · CPF (BR) · CURP (MX) · RFC (MX) · NIR (FR) · Codice fiscale (IT) · Steuer-ID (DE) · BSN (NL) · Rijksregisternummer (BE) · NIF (PT) · PESEL (PL) · all formats

Sample profiles with a NIE

Test people for Spain, each with a generated NIE and a drawn profile picture.

  • Ramiro AlarcónMale, 19 · born 2007-03-14La Bermeya, AsturiasNIE X4797465Xramiro.alarcon45@example.com
  • Concepción CadenaFemale, 21 · born 2005-08-01Orxeta, AlicanteNIE X6048696Hconcepcion.cadena@example.com
  • Patricio VelásquezMale, 36 · born 1990-01-02El Peñedo, AsturiasNIE X1531496Hpvelasquez@example.net
  • Sara ZamoraFemale, 73 · born 1953-03-20Palomar, CórdobaNIE X8420425Xsara_zamora@example.net

Synthetic people with drawn pictures: not real individuals. Generate more profiles.