Portuguese NIF Validator

Enter any 9-digit NIF to validate its format and check digit using the official Modulo 11 algorithm — private, instant, no data stored.

Enter 9 digits 0 / 9
👤 First digit ?:

What is a Portuguese NIF?

The NIF (Número de Identificação Fiscal), also known as Número de Contribuinte, is Portugal's 9-digit tax identification number. Issued by the Tax and Customs Authority (Autoridade Tributária e Aduaneira — AT), it is required for every economic or legal transaction in Portugal: opening a bank account, signing a rental agreement, registering a vehicle, filing a tax return, or issuing a fiscal invoice (fatura).

🔒

All validation runs entirely in your browser. No NIF numbers or personal data are sent to our servers. This tool validates mathematical format only — it does not check whether a NIF is currently registered with AT.

NIF First-Digit Reference — Entity Types

The first digit of a NIF identifies the type of entity it belongs to:

First digit(s)Entity typeIssued by
1, 2, 3Portuguese individual taxpayerAT
45EU citizen without Portuguese residencyAT
5Corporation or company (NIPC)IRN / AT
6Public body or state entityAT
7Non-resident (irregular regime)AT
8Non-resident (flat-rate regime)AT
9Collective entity, non-profit, or associationAT

How the Modulo 11 Validation Works

Every valid NIF must satisfy the Modulo 11 checksum. Here is the step-by-step process our validator applies:

Take the first 8 digits of the NIF and assign each a weight: digit 1 gets weight 9, digit 2 gets weight 8, … digit 8 gets weight 2.

Multiply each digit by its weight and sum all products to get a total T.

Calculate the remainder: R = T mod 11.

Determine the expected check digit: if R is 0 or 1, the check digit must be 0; otherwise the check digit must equal 11 − R.

Compare the expected check digit with the actual 9th digit. If they match, the NIF is valid.

Common Reasons a NIF Fails Validation

The most frequent causes of an invalid NIF are: a transcription error (a single digit swapped or misread), an incorrect first digit (the entity type prefix does not correspond to a valid category), or a missing leading zero in NIFs starting with 0. Our validator shows the expected check digit alongside the result, helping you identify which digit needs correction.

Related Tools

Frequently Asked Questions

What is a Portuguese NIF?
A NIF (Número de Identificação Fiscal), also called Número de Contribuinte, is Portugal's 9-digit tax identification number issued by the Tax and Customs Authority (AT). It is required for all economic and legal activity in Portugal, from opening a bank account to filing a tax return.
How is a NIF validated?
NIF validation uses the Modulo 11 algorithm: multiply each of the first 8 digits by a descending weight (9 to 2), sum the results, divide by 11 and take the remainder. If the remainder is 0 or 1 the check digit (9th digit) must be 0; otherwise the check digit must equal 11 minus the remainder.
What do the first digits of a NIF mean?
1, 2, 3 = Portuguese individual. 45 = EU citizen without Portuguese residence. 5 = company/NIPC. 6 = public body. 7 = non-resident (irregular). 8 = non-resident (flat-rate). 9 = collective entity or non-profit.
Does this tool confirm if a NIF is registered with AT?
No. This tool validates the mathematical format and check digit using the Modulo 11 algorithm. It does not connect to the Portuguese Tax Authority (AT) database and cannot confirm whether a NIF is currently active or registered to a specific entity.
Is my NIF sent to any server when I validate?
No. All validation logic runs entirely in your browser using JavaScript. No NIF numbers or personal data are transmitted to our servers. Your checks are fully private and GDPR-safe.