Frequently Asked Questions
Spanish phone numbers follow a 9-digit system, consisting of a +34 country code followed by a 9-digit National Significant Number (NSN). The NSN is further broken down into a 1-2 digit Service Identifier and a 7-8 digit Subscriber Number. This structure is mandated by Law 9/2014 of General Telecommunications.
You can validate Spanish geographic numbers using regular expressions. A basic JavaScript example would use the regex /^9[1-9][0-9]{7}$/ to check for the correct 9-digit format, starting with 9 followed by digits 1-9 and seven more digits. More robust validation libraries are recommended for production.
Spain's 9-digit system, established by Law 9/2014, promotes standardization and interoperability across telecommunications services. This unified structure simplifies number handling and ensures consistency for developers and users.
Spain has various number types including geographic (landlines), mobile, premium/special service, internet access (obsolete), freephone, and non-geographic numbers. Each type has a specific purpose and cost implications, governed by specific regulations.
Freephone numbers (800 and 900 prefixes) are best used for customer service and support lines in Spain. They are free for the caller, with the business bearing the cost, and are actually legally required for customer support in Spain.
Spanish mobile numbers typically start with 6 or 7. Traditional mobile numbers begin with 6, followed by eight more digits. Extended ranges, beginning with 7, are now also used, primarily for IoT and M2M communication.
No, Spanish mobile numbers are not available as virtual numbers. A physical SIM card from a Spanish provider is required according to the citation mentioned within the article. This is important to consider when developing telecommunications applications targeting the Spanish market.
Madrid's metropolitan area code is 91, followed by seven additional digits. This prefix helps identify calls originating from the Madrid region, which serves approximately 6.7 million people.
Using premium-rate numbers requires clear cost warnings and service descriptions prior to connection, as well as age verification for adult services. Detailed call records and real-time billing information (if possible) are important for compliance.
While still technically valid, 908 and 909 prefixes, historically used for dial-up internet, are largely obsolete due to advancements in internet technology. Avoid incorporating them unless dealing with legacy systems.
Non-geographic numbers (901/902) are often used by call centers and aren't tied to a specific location. 901 numbers share the cost between caller and receiver, while 902 numbers are charged entirely to the caller.
A Spanish phone number is easily identified by its +34 country code, followed by a 9-digit National Significant Number (NSN). This consistent format helps distinguish it from other international numbers.
Law 9/2014 of General Telecommunications governs the Spanish numbering system. This law ensures consistency, interoperability, and consumer protection within the Spanish telecommunications market.
Spain Phone Numbers: Format, Area Code & Validation Guide
Spanish phone numbers follow a standardized 9-digit format with the +34 country code. This comprehensive guide covers phone number structure, validation patterns, regulatory requirements, and implementation best practices for developers building telecommunications applications for the Spanish market.
Understanding the Spanish Numbering System
Spain's telecommunications infrastructure adheres to a structured 9-digit numbering system. The regulatory framework was modernized in June 2022 by Law 11/2022 (General Telecommunications Act), which superseded Law 9/2014 (https://www.global-regulation.com/translation/spain/1452763/law-9-2014,-of-9-may,-general-telecom.html). This law ensures consistency and interoperability across all services.
Regulatory Authority: The Comisión Nacional de los Mercados y la Competencia (CNMC) regulates the Spanish telephone numbering plan, manages number allocation, enforces telecommunications regulations, and maintains the National Telephone Numbering Plan. The State Secretariat for Telecommunications and Digital Infrastructures also shares regulatory responsibilities.
Core Components of a Spanish Phone Number
Every Spanish phone number consists of three key elements:
How to Dial Spain Phone Numbers: International & Domestic Examples
Domestic calls within Spain:
International calls to Spain:
E.164 Format (for API/database storage):
Key Regulatory Principles
The Spanish numbering system operates under a comprehensive regulatory framework. Consider these principles when designing your applications:
Best Practice: Always validate and store Spanish numbers using the full 9-digit NSN format to ensure compatibility across all service types.
E.164 Storage Best Practices
For database storage and API integration, follow the E.164 international standard:
+34
followed by the 9-digit NSN with no spaces, parentheses, or hyphens+34913456789
(not+34 91 345 6789
or913-456-789
)Spanish Phone Number Types: Mobile, Landline & Special Services
Geographic Numbers (Landlines)
Geographic numbers are tied to specific geographic areas within Spain. Their format reflects historical telecommunications development and population density. Certain prefixes correspond to major metropolitan areas.
Important: Due to number portability regulations, geographic prefixes indicate the original allocation region but do not guarantee the current carrier or physical location of the line.
91X XXX XXX
93X XXX XXX
96X XXX XXX
95X XXX XXX
94X XXX XXX
981 XXX XXX
971 XXX XXX
922 XXX XXX
928 XXX XXX
For a complete list of all provincial prefixes, see the Wikipedia reference.
Validating Geographic Numbers
Use regular expressions to validate geographic numbers in your application. Here's an example in JavaScript:
This code snippet demonstrates a basic validation check. For production environments, use libphonenumber or google-libphonenumber for comprehensive validation with carrier detection and number portability handling.
Production-grade validation with libphonenumber:
Mobile Numbers
Spain's mobile numbering system has evolved to accommodate growing demand. Two main ranges exist:
Traditional Ranges (6XX XXX XXX)
Originally allocated in the 1990s, these ranges are widely recognized. All major mobile operators use these prefixes.
Extended Ranges (7YX XXX XXX)
Introduced in 2009–2010 to meet increasing demand, these ranges are primarily used for IoT devices, M2M communication, and newer service types. The 'Y' in the prefix can be any digit from 1 to 9 (not 0, which is reserved for personal numbers).
Important Note: Spanish mobile numbers are not available as virtual numbers. You need a physical SIM card for these.
Implications for Developers:
Premium and Special Service Numbers
These numbers offer specialized services and incur higher charges for the caller. Handle these carefully and transparently.
Pricing Details (as of 2018, rates subject to change):
Legal Requirements:
Developer Considerations for Premium Numbers
When integrating premium-rate numbers into your application:
Important Note: Spanish customer service regulations (Law 11/2022, Royal Decree 899/2009) mandate that customer support must be provided via freephone numbers (800/900), and callers should be connected to a human representative within 3 minutes in 95% of cases. Spain's Customer Service Law (enacted 2023–2024) reinforces these requirements. Violations can result in fines up to €20 million for very serious infringements. Sources: Enreach Spain, DLA Piper.
Internet Access Numbers (908/909 XXX XXX)
These numbers were historically used for dial-up internet access. While still technically valid, they are largely obsolete. Avoid implementing support for these unless specifically required for legacy systems. Consider blocking or flagging these numbers in modern applications.
Freephone Numbers (800 XXX XXX and 900 XXX XXX)
These numbers are free for the caller, with the called party bearing the cost. They are commonly used for customer service and support lines. Spanish consumer protection law and the Customer Service Law require freephone numbers for customer support in regulated sectors (utilities, transport, postal, telecoms, financial services) and companies with over 250 employees or €50M annual turnover.
Non-Geographic Numbers (901/902 XXX XXX)
These numbers are not tied to a specific geographic location and are often used by call centers. Pricing structure:
Important: 901 and 902 numbers are excluded from inclusive call bundles and can be expensive when calling from mobiles or internationally. EU regulations prohibit using premium-rate or shared-cost numbers for customer service lines – provide freephone alternatives.
Additional non-geographic ranges:
Emergency and Short Numbers
Developers building dialer applications or communication platforms must ensure these numbers are always accessible:
Never block, rate-limit, or subject these numbers to payment requirements.
SMS and MMS Capabilities
Spanish phone numbers support standard SMS and MMS services:
Best practices:
Phone Number Validation Libraries and Tools
For production applications, use established libraries rather than custom regex:
Reference: Google libphonenumber GitHub
Quick Reference: Validation Patterns
Frequently Asked Questions
Q: What is the country code for Spain? A: Spain's country code is +34. When calling Spain from abroad, dial your country's exit code (011 from US, 00 from Europe), then +34, followed by the 9-digit Spanish phone number.
Q: How many digits are in a Spanish phone number? A: Spanish phone numbers are always 9 digits long. This applies to all number types: mobile (starting with 6 or 7), landline (starting with 8 or 9), and special services.
Q: Can I use a Spanish mobile number without a physical SIM? A: No. Spanish mobile numbers (6XX, 7YX) require a physical SIM card. Virtual number services cannot provide genuine Spanish mobile numbers.
Q: How do I format a Spanish phone number for international calling? A: Use E.164 format: +34 followed by the 9-digit number with no spaces. Example: +34913456789 for a Madrid landline or +34612345678 for a mobile number.
Q: How do I handle number portability in my database? A: Store numbers in E.164 format and avoid making assumptions about carriers based on prefixes. Use carrier lookup APIs if you need current carrier information.
Q: Are there restrictions on international calling from Spain? A: No general restrictions exist, but some premium numbers (901, 902) may be blocked by international carriers. Always provide freephone alternatives.
Q: What's the difference between 800 and 900 freephone numbers? A: Both are freephone, with costs borne by the recipient. The distinction is largely administrative; both function identically for callers.
Q: How do I comply with Spain's 3-minute customer service rule? A: Implement call routing optimization, sufficient staffing, and 24/7 availability for incident reporting. Monitor that 95% of calls reach a human within 3 minutes.
Conclusion
This guide provides a comprehensive overview of Spanish phone number formats. By understanding the structure, regulations, and best practices outlined here, you can develop telecommunications applications that are both robust and compliant with Spanish regulations. Remember to:
+34
+ 9-digit NSN)For the latest regulatory updates, consult the CNMC website and refer to Law 11/2022 (General Telecommunications Act).