sms compliance
sms compliance
Singapore Phone Number Validation: +65 Format Guide & 8-Digit Number Verification (2025)
Learn how to validate Singapore phone numbers with +65 country code. Complete 2025 guide covering IMDA 8-digit format, mobile prefixes (8, 9), landline prefix (6), E.164 formatting, JavaScript validation code, VoIP integration, and emergency numbers. Get production-ready regex patterns for accurate phone number verification.
Singapore Phone Numbers: Complete Validation Guide for +65 Country Code & IMDA Format Requirements
Introduction
Looking to validate Singapore phone numbers in your application? This comprehensive guide covers everything you need: the +65 country code, IMDA's 8-digit format requirements, mobile prefixes (8 and 9), landline prefix (6), and production-ready validation code. Whether you're building a contact form, authentication system, or VoIP service, you'll learn how to correctly validate and format Singapore phone numbers according to official IMDA standards.
All Singapore numbers follow a simple 8-digit format with no area codes, making validation straightforward once you understand the prefix rules. Learn E.164 international formatting, regex validation patterns, and common edge cases to handle in production.
Understanding Singapore's Phone Number Format & Numbering System
The Infocomm Media Development Authority (IMDA) governs Singapore's telecommunications and enforces strict numbering conventions. Singapore uses a closed numbering plan with no area codes, simplifying validation compared to countries with regional variations. All Singapore phone numbers are 8 digits long, preceded by +65 for international calls.
Historical Evolution: Understand this context to anticipate future changes. Prior to 2002, fixed line numbers were 7 digits. On 1 September 1995, mobile and pager numbers became 8 digits with the '9' prefix 1. The universal 8-digit system completed on 1 March 2002 when the '6' prefix was added to all fixed lines 1. This migration followed telecommunications liberalisation in April 2000, increasing numbering capacity tenfold to 60 million numbers 1. In March 2004, the '8' prefix for mobile numbers was introduced to address mobile growth 2. Stay current with IMDA regulations at www.imda.gov.sg – changes, while infrequent, can impact your application's functionality.
Singapore Phone Number Format: Prefix Guide by Number Type
The 8-digit subscriber number is categorized by prefix, indicating service type:
| Prefix | Type | Description | Introduced |
|---|---|---|---|
| 6 | Landline | Business and residential fixed lines | 1 March 2002 1 |
| 8, 9 | Mobile | Personal and corporate mobile numbers | 9: 1 Sep 1995 1<br>8: Mar 2004 2 |
| 3 | VoIP | Virtual operators and IP telephony services | 2005 3 |
| 800 | Toll-free | International toll-free services | — |
| 1800 | Toll-free | Domestic toll-free (free from landlines; mobile airtime charges apply)<br>Access internationally via +65 6XXX XXXX 1 | — |
| 1900 | Premium | Premium-rate services for specialized information/entertainment | — |
| 1, 4, 5 | IoT/M2M | Internet of Things and Machine-to-Machine devices | — |
Use these prefixes to pre-filter numbers and tailor your application's behavior based on number type.
How to Validate Singapore Phone Numbers: JavaScript Implementation
Implement validation with this production-ready JavaScript function:
/**
* Validates Singapore phone numbers according to IMDA standards.
* @param {string} number - The phone number to validate.
* @returns {Object} Validation result with type, formatting, and potential errors.
*/
function validateSGPhoneNumber(number) {
// Handle null/undefined inputs
if (!number || typeof number !== 'string') {
return { isValid: false, error: 'Phone number must be a non-empty string.' };
}
// Sanitize input: Remove spaces, hyphens, and the optional +65 country code.
const cleanedNumber = number.replace(/[\s-+]*/g, '').replace(/^65/, '');
// Regular expressions for each number type. Notice the use of capturing groups for later formatting.
const patterns = {
landline: /^6(\d{4})(\d{3})$/, // Landline: 6XXXX XXXX
mobile: /^[89](\d{4})(\d{3})$/, // Mobile: 8/9XXXX XXXX
tollFree: /^800(\d{3})(\d{4})$/, // Toll-free: 800 XXX XXXX
premiumRate: /^1900(\d{3})(\d{4})$/, // Premium-rate: 1900 XXX XXXX
virtualNumber: /^3(\d{4})(\d{3})$/, // Virtual: 3XXXX XXXX
iotDevice: /^[145](\d{4})(\d{3})$/ // IoT/M2M: 1/4/5XXXX XXXX
};
// Iterate through patterns and return detailed results upon a match.
for (const [type, pattern] of Object.entries(patterns)) {
const match = cleanedNumber.match(pattern);
if (match) {
// Format the number according to local conventions.
const formattedNumber = `+65 ${match[1]} ${match[2]}`;
return { isValid: true, type, formattedNumber };
}
}
// If no match is found, return an error object.
return { isValid: false, error: 'Invalid Singapore phone number format.' };
}
// Example usage:
console.log(validateSGPhoneNumber('+65 9123 4567')); // Valid mobile number
console.log(validateSGPhoneNumber('61234567')); // Valid landline number
console.log(validateSGPhoneNumber('12345')); // Invalid number
console.log(validateSGPhoneNumber('+65 8001234567')); // Valid toll-free number
console.log(validateSGPhoneNumber(null)); // Error: must be non-empty stringEdge Case Handling:
Adapt this code to your application needs and consider additional edge cases like extremely long strings or special characters.
Best Practices for Singapore Phone Number Validation
Implement these best practices for a seamless user experience:
Input Sanitization
Sanitize user input before validation. Remove whitespace, hyphens, and non-numeric characters to prevent unexpected behavior and ensure consistent results.
Error Handling
Provide specific error messages:
const errorMessages = {
empty: 'Enter a phone number.',
tooShort: 'Singapore numbers must be 8 digits. You entered X digits.',
tooLong: 'Singapore numbers must be 8 digits. You entered X digits.',
invalidPrefix: 'Invalid prefix. Singapore numbers start with 1, 3, 4, 5, 6, 8, or 9.',
invalidFormat: 'Invalid format. Use +65 XXXX XXXX or 8 digits without country code.'
};Internationalization
Design for international numbers from the start. Use libraries like libphonenumber-js for multi-country support.
Performance & Security
- Cache validation results for repeated lookups using a Map or Redis cache
- Rate limit validation requests to prevent abuse (e.g., 100 requests/minute per IP)
- Validate input length before regex matching to prevent ReDoS (Regular Expression Denial of Service) attacks
- Sanitize inputs to prevent injection attacks:
number.replace(/[^0-9+]/g, '')
VoIP Integration: Singapore Phone Number Requirements
For VoIP services, address these factors:
SIP Protocol Support
Comply with IMDA's SIP (Session Initiation Protocol) specifications. Configure your SIP trunk:
const sipConfig = {
domain: 'sip.yourprovider.sg',
port: 5060,
transport: 'UDP',
countryCode: '+65',
emergencyRouting: true // Enable emergency number routing
};Emergency Services Routing
Implement mandatory routing for emergency numbers 4:
| Number | Service | SMS Alternative | Use Case |
|---|---|---|---|
| 999 | Police | 70999 | Emergencies, unsafe-to-call situations |
| 995 | SCDF (Fire/Ambulance) | 70995 | Fire, medical emergencies |
| 1777 | Non-emergency ambulance | — | Non-urgent medical transport |
| 993 | MOH special ambulance | — | Health crisis transport (H1N1, SARS, COVID-19) |
SMS alternatives serve deaf, hard-of-hearing, speech-impaired users, or situations where voice calls are unsafe 4.
Quality of Service (QoS)
Monitor and maintain these thresholds:
| Metric | Target | Troubleshooting |
|---|---|---|
| Latency | <150 ms | Check network routing; use CDN with Singapore PoPs |
| Jitter | <30 ms | Implement jitter buffers; upgrade network equipment |
| Packet Loss | <1% | Check bandwidth congestion; enable QoS on routers |
Monitor with tools like Wireshark, VoIP Spear, or your SIP provider's dashboard.
Frequently Asked Questions
How do I validate a Singapore phone number in my application?
Use the validation function provided in this guide:
const result = validateSGPhoneNumber('+65 9123 4567');
if (result.isValid) {
console.log(`Valid ${result.type}: ${result.formattedNumber}`);
} else {
console.error(result.error);
}The function checks for 8-digit length after removing +65, then matches prefixes: 6 (landline), 8/9 (mobile), 3 (VoIP), 800/1800 (toll-free), 1900 (premium-rate).
What is the country code for Singapore?
+65
When dialing internationally, prefix the 8-digit local number with +65 (e.g., +65 9123 4567). Within Singapore, use only the 8-digit number. The +65 code is mandatory for E.164 international formatting.
What are the Singapore mobile number prefixes?
Both 8 and 9 indicate mobile numbers. The 9 prefix has been used since 1 September 1995. The 8 prefix was introduced in March 2004 to provide additional capacity 2. Both work identically with no functional difference.
How do I format Singapore phone numbers in E.164 format?
+65 XXXX XXXX (e.g., +65 9123 4567)
function formatE164(number) {
const cleaned = number.replace(/[^0-9]/g, '').replace(/^65/, '');
if (cleaned.length !== 8) return null;
return `+65${cleaned}`; // Or +65 XXXX XXXX for display
}What is IMDA and how does it regulate Singapore phone numbers?
The Infocomm Media Development Authority (IMDA) is Singapore's telecommunications regulator. IMDA manages the National Numbering Plan, enforces numbering conventions, allocates ranges to providers, and updates policies. All operators must comply with IMDA standards. Visit www.imda.gov.sg for authoritative documentation.
Does Singapore use area codes for phone numbers?
No. Singapore uses a closed numbering plan with no area codes. All numbers are 8 digits regardless of location. The first digit indicates service type, not geography.
How do I distinguish between Singapore landline and mobile numbers?
Check the first digit:
- 6 = Landline (business/residential)
- 8 or 9 = Mobile (personal/corporate)
- 3 = VoIP (IP telephony, since 2005)
const type = number[0] === '6' ? 'landline' : ['8','9'].includes(number[0]) ? 'mobile' : 'other';What are Singapore's emergency numbers and how should VoIP apps handle them?
999 (Police) and 995 (SCDF Fire/Ambulance) are primary emergency numbers. Non-emergency: 1777 (ambulance), 993 (MOH special ambulance).
VoIP apps must route these per IMDA SIP specifications. SMS alternatives: 70999 (Police), 70995 (SCDF) for deaf, hard-of-hearing, or unsafe-to-call situations.
How do toll-free numbers work in Singapore?
800 = International toll-free 1800 = Domestic toll-free (free from landlines; mobile airtime charges apply)
1800 numbers can be reached internationally by replacing 1800 with +65 6 (e.g., 1800 123 4567 becomes +65 6123 4567).
When did Singapore transition to 8-digit phone numbers?
Phase 1: 1 September 1995 – Mobile/pager numbers became 8 digits (9 prefix added) Phase 2: 1 March 2002 – Fixed lines completed transition (6 prefix added)
This migration followed telecommunications liberalisation in April 2000, increasing capacity tenfold to 60 million numbers 1.
Summary
You now have production-ready knowledge for Singapore phone number validation:
- IMDA-regulated 8-digit numbering (no area codes)
- Prefix significance: 6 (landline), 8/9 (mobile), 3 (VoIP), 800/1800 (toll-free), 1900 (premium)
- JavaScript validation with regex patterns, sanitization, E.164 formatting, and error handling
- Best practices: input sanitization, specific error messages, internationalization, caching, rate limiting
- VoIP requirements: IMDA SIP compliance, emergency routing (999, 995), QoS benchmarks (latency <150 ms, jitter <30 ms, packet loss <1%)
Next Steps
- Integrate the validation function into your application
- Test with edge cases: null inputs, special characters, various formats
- Monitor IMDA updates at www.imda.gov.sg
- Extend with advanced features:
- Real-time carrier detection (Singtel, StarHub, M1, TPG Telecom)
- Phone number lookup for number type identification and carrier information
- Mobile Number Portability (MNP) lookup integration
libphonenumber-jsfor international number handling- SMS delivery webhook validation (Twilio, Plivo)
- Premium rate (1900) number blocking
- IoT/M2M number handling (prefixes 1, 4, 5)
Conclusion
Troubleshooting Common Issues
Validation fails for valid numbers:
- Check input sanitization – remove all non-numeric characters except +
- Verify country code handling – remove +65 before matching 8 digits
False positives:
- Tighten regex patterns to match exact lengths
- Add prefix validation before regex matching
Performance bottlenecks:
- Cache validation results for 5–15 minutes
- Use compiled regex patterns, not inline strings
- Implement request rate limiting
Testing Tools:
- IMDA National Numbering Plan
- libphonenumber demo
- Generate test data:
+65 ${9000 + Math.floor(Math.random() * 1000)} ${Math.floor(Math.random() * 10000)}
Stay informed about IMDA regulations to ensure compliance. Consult the IMDA website regularly for National Numbering Plan updates.
References
Footnotes
-
Telephone numbers in Singapore. Wikipedia. Details the complete history of Singapore's telephone numbering system including the 1 September 1995 addition of '9' prefix to mobile numbers, the 1 March 2002 addition of '6' prefix to fixed lines completing the universal 8-digit system, and the tenfold increase to 60 million numbering capacity. Source: Wikipedia - Telephone numbers in Singapore. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
-
IDA Issues Mobile Phone Numbers with Prefix '8'. Infocomm Media Development Authority (IMDA). Press release dated March 2004 announcing the introduction of mobile phone numbers beginning with digit '8' to address the rapid growth of mobile phone usage and complement existing '9' prefix mobile numbers. Source: IMDA Press Release (2004). ↩ ↩2 ↩3
-
IDA Launches New Policy Framework for Internet Protocol (IP) Telephony. Infocomm Media Development Authority (IMDA). Announcement from 2005 introducing the policy framework governing IP telephony services and 8-digit phone numbers starting with digit '3' for VoIP services. Source: IMDA IP Telephony Policy (2005). ↩
-
Singapore Emergency Services. Official Singapore government emergency contact numbers: 999 (Police), 995 (SCDF Fire/Ambulance), 1777 (Non-emergency ambulance), 993 (MOH special ambulance), with SMS alternatives 70999 (Police) and 70995 (SCDF) for deaf, hard-of-hearing, or situations where voice calls are unsafe. Sources: Singapore Civil Defence Force, Singapore Police Force, and Gov.sg Contact Directory. ↩ ↩2