Portuguese VAT Number Validation
Format, pattern, and MOD 11 checksum algorithm for PT VAT numbers
Portuguese VAT numbers are the domestic 9-digit tax identifier prefixed with
PT for EU VAT use: NIF (Número de Identificação Fiscal) for individuals,
or NIPC (Número de Identificação de Pessoa Coletiva) for companies and other
legal persons.
The 9-digit identifier has a non-zero category prefix and a weighted MOD 11 check digit.
Format vs. Active Validation
This checks format only, not if a VAT number is really registered. Use VatDB's API to verify if a number is really registered and active. VatDB checks official EU and national datasources.
Format Overview
| Property | Value |
|---|---|
| Country Code | PT |
| Format | 9 digits (first cannot be 0) |
| Length | 9 digits (11 characters with PT country prefix) |
| Domestic identifier | NIF/NIPC without the PT prefix |
| Examples | PT500278725 PT501525882 PT500348723 |
Regex Pattern
^PT[1-9][0-9]{8}$
First Digit Prefixes (high level)
| Prefix | Category (high level) |
|---|---|
| 1-3 | Individual-person NIF ranges (different categories) |
| 5 | Company/legal-entity prefix (common corporate range) |
| 6 | Public entities |
| 7 | Other entities |
| 8-9 | Special / non-resident / other assigned ranges |
Checksum Algorithm (MOD 11)
def validate_pt_vat(number):
if number.startswith('PT'):
number = number[2:]
if len(number) != 9 or not number.isdigit():
return False
if number[0] == '0':
return False
weights = [9, 8, 7, 6, 5, 4, 3, 2]
total = sum(int(d) * w for d, w in zip(number[:8], weights))
check = 11 - (total % 11)
if check >= 10:
check = 0
return check == int(number[8])
Important Notes
- For Portuguese companies, the 9-digit legal-person identifier is commonly
called NIPC. For EU VAT checks, use the same number with the
PTcountry prefix. - The Portuguese Tax and Customs Authority started assigning individual-person
NIFs beginning with
3on 4 July 2019. Systems that only accept1or2as individual-person prefixes are outdated. - A number can pass format and checksum checks but still be invalid in VIES if it does not exist, is not active for intra-EU transactions, or the VAT registration is not finalized.
Frequently Asked Questions
How do I validate a Portuguese VAT number (NIF/NIPC)?
Check that it has PT followed by 9 digits, then apply the weighted MOD 11 checksum with weights [9,8,7,6,5,4,3,2]. Use VatDB's API to confirm whether the number is really registered and active.
What does a Portuguese VAT number look like?
A Portuguese VAT number has the format PT123456789 - PT followed by a 9-digit NIF/NIPC. NIF is commonly used for individuals, while NIPC is used for companies and other legal persons.
How many digits are in a Portuguese VAT number?
A Portuguese VAT number contains exactly 9 digits after the PT country code. The domestic NIF/NIPC is 9 digits; the EU VAT form is 11 characters: PT + 9 digits.
What is the difference between a Portuguese NIF and NIPC?
NIF is the Portuguese tax ID commonly used for individuals; NIPC is the equivalent identifier for companies and other legal persons. For EU VAT purposes, either 9-digit identifier is prefixed with PT.
What does the first digit of a Portuguese NIF/NIPC mean?
It is a category prefix: 1-3 are individual-person ranges, while 5-9 cover company, public-entity, special, non-resident, and other assigned ranges.
Is every Portuguese NIF or NIPC active for intra-EU VAT?
No. A number can pass format and checksum checks but still be invalid in VIES if it is not active for intra-EU transactions. Use VatDB's API to check live VAT status against official sources.
Where can I check a Portuguese company's VAT number?
VatDB's API validates VAT numbers against official EU and national databases in real-time. Includes company details with each verification.
What's the difference between format validation and checking if a VAT number is active?
Format validation verifies structure and checksum, but it cannot confirm whether a number is registered, active, or enabled for intra-EU VAT. VatDB provides live status.
What are some real Portuguese (PT) VAT numbers I can test with?
These Portuguese (PT) VAT numbers are real and currently registered: PT500278725, PT501525882, PT500348723.
Validate Portuguese VAT Numbers Instantly
Use our API for real-time PT VAT number validation
Try Free