Frequently Asked Questions
To call Morocco from abroad, dial the country code +212 followed by the 9-digit Moroccan number, omitting the leading '0'. For example, +212 612 345 678 would connect you to a Moroccan mobile number. This international format is crucial for proper routing from outside Morocco.
Always dial the full 10-digit number, including the leading '0' and the area code, even for local calls. Multiple prefixes can serve the same area, so using the complete number is crucial for accurate routing. For example, use 05 20 12 34 56 for a landline in Casablanca.
Morocco uses a closed numbering plan, meaning the full 10-digit number is always dialed. This is important because multiple prefixes can exist within the same geographic area, often associated with different operators, ensuring calls are correctly routed.
Use the +212 country code when making international calls to Morocco. This prefix clearly identifies the destination as Morocco, allowing for seamless connection from any country. It is also best practice to store all Moroccan numbers in your system using this format for consistency.
Yes, you can use VoIP services, but ensure the provider is authorized by the ANRT and that your application correctly handles Moroccan number formats, both domestic (0 prefixed) and international (+212 prefixed), for seamless communication.
While Casablanca primarily uses the 05 prefix for landlines, it's important to note that multiple prefixes can exist within the city. Always use the full 10-digit number for accurate routing as the prefix alone doesn't guarantee correct connection.
Emergency numbers like Police (19), Royal Gendarmerie (177), and Ambulance/Fire/Civil Protection (15) are toll-free and accessible without a SIM card. Dial the number directly from any phone.
Mobile numbers in Morocco use the 06 and 07 prefixes nationwide. This makes it easy to distinguish mobile numbers from landlines (typically 05 or 02) and simplifies number processing in applications.
Number portability in Morocco allows subscribers to switch operators while keeping their number. The process now takes one business day and is free of charge. Developers should account for this timeframe in their applications and refer to the ANRT Developer Portal for technical details.
The ANRT (National Telecommunications Regulatory Agency) regulates Morocco's telecommunications sector, including number formats, portability, and VoIP services. Their developer portal provides crucial resources for implementing compliant applications.
Number porting in Morocco is completed within one business day due to recent improvements. This fast turnaround time is important for developers to consider when handling number portability in their applications.
The ANRT Developer Portal (http://www.anrt.ma/developers) provides the most up-to-date technical information and implementation details for working with Moroccan phone numbers and related services.
Morocco Phone Numbers: Format, Area Code & Validation Guide
Morocco uses country code +212 with a 10-digit domestic format (starting with 0) or 9-digit international format. This guide covers validation patterns, mobile prefixes (06/07), area codes for major cities, ANRT regulations, emergency numbers, VoIP integration, and number portability implementation for developers building telecommunications applications.
Morocco Country Code: +212 Dialing System Explained
Morocco's country code is +212. The telephone numbering system, regulated by the National Telecommunications Regulatory Agency (ANRT), uses a closed numbering plan requiring the full 10-digit number for all domestic calls (starting with 0) or 9 digits for international format (after +212). Multiple prefixes can serve the same geographic area—Casablanca has 10 different prefixes across operators.
Validation Examples:
Source: ANRT National Numbering Plan; ITU Telephone numbers in Morocco
Domestic Calling Essentials
Understand these domestic calling rules to ensure your applications correctly handle local calls within Morocco.
Standard Calling Rules
05 20 12 34 56
improves visual clarity.Best Practice: Store numbers in your system with the '+212' prefix. This international format ensures compatibility for both domestic and international calls, simplifying your data management.
Regional Considerations
Morocco's numbering structure varies by region and service type:
05
prefix for landlines. Landline numbers follow the structure 05ZABPQMCDU, where the digits after 05 represent the regional area (RR) and local area (LL), followed by the subscriber number. Multiple prefixes can exist within a single urban area—for example, Casablanca has 10 different prefixes, each potentially belonging to different operators.02
prefix for landlines in certain regions. The 02 prefix generally covers southern areas of Morocco.06
and07
prefixes nationwide. Mobile numbers follow the structure 0ABPQMCDU, where A takes the value 6 or 7 for currently active mobile services. This consistent prefix pattern simplifies mobile number identification and processing across all geographic regions.Note: Morocco's closed numbering plan requires dialing the complete 10-digit number even for local calls because the same geographic area can be served by multiple prefixes across different operators.
Morocco Area Codes for Major Cities
Note: Major cities may have multiple area codes. For instance, Casablanca uses codes from 0522 through 0529 across different operators and districts.
Source: ANRT National Numbering Plan; Telephone numbers in Morocco (ITU standards)
How to Call Morocco Internationally
Handle international calls with specific procedures for both dialing from and into Morocco.
Calling From Morocco
To call internationally from Morocco:
00
33
for France or1
for the United StatesExample: Calling France (33)
Calling Into Morocco from Abroad
To call Morocco from another country:
+212
Example: International format for Moroccan numbers
Key Detail: All Moroccan numbers are 9 digits long (excluding the leading '0'). This consistent length simplifies validation and processing.
Format Conversion Examples
Common Formatting Errors:
00212
instead of+212
(both valid, but+
is standard)0
in international format (incorrect)+212
, or 10 with leading0
)Emergency and Special Service Numbers
Ensure your applications correctly handle emergency and special service numbers so users can access critical services.
Emergency Services Network
Important: Emergency numbers are toll-free and function without a SIM card or credit balance. Note that 911 does not work in Morocco—always use the local emergency numbers listed above.
Source: UK Government Foreign Travel Advice for Morocco (accessed August 2025); ANRT emergency services guidance
Special Service Numbers
Access various services through these numbers with specific dialing patterns:
080
): Customer service lines, government helplines, and public information services. Free from fixed telephone networks but may incur surcharges when calling from mobile lines.089
): Professional consulting, entertainment services, and specialized information lines. Premium-rate services include gaming, ringtone downloads, and other paid content. Pricing varies by service; users are charged per minute or per call at rates significantly higher than standard calls.Common Short Codes:
Pricing Notes:
Source: ANRT Special Numbers guidance (accessed January 2025); HelloDuty Morocco Services
Morocco VoIP Regulations and Integration
Integrate VoIP services with careful consideration of Moroccan regulations and number formats.
VoIP Regulation Status
Important Update: Morocco lifted its VoIP service ban in February 2022. Previously restricted since January 2016, VoIP services including WhatsApp calls, Skype, and other Voice over Internet Protocol applications are now legally permitted.
Regulatory Context: The ANRT reversed earlier restrictions based on evaluation of the national and international telecom market, legal context, and consumer implications. This liberalization aligns with Morocco's Digital Morocco Plan 2025-2030, which aims to improve internet access and stimulate ICT entrepreneurship.
Source: ANRT official announcements (February 2022); Digital Watch Observatory
VoIP Integration Guidelines
Licensing Requirements:
Technical Implementation:
Tip: Some VoIP services require specific configurations for optimal performance in Morocco. Consult your provider's documentation for details. Test your VoIP implementation thoroughly to ensure reliable communication.
Source: ANRT Telephony Regulations
Morocco Number Portability: How to Switch Operators
Understand how number portability – switching operators while retaining your number – impacts your applications.
Overview and Recent Developments
Morocco's number portability system has significantly improved through ANRT's commitment to consumer choice:
Sources: Ecofin Agency (April 2024); ANRT official communications
Implementation Framework
The porting process follows a streamlined workflow:
Eligibility Requirements:
Required Documents:
Service Interruption: Porting typically occurs overnight (during low-traffic hours). Expect a brief service interruption of 2-4 hours during the transition. ANRT mandates that interruptions should not exceed 4 hours.
Rollback Procedures: If porting fails, the number automatically reverts to the original operator within 24 hours. Subscribers are notified by SMS. No charges apply for failed porting attempts.
Source: ANRT Telephony Regulations
Technical Implementation Guidelines
Integrate number portability into your systems with these considerations:
Real-World Implementation: Integrate with a portability database or API to confirm eligibility. Consider edge cases such as temporarily unavailable numbers during the porting process. Implement retry mechanisms or provide informative error messages to users. Incorporate the ANRT Porting Authorization Code (RIO) into your validation process.
Source: ANRT
Troubleshooting
Solve common issues encountered when working with Moroccan phone numbers.
Common Issues and Solutions
Failed Domestic Calls:
International Call Problems:
VoIP Connectivity Issues:
Validation Errors in Code:
Operator Technical Support Contacts:
For Persistent Issues: Direct users to contact their service provider's technical support with account details ready. Provide error codes and diagnostic information from your validation functions to speed resolution.
Sources: Maroc Telecom Contact; Morocco Mobile Network USSD Codes
Frequently Asked Questions
What is Morocco's country code for phone numbers?
Morocco's international country code is +212. When calling Morocco from abroad, dial +212 followed by the 9-digit Moroccan number (omit the leading '0'). Example: To call Moroccan mobile 0612345678 internationally, dial +212 612 345 678. The 212 country code distinguishes Morocco from other nations in the global telephone network.
How many digits is a Moroccan phone number?
Moroccan phone numbers are 10 digits for domestic format and 9 digits for international format (after country code +212). Domestic format: 0X XX XX XX XX starts with '0', followed by prefix (05 urban landlines, 02 rural landlines, 06/07 mobile), then subscriber number. International format: +212 X XX XX XX XX (9 digits after +212, no leading '0').
How do I validate a Morocco phone number?
Use this regex pattern for basic validation:
/^0[2567][0-9]{8}$/
for domestic format or/^\+212[2567][0-9]{8}$/
for international format. Ensure the number is exactly 10 digits (domestic) or 9 digits after +212 (international). Mobile numbers start with 06 or 07, landlines with 02 or 05.Complete validation function:
Other Languages:
What are Morocco's mobile phone prefixes?
Morocco mobile numbers start with 06 or 07 prefixes. These prefixes are nationwide (not region-specific) and apply to all three major carriers: Maroc Telecom, Orange Morocco, and INWI. Format: 0[6-7]XXXXXXXX (10 digits domestic) or +212 [6-7]XXXXXXXX (9 digits international). Mobile prefixes 06 and 07 help identify mobile numbers versus landlines (02/05 prefixes).
What are the emergency numbers in Morocco?
Morocco's emergency numbers are: 190 for Police (or 112 from mobile phones), 177 for Royal Gendarmerie, and 150 for Ambulance/Fire. Note that 911 does not work in Morocco. All emergency numbers are toll-free and work without a SIM card or credit balance.
Is VoIP allowed in Morocco?
Yes, VoIP is legal in Morocco since February 2022. The ANRT lifted the ban that was in place from January 2016. WhatsApp calls, Skype, and other Voice over Internet Protocol applications are now legally permitted. Ensure your VoIP service complies with ANRT regulations and licensing requirements.
How long does number portability take in Morocco?
Number portability in Morocco takes one business day (24 hours). The ANRT implemented this faster timeline in April 2024, reducing it from the previous two-day requirement. Porting is free for all subscribers and covers all operators (Maroc Telecom, Inwi, Orange) and number types.
What are Morocco's area codes for landlines?
Morocco's landlines use 05 for urban areas and 02 for rural/southern areas. Unlike mobile prefixes, area codes can vary within cities—for example, Casablanca has 10 different prefixes across operators. Morocco uses a closed numbering plan, so always dial the complete 10-digit number, even for local calls.
Conclusion
You now have a detailed understanding of Morocco's telephone numbering system. Follow these guidelines and best practices to ensure your applications handle Moroccan phone numbers accurately and efficiently. Consult the ANRT Developer Portal for the latest updates and technical specifications.
Quick Reference Checklist:
Additional Resources: