Portugal / Tax numbers
NIF Validator (Portugal)
Check whether a Portuguese tax number (NIF, número de identificação fiscal) is well formed: 9 digits and a valid check digit, with the kind of taxpayer its first digits show. Checks a list at once.
NIF Validator (Portugal): A NIF has nine digits. The first eight are multiplied by 9, 8, 7 down to 2 and added; the ninth digit is chosen so that the total, plus it, divides by 11 (a remainder that would need 10 uses 0). The first digit or two show the kind of taxpayer, such as 1–3 for individuals and 5 for companies. Results agreed with the python-stdnum library on 6,000 numbers. Runs 100% locally in your browser with zero server file uploads.
- Category
- Business & admin tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
The ninth digit is a check digit: the first eight are multiplied by 9 down to 2 and added, and the digit makes the total a multiple of 11 (10 is written as 0). The first digits show the kind of taxpayer. Only the format is checked, not whether the number has been issued; everything stays in your browser.
Working the check digit out
For 12345678, the sum is 1×9 + 2×8 + 3×7 + 4×6 + 5×5 + 6×4 + 7×3 + 8×2 = 156. 156 divided by 11 leaves 2, and 11 − 2 = 9, so the full NIF is 123456789.
For Brazilian and Spanish numbers, see the CPF and CNPJ validator and the DNI and NIE validator.
Where NIFs appear
Invoices (faturas) in Portugal carry the seller's NIF and, when asked, the buyer's, so a mistyped number means the expense does not reach the buyer's tax account. Checking the digit catches most typing slips.
How to use it
- Type or paste NIF numbers, one per line, with or without spaces or the PT prefix.
- Read which are valid, and why the others are not.
- Use the kind shown, such as individual or company, to spot numbers of the wrong type.
Privacy & limitations
Numbers are checked in your browser and never sent anywhere.
Related tools
Frequently asked questions
Does a valid result mean the number exists?
No: it means the number is correctly formed. To confirm a company's NIF, look it up with the Portuguese tax authority or, for EU VAT, in the VIES system.
Is the NIF the same as the VAT number?
For Portuguese businesses the VAT number is PT followed by the NIF, so PT 123 456 789 uses the NIF 123456789.
Why do some NIFs start with 45 or 98?
Those prefixes are for non-residents: 45 for individuals and 98 for those without a permanent establishment in Portugal.
Free tool · runs in your browser · no account required