NIF Validator
Portuguese taxpayer number (NIF) — 9 digits with an official check digit.
Portugal Validation Generation
How validation works
The validator parses the 9-digit NIF, recomputes the weighted check digit and compares it with the last digit, following the rule used by the Portuguese Tax Authority.
Install the package
dotnet add package DocumentNumber.Portugal.Vat.Validator
Validator in C#
using DocumentNumber.Portugal.Vat.Validator;
var validator = new VatValidator();
var isValid = validator.Validate("798945320");
Console.WriteLine(isValid ? "Valid" : "Invalid");
Live example
798945320 — a real NIF value accepted by the validator
Try NIF validation
Runs the exact same library code your application uses. Nothing you enter is stored.
Frequently asked questions
What is NIF?
Portuguese taxpayer number (NIF) — 9 digits with an official check digit.
How does NIF validation work?
The validator parses the 9-digit NIF, recomputes the weighted check digit and compares it with the last digit, following the rule used by the Portuguese Tax Authority.
How do I install the NIF validator package?
dotnet add package DocumentNumber.Portugal.Vat.Validator
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.