DNI / NIE / CIF Generator
Spanish tax identifiers — DNI, NIE and CIF with their official check digits.
Spain Validation Generation
How generation works
The DNI / NIE / CIF generator builds a structurally valid sample using the same rules the validator enforces — check digits included. Use it for test data and fixtures; never for production records.
Install the package
dotnet add package DocumentNumber.Spain.Vat.Generator
Generator in C#
using DocumentNumber.Spain.Vat.Generator;
var generator = new VatGenerator();
var sample = generator.GenerateDocumentNumber();
Console.WriteLine(sample);
Live example
49365682T — a real DNI / NIE / CIF value accepted by the validator
Try DNI / NIE / CIF generation
Runs the exact same library code your application uses. Nothing you enter is stored.
Frequently asked questions
What is DNI / NIE / CIF?
Spanish tax identifiers — DNI, NIE and CIF with their official check digits.
How does DNI / NIE / CIF generation work?
The generator builds a structurally valid DNI / NIE / CIF sample using the same rules the validator enforces — including check digits. Generated values are intended for tests and development only.
How do I install the DNI / NIE / CIF generator package?
dotnet add package DocumentNumber.Spain.Vat.Generator
Is the value I enter in the demo stored?
No. Demo inputs are processed in memory for the current request only and are never persisted or shared.