Portugal NIF validator: check a número de contribuinte
Check a Portugal NIF (9 digits): modulo 11 check digit, taxpayer type from the prefix (1, 2, 3, 45, 5…) and the exact reason a number fails.
How a NIF is checked in Portugal: check digit and prefixes
In Portugal, the NIF (número de identificação fiscal) has 9 digits and the last one is a modulo 11 check digit: multiply the first 8 digits by 9, 8, 7, 6, 5, 4, 3 and 2, add them up, and the check digit is 11 minus the remainder of the sum divided by 11 (0 when that remainder is 0 or 1). The first one or two digits give the taxpayer type: 1, 2 or 3 for a resident individual, 5 for a company, 45 for a non-resident.
How the check digit is computed
The tool strips spaces, dots and the "PT" VAT prefix, checks that 9 digits remain, then tests the prefix and the check digit. Sum = digit 1 × 9 + digit 2 × 8 + … + digit 8 × 2; remainder = sum mod 11; check digit = 0 when the remainder is 0 or 1, otherwise 11 − remainder.
Worked examples
- 123 456 789: 1×9 + 2×8 + 3×7 + 4×6 + 5×5 + 6×4 + 7×3 + 8×2 = 156; 156 mod 11 = 2; check digit 11 − 2 = 9, so the number is valid (individual).
- 123 456 788: same sum, the expected check digit is 9, not 8, and the tool says so.
- 450 000 001 (non-resident): 4×9 + 5×8 = 76; 76 mod 11 = 10; check digit 11 − 10 = 1: valid.
Prefixes
1, 2 and 3: resident individuals (range 3 opened in 2019); 45: non-resident individuals under final withholding; 5: legal entities registered with the RNPC; 6: public bodies; 70, 74 and 75: undivided estates; 71: non-resident legal entities; 72: investment funds; 77 and 78: assigned ex officio; 79: Expo 98 regime; 90 and 91: condominiums and irregular companies; 98: non-residents without a permanent establishment; 99: civil partnerships without legal personality. Prefix 8 (former sole traders) is no longer assigned: the tool accepts the check digit but flags it.
Limits
A valid NIF is not necessarily assigned. Only the Autoridade Tributária confirms that a taxpayer exists, and the European Commission's VIES service checks an EU VAT number.
Sources and dates: Decreto-Lei n.º 14/2013 of 28 January 2013 (articles 2, 4 and 11, definition of the NIF and of the 45 and 5 ranges); list of prefixes from public documentation (encyclopedia citing DL 14/2013 and the Portal das Finanças manual), not confirmed on the primary source; modulo 11 rule recomputed on the examples above (checked on 15/10/2026).
Frequently Asked Questions
How do I check whether a Portuguese NIF is valid?
Multiply the first 8 digits by 9, 8, 7, 6, 5, 4, 3 and 2, add them up and take the remainder of the sum divided by 11. The check digit (9th digit) is 11 minus that remainder, or 0 when the remainder is 0 or 1. For 123 456 789 the sum is 156, the remainder 2 and the check digit 9.
What does a NIF starting with 45 mean?
Prefix 45 is reserved for non-resident individuals whose only Portuguese income is taxed by final withholding. Residents get a NIF starting with 1, 2 or 3, and companies one starting with 5.
Does a valid NIF always belong to someone?
No. The check digit only proves the number is consistent: roughly one 9-digit number in eleven passes with an allowed prefix. Only the Autoridade Tributária confirms that a taxpayer exists.
Is the Portuguese NIF the same as the VAT number?
For a business, the EU VAT number is the NIF preceded by "PT". The tool accepts that form and ignores the prefix; the VIES service confirms whether the number is active for VAT.
Is this tool really free?
Yes, all tools on Kristools are 100% free and accessible without registration.
Is my data protected?
Yes. All processing is performed directly and securely inside your browser. No personal data is sent to our servers.