Frequently Asked Questions
Sri Lankan phone numbers follow the E.164 international standard, which includes the +94 country code followed by a 9-digit national number. For example, a valid number would look like +94771234567. Always store numbers in this format for consistency and international compatibility.
Use regular expressions for robust validation. In JavaScript, an example regex is /^(?:0|94|\+94)?([0-9]{9})$/. This checks for a valid 9-digit number, optionally preceded by 0, 94, or +94. Server-side validation is crucial for security.
You can identify the type by the prefix. Mobile numbers typically start with 07[0-8], landlines with 0 followed by a 2-digit area code, and shortcodes are usually 3 or 4 digits. Use this to customize handling in your application.
Storing numbers in E.164 format (+94XXXXXXXXX) ensures consistency and simplifies internationalization. It facilitates compatibility with various telecommunication systems and streamlines processing.
MNP lets users switch operators while keeping their number. Developers should integrate with an MNP lookup service (if available) to determine the current operator and route calls/messages correctly.
Integrate with an MNP lookup service to dynamically identify the current operator for a given number. This is important for accurate routing and billing, especially with number portability.
Common emergency numbers like police (119), ambulance (110), and disaster management (1919) should be dialed directly without prefixes. Implement logic to detect these numbers and handle them appropriately in your application.
Area codes range from 11 for Colombo to 91 for Ampara. They are two digits and precede the 7-digit subscriber number in landline phone numbers. Mobile numbers do not use area codes.
Sri Lanka's network infrastructure varies. Implement network quality detection and fallback mechanisms for areas with limited connectivity. Design features like caching and adaptive bitrate streaming for optimal performance.
The Telecommunications Regulatory Commission of Sri Lanka (TRC) website (http://www.trc.gov.lk) provides the latest regulations, updates, device approval requirements, and licensing information for telecommunications operations.
The international prefix for calling Sri Lanka is 00. Dial 00 followed by 94 (the country code) and then the 9-digit phone number.
Client-side validation enhances user experience by immediately alerting users to formatting errors. It should be used in conjunction with server-side validation for data integrity and security.
Yes, you can identify shortcodes by checking for numbers that are typically 3 or 4 digits long. In your code, use regular expressions or other pattern matching techniques to distinguish them from regular phone numbers.
Sri Lanka Phone Number Validation: Complete Guide to +94 Format & Implementation
Validate Sri Lanka phone numbers (+94 country code) using E.164 format standards. This guide covers phone number validation patterns, TRC (Telecommunications Regulatory Commission) regulations, mobile operator prefixes for Dialog, Mobitel, Hutch, and Airtel, JavaScript validation code, area codes, and emergency number handling for Sri Lankan telecommunications applications.
Quick Reference
Sri Lanka Phone Number Format and Validation
Avoid these common validation pitfalls:
Sanitize input before validation:
Sri Lanka phone number validation requires understanding the country's E.164-compliant numbering system. The TRC regulates all Sri Lanka phone numbers, which use the +94 country code and a 10-digit national format (including trunk prefix 0).
E.164 Format Structure for Sri Lanka Numbers
Identify Sri Lanka Number Types by Prefix
Mobile Numbers – Begin with 070–078 (10 digits total):
Landline Numbers – Format:
0XX Y ZZZZZZ
0XX
: 2-digit area code identifying geographic regionY
: Operator code (2 = SLT Mobitel copper/fiber, 3 = SLT Mobitel wireless LTE, 4 or 7 = Dialog wireless LTE)ZZZZZZ
: 6-digit subscriber numberComplete Sri Lanka area codes (source: TRC Numbering Plan):
Short Codes – 3 or 4 digits for emergency and special services
Important: Mobile operator prefixes indicate original network assignment. With Mobile Number Portability (MNP), subscribers can switch operators while keeping their numbers.
Implement Validation with Regular Expressions
Store numbers in E.164 format (+94XXXXXXXXX) for consistency and international compatibility.
Pattern explanation:
\D/g
removes all non-digit characters (spaces, hyphens, parentheses)^0[0-9]{9}$
matches exactly 10 digits starting with 0 (domestic format)^(?:\+?94)[0-9]{9}$
matches country code 94 (with optional +) followed by 9 digits?:
makes the group non-capturing for better performanceValidate user input with regular expressions:
Validate mobile-only numbers (rejects invalid prefixes like 060, 079):
Identify number types based on prefix patterns:
Mobile Number Portability (MNP)
MNP Status: As of 2025, Mobile Number Portability is not yet operational in Sri Lanka. The TRC announced in May 2025 that MNP implementation is underway, with service expected to launch in 2026 (TRC official announcement, SAMENA Council). Until MNP launches, mobile prefixes reliably indicate the current operator.
When MNP becomes available, subscribers will be able to switch operators while keeping their numbers. At that point, implement lookup mechanisms to determine the current operator.
MNP Lookup Services – Once MNP is operational, use third-party services for operator identification:
Integrate an MNP lookup service for accurate operator identification:
Route calls based on operator:
MNP lookup considerations:
Emergency Numbers
All emergency numbers are toll-free and accessible from any phone, even with low signal or credit. Never apply prefixes, rate limiting, or validation restrictions to emergency numbers.
Primary Emergency Services:
Security and Defense:
Specialized Support:
Operator Customer Service:
All emergency services operate 24/7 with multi-language support (Sinhala, Tamil, English). Mobile operators prioritize emergency calls even during network congestion.
Source: TRC 3-Digit Short Codes for Special Services
Implement emergency detection:
Network Considerations
Sri Lanka has mixed urban and rural network infrastructure. Dialog and Mobitel claim 95%+ 4G island-wide coverage. As of February 2025, Dialog and SLT Mobitel are conducting pre-commercial 5G trials but have not launched public 5G services (Opensignal Sri Lanka Report, Feb 2025). Design your application to handle varying connectivity.
Network quality by operator (2025):
Detect network quality and provide fallbacks:
Implement coverage-aware features:
Compliance and Regulations
Follow TRC regulations and data protection laws for legal compliance:
Sri Lanka's Personal Data Protection Act (PDPA) No. 9 of 2022 regulates phone number collection and processing:
Note: Core PDPA provisions (Parts I-III, VII) had delayed implementation as of March 2025. Monitor Data Protection Authority website for enforcement updates.
SMS Marketing Consent:
TRC Telecommunications Regulations:
Compliance requirements by business type:
Error Handling
Provide clear, actionable error messages that explain what went wrong and how to fix it.
Implement error handling with clear, actionable messages:
Handle common scenarios:
Support internationalization (Sinhala/Tamil error messages):
Frequently Asked Questions (FAQ)
What is the country code for Sri Lanka phone numbers?
Sri Lanka's country code is +94. When dialing from abroad, dial +94 followed by the 9-digit number (without the leading 0). For example, to call 0771234567 from outside Sri Lanka, dial +94771234567. Within Sri Lanka, dial the full 10-digit number including the leading 0.
How many digits are in a Sri Lanka phone number?
Sri Lanka phone numbers have 10 digits in the domestic format (including the trunk prefix 0). When using the international format with the country code (+94), the number is 9 digits (the 10-digit domestic number without the leading 0). Examples: domestic format 0771234567, international format +94771234567.
What is the format for Sri Lanka mobile numbers?
Sri Lanka mobile numbers are 10 digits starting with 07 (specifically 070-078). The format is 07X XXXXXXX where the first three digits identify the mobile operator:
All Sri Lankan mobile numbers begin with 07, followed by 8 additional digits. With Mobile Number Portability (MNP), these prefixes indicate the original network but not necessarily the current operator.
How do I validate a Sri Lanka phone number in JavaScript?
Use regular expressions to validate Sri Lanka phone numbers. Check for domestic format (10 digits starting with 0) or international format (+94 followed by 9 digits). Always sanitize input by removing spaces, hyphens, and parentheses before validation. See the JavaScript validation examples in this guide for production-ready code.
What are Sri Lanka landline area codes?
Sri Lanka landline area codes are 2-digit numbers that identify geographic regions:
Landlines follow the format: 0XX Y ZZZZZZ (area code + operator code + 6-digit subscriber number). See the complete area code table for all regions.
What is the emergency number in Sri Lanka?
Sri Lanka has multiple emergency numbers:
All emergency numbers are toll-free and accessible even with low signal or credit. View the complete emergency numbers list for specialized services.
Does Sri Lanka support mobile number portability?
As of 2025, Mobile Number Portability (MNP) is not yet operational in Sri Lanka. The TRC announced that MNP is expected to launch in 2026. Until then, mobile number prefixes reliably indicate the operator (Dialog, Mobitel, Hutch, Airtel). Once MNP launches, use an MNP lookup service for accurate operator identification.
Who regulates Sri Lanka phone numbers?
The Telecommunications Regulatory Commission (TRC) regulates the country's phone numbering system and telecommunications services. The TRC ensures compliance with international E.164 standards and manages the national numbering plan. Visit http://www.trc.gov.lk for official regulations.
Additional Resources
Developer tools and libraries:
Conclusion
Validating Sri Lanka phone numbers requires understanding E.164 format standards, TRC regulations, and the country's 10-digit numbering system with +94 country code. This guide provides production-ready validation patterns, operator identification methods, and regulatory compliance requirements.
Key takeaways:
Security best practices:
Testing strategies:
Implement the JavaScript validation functions provided in this guide, expand them with comprehensive error handling, and follow security best practices for telecommunications data.
Related topics: