NIE Generator (Spain)

Generate valid NIE (Numero de Identidad de Extranjero) numbers for testing purposes. Includes prefix letter (X, Y, Z) and check letter.

international.disclaimer

This tool generates fictitious data intended exclusively for software testing and development purposes. The data does not correspond to real people or entities and must not be used for illegal, fraudulent purposes, or in ways that violate the privacy of others. Compliant with LGPD (Brazilian Data Protection Law).

About NIE (Spain)

What is NIE?

The NIE (Número de Identidad de Extranjero) is the tax identification number for foreign residents in Spain. Format: L-XXXXXXX-C, where L is a letter (X, Y, or Z) and C is a control letter calculated by the same algorithm as the DNI.

Verification algorithm

The initial letter (X, Y, Z) is replaced by a number (0, 1, 2 respectively), forming an 8-digit number. The control letter is calculated by the same DNI method: division by 23 and letter table lookup.

Use in development

Platforms serving foreigners in Spain — banks, real estate, government services — need to validate NIE. The generator creates fictitious numbers with correct control letters for testing.