Portugal NIF validator
Validate a 9-digit Portuguese NIF (Número de Identificação Fiscal) or NIPC. The tool verifies the modulo-11 check digit and identifies the taxpayer type from the leading digit(s) — individual, company, public entity, sole trader and more. It is useful for confirming a tax number was typed correctly before submitting invoices or forms.
How it works
The check digit (the 9th digit) is a weighted modulo-11 checksum of the first eight digits, and the prefix sets the taxpayer type:
weights = 9, 8, 7, 6, 5, 4, 3, 2 (applied to digits 1–8)
sum = Σ (digit × weight)
control = 11 − (sum mod 11)
if control is 10 or 11 → 0
the 9th digit must equal control
| Prefix | Taxpayer type |
|---|---|
| 1, 2 | Individual |
| 45 | Non-resident individual |
| 5 | Company / collective person |
| 70, 74, 75 | Inheritance / special |
Example
For the NIF 123456789 the first eight digits weighted by 9…2 give a sum whose modulo-11 control digit is computed and compared with the printed 9th digit. A match means a valid check digit, and the leading 1 labels it an individual taxpayer. A single mistyped digit normally breaks the checksum, and the tool shows the expected 9th digit so you can find the error.
It is privacy-first: nothing leaves your browser. The validator only checks the structure and check digit — it does not verify the number against any tax register.