phone number standards
phone number standards
Maldives Phone Numbers: Format, Area Code & Validation Guide
Validate Maldives phone numbers with +960 country code. Complete guide to number formats, operator prefixes (Dhiraagu, Ooredoo), E.164 validation, and MNP implementation for developers.
Maldives Phone Numbers: Format, Area Code & Validation Guide
Introduction
Learn how to validate and format Maldives phone numbers using the +960 country code in this comprehensive developer guide. The Maldives numbering plan uses a unified 7-digit format without area codes, featuring operator-specific prefixes for Dhiraagu (7-series) and Ooredoo (9-series) networks. Proper phone number validation prevents failed message delivery, routing errors, and poor user experience in SMS platforms, call routing systems, and authentication flows.
This guide covers E.164 formatting standards, regular expression validation patterns for JavaScript and Python, mobile number portability (MNP) implementation with NPDB integration, and best practices for handling emergency numbers and special service codes in the Maldives telecommunications system.
Quick Reference
- Country: Maldives 🇲🇻
- Country Code: +960
- International Prefix: 00
- National Prefix: None
- Timezone: UTC+5 (Maldives Time – MVT, no daylight saving time)
- MCC (Mobile Country Code): 472
- Regulatory Authority: Communications Authority of Maldives (CAM)
- ITU-T Standards: E.123, E.164
Maldives Phone Number Format and Structure
The Maldives uses a straightforward national numbering plan. This simplicity demands meticulous attention to detail for accurate processing.
Understanding the Maldives National Numbering Plan
The Maldives employs a unified national numbering plan – no area codes exist. This creates a simplified nationwide system.
- Country Code: +960
- Subscriber Number Length: 7 digits
- Unified System: No area codes
- Current Plan: Introduced in 2005 (ITU Operational Bulletin No. 843, August 2005), replacing the previous 5–6 digit formats. Migration from the older system was postponed from January 2005 but completed later that year, standardizing all numbers to 7 digits.
- MCC: 472 (Mobile Country Code)
- MNC Codes: 01 (Dhiraagu), 02 (Ooredoo) per ITU-T Recommendation E.212
The following diagram illustrates the structure:
graph LR
A[Country Code] -->|+960| B[Prefix]
B -->|3/6/7/9| C[6 Digits]
C -->|XXXXXX| D[Complete Number]What Are the Different Maldives Number Formats by Type?
Different number types are distinguished by their prefixes. Consider these distinctions in your validation logic:
| Number Type | Format | Example | Description |
|---|---|---|---|
| Geographic (Malé) | 33XXXXX | 3345678 | Fixed-line numbers for Malé City (prefixes 330–335, 339). |
| Geographic (Atolls) | 6XXXXXX | 6501234 | Fixed-line numbers for atolls (e.g., 650 for Haa Alif, 652 for Haa Dhaalu). |
| Non-Geographic | 40XXXXX, 45XXXXX | 4001234, 4501234 | VoIP and non-geographic fixed services: 400–401 (Ooredoo), 450 (Dhiraagu) per CAM Numbering Plan (June 2024). |
| Mobile (Dhiraagu) | 7XXXXXX | 7712345 | Mobile numbers on Dhiraagu network (prefixes 72–79). |
| Mobile (Ooredoo) | 9XXXXXX | 9123456 | Mobile numbers on Ooredoo network (prefixes 91–99). |
| Toll-Free | 0800XXX | 08001234 | Toll-free numbers (total 7 digits starting with 0800). |
| Premium Rate | 900XXXXXX | 9001234567 | Premium rate numbers (9 digits, effective September 2010). |
| Emergency | 119, 102, 118, 191 | 119, 102, 118, 191 | Short codes: Police (119), Ambulance (102), Fire (118), Coast Guard (191). |
You now understand the different number types and their formats. Let's turn to implementation.
Phone Number Validation for Maldives (+960)
Robust number validation is crucial for any application dealing with phone numbers. Common validation pitfalls include failing to strip international prefixes before regex matching, not accounting for number portability when routing, treating all 7-digit numbers as valid without prefix checks, and inadequate error messages that don't guide users to correct formatting. Here's a practical guide to implementing number validation with explanations and edge case considerations.
Regular Expression Patterns for Maldives Number Validation
Regular expressions provide a powerful way to validate Maldives phone numbers. Here are examples in multiple languages:
JavaScript:
// Regular expression patterns with explanatory comments
const patterns = {
// Matches Malé fixed-line numbers (330–335, 339 prefixes)
geographicMale: /^33[0-5,9]\d{4}$/,
// Matches atoll fixed-line numbers starting with 6
geographicAtoll: /^6\d{6}$/,
// Matches non-geographic numbers (VoIP/fixed): 400–401, 450
nonGeographic: /^(40[01]|450)\d{4}$/,
// Matches Dhiraagu mobile numbers (72–79 prefixes)
mobileDhiraagu: /^7[2-9]\d{5}$/,
// Matches Ooredoo mobile numbers (91–99 prefixes)
mobileOoredoo: /^9[1-9]\d{5}$/,
// Matches any mobile number (7 or 9 prefix)
mobile: /^[79]\d{6}$/,
// Matches 7-digit toll-free numbers starting with 0800
tollFree: /^0800\d{3}$/,
// Matches 9-digit premium numbers starting with 900
premiumRate: /^900\d{6}$/
};
function validateMaldivesNumber(number, type = 'mobile') {
// Remove any whitespace or hyphens from the input number
const cleanNumber = number.replace(/[\s-]/g, '');
return patterns[type].test(cleanNumber);
}
// Strip international prefix before validation
function normalizeInternationalNumber(number) {
// Remove +960 or 00960 prefix
return number.replace(/^(\+960|00960)/, '');
}
// Example usage:
const input = '+960 771 2345';
const normalized = normalizeInternationalNumber(input);
console.log(validateMaldivesNumber(normalized, 'mobileDhiraagu')); // true
console.log(validateMaldivesNumber('9123456', 'mobileOoredoo')); // true
console.log(validateMaldivesNumber('08001234', 'tollFree')); // false - only 7 digits total
console.log(validateMaldivesNumber('0800123', 'tollFree')); // truePython:
import re
class MaldivesPhoneValidator:
"""Validator for Maldives phone numbers with comprehensive pattern matching."""
PATTERNS = {
'geographic_male': r'^33[0-5,9]\d{4}$',
'geographic_atoll': r'^6\d{6}$',
'non_geographic': r'^(40[01]|450)\d{4}$',
'mobile_dhiraagu': r'^7[2-9]\d{5}$',
'mobile_ooredoo': r'^9[1-9]\d{5}$',
'mobile': r'^[79]\d{6}$',
'toll_free': r'^0800\d{3}$',
'premium_rate': r'^900\d{6}$'
}
@staticmethod
def normalize(number):
"""Remove international prefix and formatting characters."""
# Remove whitespace, hyphens, parentheses
clean = re.sub(r'[\s\-\(\)]', '', number)
# Remove +960 or 00960 prefix
clean = re.sub(r'^(\+960|00960)', '', clean)
return clean
@classmethod
def validate(cls, number, number_type='mobile'):
"""Validate a Maldives phone number against a specific pattern."""
clean_number = cls.normalize(number)
pattern = cls.PATTERNS.get(number_type)
if not pattern:
raise ValueError(f"Unknown number type: {number_type}")
return bool(re.match(pattern, clean_number))
# Example usage
validator = MaldivesPhoneValidator()
print(validator.validate('+960 771 2345', 'mobile_dhiraagu')) # True
print(validator.validate('00960 9123456', 'mobile_ooredoo')) # True
print(validator.validate('4001234', 'non_geographic')) # TrueThis code provides comprehensive validation with proper international format handling. Strip the country code prefix before applying regex patterns for local number validation.
Mobile Number Portability (MNP) in Maldives
Number portability allows users to switch providers while keeping their original number. A number's prefix might not indicate its current operator. Integrate a Number Portability Database (NPDB) lookup into your system for accurate routing of calls and SMS messages.
graph TD
A[Receive Number] --> B{Check Format}
B -->|Valid| C[Query NPDB]
B -->|Invalid| D[Return Error]
C --> E{Ported Number?}
E -->|Yes| F[Update Routing]
E -->|No| G[Use Default Routing]Mobile Number Portability (MNP) launched in Maldives on March 3, 2016 (CAM Customer Guide, March 10, 2016). Users must meet eligibility criteria: active number, 90 days since activation or last port, no outstanding bills (postpaid), and cleared credit services (prepaid). The porting process requires sending SMS "PORT" to 234 to receive a Unique Porting Code (UPC) valid for 7 days, paying the MVR 200 non-refundable porting fee, and submitting application with ID documents at the new provider's service outlet. Migration completes overnight between 00:00–02:00 hours with up to 2 hours of service disruption. Cancel within 24 hours unless porting completes earlier.
NPDB Integration Considerations:
- Real-time lookup APIs: Contact Dhiraagu or Ooredoo for NPDB API access and integration specifications
- Caching strategy: Cache ported number data for 24–48 hours to reduce API costs while maintaining accuracy
- Rate limits: Implement request throttling and batch lookup capabilities for high-volume applications
- Fallback routing: Default to prefix-based routing when NPDB service is unavailable
- Cost considerations: NPDB lookups typically incur per-query charges; optimize by caching and batching requests
Advanced TypeScript Validation with Error Handling
Build a comprehensive validation function that checks length, prefix, and format, and returns detailed information about the validation result.
enum ValidationError {
INVALID_LENGTH = 'Invalid number length',
INVALID_PREFIX = 'Invalid prefix',
INVALID_FORMAT = 'Invalid number format'
}
interface ValidationResult {
isValid: boolean;
error?: ValidationError;
metadata?: {
operator: string; // Requires NPDB lookup for ported numbers
numberType: string;
originalOperator: string; // Based on prefix
};
}
function validateAndFormatMaldivesNumber(number: string): ValidationResult {
const clean = number.replace(/^(\+960|00960)/, '').replace(/[\s\-\(\)]/g, '');
// Length check
if (clean.length !== 7) {
return { isValid: false, error: ValidationError.INVALID_LENGTH };
}
// Determine number type and operator from prefix
const prefix = clean.substring(0, 2);
let numberType = 'unknown';
let originalOperator = 'unknown';
if (/^7[2-9]/.test(clean)) {
numberType = 'mobile';
originalOperator = 'Dhiraagu';
} else if (/^9[1-9]/.test(clean)) {
numberType = 'mobile';
originalOperator = 'Ooredoo';
} else if (/^33[0-5,9]/.test(clean)) {
numberType = 'fixed-line';
originalOperator = 'Dhiraagu';
} else if (/^6/.test(clean)) {
numberType = 'fixed-line';
originalOperator = 'Dhiraagu';
} else if (/^(40[01]|450)/.test(clean)) {
numberType = 'non-geographic';
originalOperator = prefix.startsWith('40') ? 'Ooredoo' : 'Dhiraagu';
} else {
return { isValid: false, error: ValidationError.INVALID_PREFIX };
}
return {
isValid: true,
metadata: {
operator: originalOperator, // In production, query NPDB for actual operator
numberType,
originalOperator
}
};
}This enhanced function provides a robust and informative validation process. Handle potential errors gracefully and provide helpful error messages.
Best Practices for Maldives Phone Number Integration
Follow these best practices when integrating Maldives phone number validation in your applications:
- Sanitize input: Remove whitespace, hyphens, and other non-numeric characters before validation.
- Handle international prefixes: Account for numbers starting with '+960', '00960', or just the local part.
- Implement number portability: Use NPDB lookups where accuracy is critical for SMS routing and billing. See our phone number validation API guide for automated solutions.
- Provide clear error messages: Guide users toward correcting invalid input with specific feedback (e.g., "Mobile numbers must start with 7 or 9").
- Stay updated: Telecommunications regulations change. Refer to the CAM Numbering Plan (updated June 2024) for the latest information.
- Database storage: Store numbers in E.164 format (+9607XXXXXXX) with separate indexed columns for country code and local number for efficient querying.
- Security considerations: Implement rate limiting on SMS/OTP endpoints to prevent enumeration attacks and SMS pumping fraud. Validate numbers server-side even if client-side validation exists.
- Performance optimization: Pre-compile regex patterns, implement caching for NPDB lookups, and use database indexes on phone number columns.
Frequently Asked Questions
What is the country code for Maldives?
The Maldives country code is +960. Dial this before the 7-digit local number when calling from outside the country.
How many digits are in a Maldives phone number?
Maldives phone numbers have 7 digits after the country code (+960). The complete international format is +960 followed by 7 digits, making 11 digits total.
How do I identify if a Maldives number is Dhiraagu or Ooredoo?
Mobile numbers starting with 7 (specifically 72–79) were originally allocated to Dhiraagu, while numbers starting with 9 (91–99) belong to Ooredoo. However, due to mobile number portability since March 2016, the prefix may not reflect the current operator – always query the NPDB for routing decisions.
Does Maldives use area codes?
No, Maldives uses a unified national numbering plan with no area codes. All numbers are 7 digits regardless of location.
What are the emergency numbers in Maldives?
- Police: 119
- Ambulance: 102
- Fire: 118
- Coast Guard: 191
How do I format a Maldives phone number in E.164 format?
The E.164 format for Maldives phone numbers is: +9607XXXXXXX (country code +960 followed by the 7-digit local number with no spaces or special characters). This standardized international format ensures compatibility across global telecommunications systems.
What is the Maldives mobile number portability process?
Send "PORT" to 234 after 90 days with your current provider. You'll receive a Unique Porting Code (UPC) valid for 7 days. Pay the MVR 200 non-refundable fee and complete the application at your new provider with required ID documents. Migration completes overnight (00:00–02:00) with up to 2 hours disruption.
When was the current Maldives numbering plan introduced?
The current 7-digit numbering plan was introduced in 2005 (ITU Operational Bulletin No. 843, August 2005), standardizing all number types. The migration replaced the previous 5–6 digit formats used before 2005.
What is the MCC and MNC for Maldives operators?
The Mobile Country Code (MCC) for Maldives is 472. Mobile Network Codes (MNC) are 01 for Dhiraagu and 02 for Ooredoo, as specified in ITU-T Recommendation E.212.
How do I validate international format Maldives numbers?
Strip the leading "+" or "00960" prefix, then validate the remaining 7-digit local number against the appropriate pattern for the number type (mobile, fixed-line, non-geographic, toll-free, or premium).
What are the non-geographic number ranges used for?
Non-geographic numbers (400–401 for Ooredoo, 450 for Dhiraagu) are used for VoIP services and location-independent business numbers. These don't correspond to specific geographic areas or atolls.
Conclusion
You now have the complete implementation guide for handling Maldives phone numbers with the +960 country code. Apply the E.164 validation patterns with multi-language examples for operator-specific prefixes, implement mobile number portability checks with NPDB integration strategies for accurate routing, and reference the detailed number formats table including VoIP and non-geographic ranges for comprehensive validation coverage.
Next Steps:
- Review the CAM Numbering Plan (June 2024) for official operator allocations
- Contact operators directly for NPDB API access and integration documentation
- Implement proper error handling and logging for production deployments
- Test validation logic against edge cases: ported numbers, special service codes, and international format variations
- Monitor CAM regulations for updates to numbering policies and new allocations