Iraq Phone Numbers: Format, Area Code & Validation Guide
This guide provides a comprehensive overview of Iraqi phone number formats, validation, and best practices for developers. Understanding these nuances is crucial for building robust applications that interact with Iraqi users, ensuring seamless communication, and maintaining regulatory compliance.
Why Accurate Phone Number Handling Matters
Correctly handling phone numbers is essential for various reasons:
- Reliable Communication: Accurate formatting ensures messages and calls reach the intended recipient.
- Fraud Prevention: Validation helps prevent fraudulent activities like spam and account hijacking.
- Regulatory Compliance: Adhering to local numbering plans is often a legal requirement.
- Improved User Experience: Streamlined input and validation create a smoother user experience.
- Data Integrity: Consistent formatting ensures data quality for analysis and reporting.
- International Business Operations: Properly handling international numbers is vital for global reach.
Iraqi Numbering Plan Structure
Iraq's phone numbers follow a hierarchical structure:
- Country Code: +964 (or 00 for international calls from within Iraq)
- National Prefix: 0 (omitted when dialing internationally)
- Area/Operator Code:
- Landlines: 1-2 digits, geographically based.
- Mobiles: 3 digits, operator-specific.
- Subscriber Number:
- Landlines: 6-7 digits, varying by region.
- Mobiles: 7 digits.
Landline Numbers
Landline numbers are geographically assigned, with area codes corresponding to specific regions.
Format: 0[Area Code][Subscriber Number]
City | Area Code | Example Format | Subscriber Number Length |
---|---|---|---|
Baghdad | 1 | 01-XXXXXXX | 7 |
Basra | 4 | 04-XXXXXX | 6 |
Mosul | 6 | 06-XXXXXX | 6 |
Erbil | 66 | 066-XXXXXX | 6 |
Dohuk | 62 | 062-XXXXXX | 6 |
Tikrit | 21 | 021-XXXXXX | 6 |
Al Kut | 23 | 023-XXXXXX | 6 |
Ramadi | 24 | 024-XXXXXX | 6 |
Baquba | 25 | 025-XXXXXX | 6 |
Hilla | 30 | 030-XXXXXX | 6 |
Karbala | 32 | 032-XXXXXX | 6 |
Najaf | 33 | 033-XXXXXX | 6 |
Diwaniya | 36 | 036-XXXXXX | 6 |
Samawa | 37 | 037-XXXXXX | 6 |
Nasiriya | 42 | 042-XXXXXX | 6 |
Amarah | 43 | 043-XXXXXX | 6 |
Kirkuk | 50 | 050-XXXXXX | 6 |
Sulaimaniya | 53 | 053-XXXXXX | 6 |
Important Note: Baghdad landline numbers typically have 7-digit subscriber numbers, while other regions mostly use 6 digits. Always validate based on the area code.
Mobile Numbers
Mobile numbers follow a 10-digit format, including the operator prefix.
Format: 07[Operator Code][Subscriber Number]
Operator | Mobile Prefix | Example Format |
---|---|---|
Korek Telecom | 75 | 075X-XXXXXXX |
Asiacell | 77 | 077X-XXXXXXX |
Zain Iraq | 78, 79 | 078X-XXXXXXX , 079X-XXXXXXX |
Alkafeel Omnnea | 76 | 076X-XXXXXXX |
Best Practices for Implementation
Validation
Use regular expressions for efficient and accurate validation. Here's an example using JavaScript:
function validateIraqPhoneNumber(phoneNumber) {
const cleaned = phoneNumber.replace(/\D/g, ''); // Remove non-digit characters
const mobileRegex = /^(?:964|0)7[5-9]\d{7}$/; // Updated regex for mobile
const landlineBaghdadRegex = /^(?:964|0)1\d{7}$/; // Baghdad landlines
const landlineOtherRegex = /^(?:964|0)[2-6]\d{6,7}$/; // Other landlines (6 or 7 digits)
if (mobileRegex.test(cleaned)) {
return { isValid: true, type: 'mobile', normalized: `+964${cleaned.slice(-10)}` };
} else if (landlineBaghdadRegex.test(cleaned)) {
return { isValid: true, type: 'landline', normalized: `+964${cleaned.slice(-8)}` };
} else if (landlineOtherRegex.test(cleaned)) {
return { isValid: true, type: 'landline', normalized: `+964${cleaned.slice(-7,-1)}${cleaned.slice(-1)}` }; // Handle both 6 and 7 digit numbers
}
return { isValid: false, error: 'Invalid number format' };
}
// Example usage:
console.log(validateIraqPhoneNumber('+9647901234567')); // Valid mobile
console.log(validateIraqPhoneNumber('01-1234567')); // Valid Baghdad landline
console.log(validateIraqPhoneNumber('04-123456')); // Valid Basra landline
console.log(validateIraqPhoneNumber('0721234567')); // Invalid mobile prefix
console.log(validateIraqPhoneNumber('01123456789')); // Invalid length
Formatting
- International Format:
+964[Area/Operator Code][Subscriber Number]
(e.g., +9647901234567) - National Format:
0[Area/Operator Code][Subscriber Number]
(e.g., 07901234567)
Always validate and format numbers server-side to ensure data integrity, even if client-side validation is implemented.
Regulatory Compliance
- Adhere to the Iraqi National Numbering Plan.
- Maintain accurate subscriber records if your application handles user registration.
- Format numbers correctly for international communications.
- Consult the Iraqi Communications and Media Commission (CMC) for the latest regulations.
Dialing Procedures
- From Iraq to International:
00 + [Country Code] + [Number]
- To Iraq from Abroad:
+964 + [Area/Operator Code] + [Subscriber Number]
(omit the leading 0 from the national format) - Local Calls (Within Same Area): Use the subscriber number directly.
- Local Calls (Between Areas): Use the full national format, including the area code and leading 0.
Future Considerations
The Iraqi telecommunications landscape is constantly evolving. Stay informed about:
- Potential new operator prefixes.
- Number range expansions.
- Regulatory changes.
Implement version control for number formats and document any modifications to maintain compatibility.
Additional Resources
- Iraqi Communications and Media Commission (CMC): https://www.cmc.iq/
- International Telecommunication Union (ITU): https://www.itu.int/
This guide provides a solid foundation for handling Iraqi phone numbers in your applications. Remember to prioritize accuracy, security, and user experience. By following these best practices, you can ensure seamless communication and maintain compliance with evolving regulations.