1001Ferramentas
🇵🇹Validators

Portugal NIF Validator

Validate Portuguese NIF (Tax ID) — mod 11 check digit and valid prefixes (1, 2, 3, 5, 6, 8, 9).

NIF: the Portuguese tax identification number

The NIF — Numero de Identificacao Fiscal, also known as Numero de Contribuinte, is the unique identifier issued by the Portuguese tax authority for every natural or legal person with tax obligations in Portugal. It is the Portuguese counterpart of the Brazilian CPF/CNPJ pair, but condensed into a single 9-digit number whose first digit reveals the holder type.

It is issued by the Autoridade Tributaria e Aduaneira (AT), the Portuguese revenue and customs authority. Foreign residents — including Brazilians applying for Portuguese citizenship or a residence permit — request their NIF through the AIMA (Agencia para a Integracao, Migracoes e Asilo) or through a fiscal representative residing in Portugal. The estimated 600,000+ Brazilians with double citizenship hold a Portuguese NIF.

First digit decodes the holder type

  • 1, 2 or 3: natural person, Portuguese national or resident.
  • 45: non-resident natural person who only earns withholding-taxed income.
  • 5: legal person (commercial company, foundation).
  • 6: public-sector body (ministry, autarchy, university).
  • 7: heritages, irregular societies, atypical situations.
  • 8: empresarios em nome individual (sole traders).
  • 9: regulated legal entities and civil societies without commercial nature.

Check-digit algorithm (modulo 11)

The 9th digit is calculated from the first 8 by a mod 11 algorithm:

  • Multiply digits 1 to 8 by weights 9, 8, 7, 6, 5, 4, 3, 2.
  • Sum the products and compute the remainder modulo 11.
  • If the remainder is 0 or 1, the check digit is 0; otherwise it is 11 minus the remainder.
NIF 123456789
1*9 + 2*8 + 3*7 + 4*6 + 5*5 + 6*4 + 7*3 + 8*2
= 9+16+21+24+25+24+21+16 = 156
156 mod 11 = 2 -> DV = 11 - 2 = 9 (valid)

Where the NIF is required

  • IRS (Imposto sobre o Rendimento das Pessoas Singulares) and IRC (corporate) tax filings.
  • Invoices and e-Fatura: the consumer can request the NIF on every supermarket receipt to deduct VAT.
  • Healthcare (SNS): registering at a centro de saude.
  • Education: school enrolments and university tuition.
  • Banking and lending: opening accounts, mortgages, leasing.
  • Real estate: rental contracts, IMI, deeds.
  • Cross-border B2B: VIES — the EU VAT system — uses the NIF prefixed with PT as the Portuguese VAT number.

NIF for Brazilians and digital nomads

Brazilians moving to Portugal must request the NIF at an Loja do Cidadao or an AT branch, in person or through a fiscal representative. NIF Online and other paid services obtain it remotely for around €100, useful for digital nomads under the D7 or D8 visa. The NIF is independent from the Numero de Utente (SNS healthcare number) and from the Numero de Seguranca Social (NISS), even though all three identifiers usually accompany a residence application.

Brazilian companies selling to Portuguese customers — SaaS, e-learning, Pasta da Saude marketplace — must validate the customer's NIF, charge Portuguese VAT (IVA) according to OSS rules and report through the EU VAT One Stop Shop.

Fraud and anti-fraud practices

Using someone else's NIF or fabricating one constitutes fraud and identity theft under the Portuguese Codigo Penal. Combine the algorithmic check with name, date of birth and address whenever possible. For B2B contexts, query VIES (vies.ec.europa.eu) — the only free and authoritative source that confirms a Portuguese VAT number is active. The AT only allows direct lookups for licensed companies through a paid API.

FAQ

Can my Brazilian CPF work as a NIF in Portugal?

No. CPF and NIF are issued by different jurisdictions and have different formats. A Brazilian living in Portugal must request a Portuguese NIF even while keeping the active CPF in Brazil.

If I obtain Portuguese citizenship, do I get a NIF automatically?

In practice, yes — the AT issues a NIF as part of the citizenship card (Cartao de Cidadao) process for new citizens, but it may need to be activated at the AT or Loja do Cidadao.

Can I validate a NIF online through the AT?

Direct AT lookup is reserved for licensed companies. For Portuguese VAT numbers, the EU VIES service is the free public alternative.

Does the validator store my NIF?

No. The mod 11 check runs entirely in your browser; no data is transmitted or logged.

Does a valid mod 11 mean the NIF is real?

No. It only confirms the 9 digits form an arithmetically valid sequence. Existence and status require AT or VIES lookups.

Related Tools