Iran Phone Numbers: Format, Area Code & Validation Guide
This guide provides a comprehensive overview of Iran's telephone numbering system, including fixed lines, mobile numbers, and special services. Whether you're a developer building telecommunications applications, managing international call routing, or simply trying to understand how to dial an Iranian number, this resource will equip you with the necessary knowledge.
Numbering Plan Structure
Iran adheres to the international ITU-T E.164 standard, using the country code +98. When dialing from within Iran, a national prefix of '0' precedes all numbers. This '0' is dropped when dialing an Iranian number from an international location.
Area Codes
Iran employs a hierarchical area code system, dividing the country into telecommunication regions. Major cities typically have two-digit area codes, while other regions use three-digit codes. Understanding these area codes is crucial for accurate routing and validation.
Here are some examples of major city area codes:
- Tehran (Capital): 021
- Mashhad (Northeast): 051
- Isfahan (Central): 031
- Tabriz (Northwest): 041
- Shiraz (South): 071
A more comprehensive list of area codes can be found in Appendix A at the end of this document.
Number Formats
The following table details the formats for different types of Iranian phone numbers:
Type | Format | Example | Description |
---|---|---|---|
Landline | 0XX XXXX XXXX | 021 1234 5678 | Fixed-line telephone service |
Mobile | 09XX XXX XXXX | 0912 345 6789 | Cellular service provided by various operators |
MVNO | 099X XXX XXXX | 0998 123 4567 | Mobile Virtual Network Operator |
Premium Rate | 909 XXX XXXX (or other formats, see below) | 909 123 4567 | Higher-cost services, see dedicated section below |
Emergency | XXX | 110 | Emergency services (police, ambulance, fire) |
Premium-Rate Numbers
Premium-rate numbers in Iran have various formats and are used for services like voting, entertainment, and technical support. These numbers typically begin with prefixes like 909, 7020 (provincial), 7070 (national access), 8081, 9922 (for IR-MCI), and others. Always confirm the specific format and associated costs before dialing a premium-rate number. A more detailed breakdown of premium-rate number formats can be found in Appendix B.
Mobile Operators and Prefixes
Iran has several mobile operators, each with its own set of prefixes. Recognizing these prefixes can be helpful for identifying the carrier and applying appropriate routing logic. Here are the major operators and their common prefixes:
- MCI (Hamrah-e Aval): 0910-0919, 0990-0994
- MTN Irancell: 0900-0905, 0930, 0933, 0935-0939, 0941
- RighTel: 0920-0923
- Shatel Mobile (MVNO): 0998
- Other MVNOs: 0999 and other specialized ranges
Number Validation
Implementing robust number validation is crucial for any application handling Iranian phone numbers. Here's an example of how you might approach this using regular expressions in JavaScript:
function validateIranianPhoneNumber(number, type) {
const cleanedNumber = number.replace(/\D/g, ''); // Remove non-digit characters
const patterns = {
landline: /^0[1-8]{2}\d{7}$/,
mobile: /^09\d{8}$/,
mvno: /^099\d{8}$/,
premium: /^909\d{7}$/ // Example, adjust for other premium formats
};
return patterns[type] ? patterns[type].test(cleanedNumber) : false;
}
// Example usage:
console.log(validateIranianPhoneNumber('02112345678', 'landline')); // true
console.log(validateIranianPhoneNumber('+989123456789', 'mobile')); // true (after cleaning)
console.log(validateIranianPhoneNumber('09981234567', 'mvno')); // true
Important Note: This validation example provides a starting point. You'll need to adapt and expand it to cover all possible number formats, including the various premium-rate number prefixes and potential future expansions of the numbering plan.
Best Practices
- Always sanitize input: Remove whitespace, hyphens, and other non-digit characters before validation and processing.
- Handle edge cases: Consider reserved or special numbers, blocked ranges, and the potential for future number format changes.
- Regularly update validation rules: Stay informed about changes to Iran's numbering plan by consulting the official regulator's website (CRA).
- Number portability: Be aware that number portability exists in Iran. A number's original assigned operator may not always match its current provider. Consider using a carrier lookup service if accurate operator identification is required.
- International format conversion: When storing or displaying numbers, consider using the international format (+98XXXXXXXXXX) for consistency.
Emergency Numbers
- Police: 110
- Ambulance: 115
- Fire Department: 125
- International Emergency (on mobile): 112 (redirects to local emergency services)
These numbers should be accessible even without a SIM card or network coverage.
Appendix A: Expanded Area Code List (Partial - Consult CRA for Full List)
This list is not exhaustive. Refer to the Communication Regulatory Authority (CRA) of Iran for the most up-to-date and complete list.
- 011: Mazandaran
- 013: Gilan
- 017: Golestan
- 021: Tehran
- 023: Semnan
- ... (many more)
Appendix B: Premium-Rate Number Formats
- 7020 XXXX: Provincial premium-rate numbers
- 7070 XXXX: National access premium-rate numbers
- 909 XXX XXXX: Common premium-rate prefix
- 9922 XXXX: Premium-rate numbers for IR-MCI subscribers
- 8081 XXXX: Another premium-rate format
- Other formats: Various other prefixes may exist. Always verify the specific format and cost before dialing.
This guide provides a solid foundation for understanding and working with Iranian phone numbers. Remember to consult official resources for the most current information and regulations.