Frequently Asked Questions
The country code for Portugal is +351. You can also use 00351 for international calls originating from Portugal. It's important to handle both formats in your application for maximum flexibility.
For optimal user experience, format Portuguese numbers as XX XXX XXXX for display. This adheres to local conventions and improves readability. Remember to remove the country code before formatting for local display.
All Portuguese phone numbers have 9 digits, following a closed numbering plan implemented in 1999. This applies to all numbers, regardless of whether they are landlines, mobile, or special services.
Use regular expressions to validate Portuguese phone numbers effectively. Ensure your validation accounts for different number types (landline, mobile, special services) and handles the optional country code (+351 or 00351).
Portugal switched to a 9-digit closed numbering plan in 1999, simplifying the system. Now all calls within the country require nine digits, regardless of their nature. This is a key aspect to consider for accurate processing.
Portuguese landline numbers follow the format 2X XXXXXXX, where '2' signifies a geographic number. The following digits represent the area code and the subscriber number within that area.
Due to number portability, you should always check the current operator of a Portuguese number via ANACOM's database before making assumptions. Implement an API call to their portability database to determine the current operator, as historical prefixes are no longer reliable indicators.
Always store Portuguese phone numbers in the international E.164 format (+351XXXXXXXXX). This ensures consistency, simplifies international interactions, and facilitates accurate processing.
Special service numbers in Portugal include toll-free (800 XXXXXX), shared cost (808 XXXXXX), and premium-rate (6XX XXXXX) numbers. It's crucial to handle these numbers carefully and inform users about potential charges.
ANACOM (Autoridade Nacional de Comunicações) is the national regulatory authority for telecommunications in Portugal. They enforce numbering standards, manage number portability, and provide essential information on current regulations.
Regularly consult ANACOM's official documentation for the latest regulations, number allocations, and updates. It's essential for maintaining accuracy and compliance in handling Portuguese phone numbers, particularly geographic number ranges.
Portuguese mobile numbers begin with 9, followed by one of a few specific second digits and a seven digit subscriber number, formatted as 9X XXXXXXX. Remember that due to number portability, the prefix no longer reliably indicates the operator.
No, due to number portability, historical operator prefixes for Portuguese mobile numbers are unreliable. You must use ANACOM's portability database to determine the current operator.
Key best practices include storing numbers in E.164 format, formatting for local display, validating input, handling number portability, implementing robust error handling, and ensuring regulatory compliance with ANACOM's guidelines.
Portugal Phone Numbers: Format, Area Code & Validation Guide
Introduction
Building an application that interacts with Portuguese phone numbers? Understanding Portugal's country code (+351) and 9-digit phone number format is essential for accurate validation and international calling. Accurate handling prevents failed deliveries, billing errors, and compliance violations – whether you're validating user input for an e-commerce checkout, implementing SMS-based two-factor authentication, routing customer support calls, or preventing fraudulent transactions. This guide provides the technical specifications, practical guidance, and best practices you need to confidently navigate the Portuguese telephone numbering system.
Quick Facts About Portugal Phone Numbers
Establish these fundamental facts about Portuguese phone numbers:
This shift to a closed numbering plan on 31 October 1999 simplified the system – all calls within Portugal now require 9 digits, regardless of whether they're local or long-distance.
Portuguese Phone Number Structure
Portugal adheres to the ITU-T E.164 recommendation, ensuring international compatibility. ANACOM, the national regulatory body, enforces strict compliance with this standard. All Portuguese subscriber numbers follow a consistent 9-digit structure:
Each component:
Portuguese Phone Number Categories and Implementation Guidelines
Understand the different categories of Portuguese phone numbers for accurate validation and processing:
1. Portugal Landline Numbers (Geographic Numbers)
2X XXXXXXX
2. Portugal Mobile Numbers
9X XXXXXXX
3. Special Services
800 XXXXXX
– Free for the caller808 XXXXXX
– Cost split between caller and recipient (capped at €0.10/minute from fixed lines per ANACOM regulations)607 XXXXXX
– Higher calling rates up to €3.28/minute plus VAT for value-added services707 XXXXXX
,708 XXXXXX
– Entertainment and business services (€0.25 + VAT/minute, capped by ANACOM)30X XXXXXX
– Voice over IP service providers884 XXXXXX
– Follow-me services that redirect to multiple numbers10XX
– Codes for selecting specific carriers for callsConsult ANACOM's documentation for a complete list of special number ranges and their current allocations.
How to Validate Portuguese Phone Numbers
Implement robust Portuguese phone number validation using regular expressions:
Python Validation Example:
Test your validation logic thoroughly with valid and invalid inputs, including edge cases.
Portugal Phone Number Implementation Best Practices
Beyond basic validation, implement these best practices for Portuguese phone numbers:
1. How to Store Portuguese Phone Numbers
Store Portuguese phone numbers in E.164 format (
+351XXXXXXXXX
). This ensures consistency and simplifies international interactions.Database Schema Recommendations:
This function handles cases where the user inputs the country code or not.
2. How to Format Portuguese Phone Numbers for Display
Format Portuguese phone numbers for display according to local conventions (
XX XXX XXXX
) to improve readability.This formatting function correctly handles the varying lengths of subscriber numbers for different service types.
3. Portugal Number Portability Handling
Portugal's number portability allows users to keep their number when switching operators (implemented January 2002 for mobile, June 2001 for fixed). ANACOM Regulation No. 38/2025 (effective November 2025) establishes:
Important: ANACOM does not provide a public API for real-time portability lookups. Operators exchange portability data through the Reference Entity system. For accurate operator routing:
Caching Strategy: Cache operator lookups for 24 hours to balance accuracy and performance. Portability changes take effect during scheduled windows, so hourly updates are unnecessary.
Technical Considerations for Portuguese Phone Numbers
1. Error Handling
Implement robust error handling with specific error codes for Portuguese phone number validation:
2. International Integration
Support both
+351
and00351
prefixes for international calls. Use E.164 formatting consistently for storage and internal processing.SMS Character Encoding for Portugal:
3. Regulatory Compliance
GDPR and Data Protection:
Portugal implements GDPR through Law No. 58/2019 (effective August 8, 2019). Key requirements for phone number data:
Marketing Communications Opt-Out:
Under Portuguese law (Law No. 46/2012 of August 29) and enforced by ANACOM:
Maintain up-to-date area code mappings and implement required consumer protection measures, especially for premium-rate numbers. Regularly consult ANACOM's official documentation for the latest regulations and updates.
Conclusion
You now have a comprehensive understanding of Portuguese phone number formatting, validation, and best practices. Follow this guide to build robust and reliable applications that seamlessly interact with the Portuguese telecommunications system.
Key Takeaways:
Next Steps:
For the most current information and regulatory updates, refer to ANACOM's official resources at https://www.anacom.pt/.
Frequently Asked Questions (FAQ)
What is Portugal's country code for international calls?
Portugal's country code is +351. When calling Portugal from abroad, dial either +351 or 00351 followed by the 9-digit Portuguese phone number. For example, to call a Lisbon landline (21 123 4567) from outside Portugal, dial +351 211 234 567. All Portuguese numbers require the full 9 digits after the country code, with no additional trunk prefix or area code prefix needed.
How many digits are in a Portuguese phone number?
Portuguese phone numbers contain exactly 9 digits after the country code. This applies to all number types – landlines, mobile phones, toll-free numbers, and special services. The 9-digit format was standardized on 31 October 1999 when Portugal implemented a closed numbering plan, eliminating the previous trunk prefix and simplifying the system.
What area code is Lisbon, Portugal?
Lisbon uses area code 21 for landline numbers. All Lisbon landline numbers follow the format 21X XXX XXX (9 digits total). When calling within Portugal, dial the full 9-digit number starting with 21. From abroad, dial +351 21X XXX XXX. Other major cities include Porto (area code 22) and regions like Aveiro, Coimbra, and Viseu (area code 23).
How do I validate a Portuguese mobile number?
Portuguese mobile numbers start with 9 followed by specific operator prefixes: 91 (Vodafone), 92 or 96 (MEO), and 93 (NOS). Use the regular expression
/^9[1236]\d{7}$/
to validate 9-digit mobile numbers. However, due to number portability (implemented since January 2002), these prefixes only indicate the original operator, not necessarily the current one. For accurate operator identification, query an operator portability database through a commercial agreement, as ANACOM does not provide public API access.What is the E.164 format for Portuguese phone numbers?
The E.164 format for Portuguese phone numbers is
+351XXXXXXXXX
, where the X's represent the 9-digit local number. For example, a Lisbon landline becomes +351211234567, and a mobile number becomes +351912345678. Store phone numbers in E.164 format to ensure consistency, simplify international interactions, and maintain compatibility with telecommunications APIs and services.Do Portuguese mobile numbers change when switching operators?
No, Portugal has implemented nationwide number portability, allowing users to keep their mobile number when switching operators (available since January 2002 for mobile, June 2001 for fixed lines). While prefixes like 91, 92, 93, and 96 originally indicated specific operators (Vodafone, MEO, NOS), these now only show the original operator, not the current one. Under ANACOM Regulation No. 38/2025, portability completes within one working day, costs €1 or less wholesale between operators, and is free for end-users.
What are the toll-free and premium rate numbers in Portugal?
Portugal uses several special service number formats: Toll-free numbers start with 800 (format: 800 XXXXXX) and are free for callers. Shared cost numbers start with 808 (format: 808 XXXXXX) where costs split between caller and recipient, capped at €0.10/minute from fixed lines. Premium rate numbers start with 607 (format: 607 XXXXXX) and charge up to €3.28/minute plus VAT for value-added services. Standard rate numbers (707, 708) are capped at €0.25 + VAT/minute. Notify users about potential charges for premium-rate numbers and obtain explicit consent before initiating such calls, as required by Portuguese consumer protection laws.
How do I format Portuguese phone numbers for display?
Format Portuguese phone numbers using the local convention
XX XXX XXXX
for readability. For example, display 211234567 as "21 123 4567" for landlines and 912345678 as "91 234 5678" for mobile numbers. Remove the country code (+351) for domestic display, and use spaces to separate the area/operator code (2 digits), first subscriber block (3 digits), and remaining subscriber digits (3–4 digits depending on service type).What is the emergency number in Portugal?
Portugal uses 112 as the single European emergency number for police, fire, and ambulance services. This number is free to call from any landline or mobile phone, available 24/7. For non-emergency health advice, contact SNS 24 at 808 24 24 24 (Health Line 24). Note that calling 999 or 991 does not work in Portugal – use 112 for emergencies. Ensure the emergency number 112 is always accessible in your applications, even when the phone is locked.
What are GDPR requirements for storing Portuguese phone numbers?
Under Portuguese Law No. 58/2019 implementing GDPR, storing phone numbers requires: (1) Legal basis – explicit consent, contractual necessity, or legitimate interest; (2) Purpose limitation – clearly state why you collect phone numbers; (3) Data minimization – collect only necessary data; (4) Retention limits – maximum 24 months for call recordings, longer only if contractual obligations require; (5) Right to erasure – users can request deletion; (6) Security measures – encrypt phone data at rest and in transit. For marketing communications, obtain prior express consent before sending SMS/calls, maintain consent logs, and honor opt-out requests immediately. Violations result in fines from €1,500 to €5,000,000. The supervisory authority is CNPD (https://www.cnpd.pt/).
Can I send SMS to Portuguese landline numbers?
No, you cannot send SMS messages to Portuguese landline numbers (starting with 2). SMS delivery is only supported for mobile numbers (starting with 9). If you attempt to send an SMS to a landline via the Twilio REST API or similar services, the API returns a 400 error with code 21614, the message is not logged, and your account is not charged. Validate that the destination number is a mobile number before attempting SMS delivery.
How does SMS character encoding work for Portuguese messages?
Portuguese SMS uses GSM-7 encoding by default, supporting Portuguese accented characters (á, â, ã, à, ç, é, ê, í, ó, ô, õ, ú) and allowing 160 characters per message. If your message includes emoji or non-GSM characters, it switches to UCS-2 (Unicode) encoding, reducing the limit to 70 characters per message. For longer messages, concatenation splits them into segments: 153 characters per segment for GSM-7, or 67 characters per segment for UCS-2 (with 7 characters reserved for concatenation headers). To optimize costs and deliverability, avoid emoji in transactional messages and test character encoding before sending bulk campaigns.
Related Resources
Country Phone Number Guides:
E.164 Format & International Standards:
SMS & Telecommunications APIs:
Regulatory & Compliance: