phone number standards

Sent logo
Sent TeamMay 3, 2025 / phone number standards / Article

Mexico Phone Number Format & Validation Guide 2025: +52 Country Code

Master Mexico phone number format and validation with our developer guide. Learn +52 country code rules, area codes, 2019-2020 reforms, E.164 formatting, and SMS compliance for accurate implementation.

Mexico Phone Numbers: Format, Area Code & Validation Guide

Understanding the Mexico phone number format is essential for developers building telecommunications applications, CRM systems, or SMS platforms. This comprehensive guide covers Mexico's +52 country code structure, validation rules, formatting standards, and regulatory compliance requirements to help you implement accurate phone number processing for Mexican telecommunications.

Understanding Mexico's Numbering Plan

Mexico's phone number system blends traditional and modern telecommunications infrastructure. The Federal Institute of Telecommunications (IFT) – Mexico's independent regulatory agency – manages telephone numbers and published the Fundamental Technical Plan for Numbering on May 11, 2013. Understanding these nuances ensures accurate validation and processing.

[Source: IFT Official Documentation, 2013]

How Are Mexican Phone Numbers Structured?

Mexican phone numbers follow a standardized structure:

  • Country Code: +52 (Required for international calls)
  • Area Code: 2–3 digits, geographically assigned. Major metropolitan areas use 2-digit codes (e.g., 55 for Mexico City, 33 for Guadalajara, 81 for Monterrey). Smaller cities and rural areas use 3-digit codes (e.g., 222 for Puebla, 664 for Tijuana). Find a complete list on the IFT website or Wikipedia.
  • Subscriber Number: 7–8 digits, assigned by the carrier.

Area Code and Subscriber Number Correlation:

The total length of area code plus subscriber number always equals exactly 10 digits:

  • 2-digit area code8-digit subscriber number (e.g., Mexico City: 55 + 8 digits)
  • 3-digit area code7-digit subscriber number (e.g., Puebla: 222 + 7 digits)

This inverse relationship ensures consistent 10-digit national numbers across all of Mexico.

[Source: IFT Fundamental Technical Plan for Numbering, 2013]

+52 55 1234 5678 (Mexico City: 2-digit area code + 8-digit subscriber) +52 222 123 4567 (Puebla: 3-digit area code + 7-digit subscriber) +52 33 1234 5678 (Guadalajara: 2-digit area code + 8-digit subscriber)

How Do You Distinguish Mobile from Landline Numbers?

Important: Mexico eliminated the distinct mobile number format in August 2020. Both mobile and landline numbers now use the same format: +52 [Area Code] [Subscriber Number].

Before August 2020, you had to include a "1" after the country code for mobile numbers (+52 1 [Area Code] [Subscriber Number]). Mexico removed this requirement to align with international standards.

[Source: Multiple telecom provider announcements, August 2020]

You cannot reliably distinguish mobile from landline numbers by format alone due to number portability and the unified format.

Carrier Identification Methods

When you need to distinguish mobile from landline numbers, use one of these methods:

  • Phone Number Validation APIs: Services like Twilio Lookup API, Telesign PhoneID, Tlaloc Web Services (Mexico-specific), Veriphone, or AbstractAPI provide carrier identification, line type (mobile/landline), and number portability status. These APIs query carrier databases in real-time to return accurate information.
  • HLR (Home Location Register) Lookups: Query the mobile network's HLR to determine if a number is active, the current carrier, and whether it's mobile or landline. More expensive but highly accurate for mobile numbers.
  • Local Carrier Databases: Maintain an updated database of number ranges assigned to specific carriers and line types, though this requires frequent updates due to number portability.

Developer Recommendation: For production systems requiring mobile/landline distinction, integrate a phone number validation API with caching to balance accuracy and cost. Implement fallback logic that assumes mobile for critical use cases (e.g., SMS delivery) when API calls fail.

[Sources: Tlaloc Web Services documentation, Twilio Lookup API documentation, 2024]

What Changed in Mexico's 2019–2020 Numbering Reforms?

Mexico implemented significant reforms that simplified dialing and number handling:

August 3, 2019 Reform

The IFT approved major changes to standardize domestic dialing:

  • Eliminated Long-Distance Prefixes: Removed the domestic long-distance prefix "01" for calls within Mexico.
  • Eliminated Mobile Prefixes: Removed mobile prefixes "044" (local mobile calls) and "045" (long-distance mobile calls).
  • Standardized 10-Digit Dialing: All calls within Mexico now use 10 digits (area code + subscriber number), regardless of call type (landline, mobile, local, or long-distance).
  • Enhanced Number Portability: Users can switch carriers while keeping their number. IFT regulations require number portability completion within 24 hours, making carrier identification more challenging.

[Source: IFT Press Release 54/2014]

[Source: IFT Fundamental Technical Plan for Numbering, effective August 3, 2019]

August 2020 International Dialing Change

Mexico eliminated the "1" mobile identifier for international calls:

  • Old Format (pre-August 2020): +52 1 [Area Code] [Subscriber Number] for mobile numbers
  • Current Format (August 2020+): +52 [Area Code] [Subscriber Number] for both mobile and landline numbers

This change aligned Mexico's international dialing format with global standards and simplified calling procedures for international callers. Update any legacy systems still using the old format by removing the "1" after "+52" in your validation logic and stored numbers.

[Source: Telecom provider notifications, August 2020]

These reforms simplify validation and routing logic for developers.

How Do You Validate Mexican Phone Numbers?

Build robust validation that ensures data integrity and delivers a smooth user experience.

Regular Expressions

Use regular expressions to validate number formats:

javascript
// Basic Validation (Current format – both mobile and landline)
const basicRegex = /^\+52[2-9]\d{9}$/;

// More specific validation with area code structure
const detailedRegex = /^\+52([2-9]\d{7}|[2-9]\d{2}\d{6})$/;

// Validation for 2-digit area codes (major cities)
const twoDigitAreaCodeRegex = /^\+52([2-9]\d)\d{8}$/;

// Validation for 3-digit area codes (smaller cities)
const threeDigitAreaCodeRegex = /^\+52([2-9]\d{2})\d{7}$/;

// Example usage with error handling
function validateMexicanNumber(number) {
  if (!number || typeof number !== 'string') {
    return { valid: false, error: 'Invalid input' };
  }

  const cleaned = number.trim();

  // Check for legacy +52 1 format
  if (/^\+521/.test(cleaned)) {
    return {
      valid: false,
      error: 'Legacy format detected. Remove "1" after +52'
    };
  }

  // Validate current format
  if (basicRegex.test(cleaned)) {
    return { valid: true, format: 'E.164' };
  }

  return { valid: false, error: 'Invalid Mexican phone number format' };
}

// Test cases
console.log(validateMexicanNumber("+525512345678"));  // Valid
console.log(validateMexicanNumber("+52222123456"));   // Valid (3-digit area code)
console.log(validateMexicanNumber("+52 1 55 1234 5678")); // Invalid (legacy)

These regex examples are simplified for illustration. For production environments, build more robust patterns that handle edge cases and validate specific area codes.

Consult the IFT website for current area code information.

Important: Update older validation logic that checks for the "+52 1" mobile format. This format is outdated – use the current unified format implemented in August 2020.

Area Code Validation

Don't rely solely on regex for area code validation. Area codes change and number portability complicates validation. Use a regularly updated area code database or an external API for accurate validation.

Recommended Validation Services:

  • Twilio Lookup API: Real-time carrier and line type identification. Cost: ~$0.005–$0.01 per lookup. Best for: High-volume applications.
  • Tlaloc Web Services: Mexico-specific phone validation with carrier and geographic zone data. Best for: Mexico-focused applications.
  • Telesign PhoneID: Comprehensive number intelligence including risk scoring. Cost: ~$0.01–$0.03 per lookup. Best for: Fraud prevention.
  • AbstractAPI Phone Validation: Free tier available, supports 180+ countries. Best for: Low-volume or development use.

Cost and Performance Considerations:

  • Implement caching (24-48 hour TTL) to reduce API costs for frequently checked numbers
  • Use batch validation APIs when processing large lists
  • Set request timeouts (2-5 seconds) to prevent blocking user workflows
  • Implement exponential backoff for retries on API failures

Fallback Strategy:

  1. Attempt real-time API validation
  2. If API fails, validate against local area code database (updated monthly)
  3. If database validation fails, apply regex-only validation and flag for manual review
  4. Log all fallback events for monitoring

[Sources: Twilio, Telesign, AbstractAPI documentation, 2024]

Best Practices

  • Real-time Lookup: For critical applications, use real-time API validation to account for number portability.
  • Graceful Degradation: If real-time validation fails, provide fallback mechanisms to avoid blocking legitimate users.
  • Informative Error Messages: Guide users with clear, specific error messages that explain how to correct invalid input.

How to Format Mexican Phone Numbers Correctly

Format numbers consistently for improved readability and data integrity.

E.164 Format

The E.164 format is the international standard. Store phone numbers in this format:

  • +525512345678 (Mobile or Landline – unified format)
  • +523312345678 (Mobile or Landline – unified format)

Why E.164 for Storage:

Store phone numbers in E.164 format because it:

  • Eliminates ambiguity with a single global format
  • Enables efficient indexing and searching
  • Supports international routing without transformation
  • Prevents formatting inconsistencies across systems
  • Simplifies number portability tracking

Convert to localized display formats only when presenting to users. This approach ensures data integrity while maintaining user-friendly interfaces.

[Source: ITU-T E.164 Recommendation]

Display Formatting

Format numbers for display purposes to enhance readability:

javascript
function formatNumberForDisplay(number) {
  // Input sanitization
  if (!number || typeof number !== 'string') {
    return null;
  }

  // Remove all non-digit characters
  const cleaned = number.replace(/\D/g, '');

  // Handle numbers with country code (12 digits: 52 + 10)
  if (cleaned.length === 12 && cleaned.startsWith('52')) {
    const areaCode = cleaned.slice(2, 4);
    const firstPart = cleaned.slice(4, 8);
    const secondPart = cleaned.slice(8);
    return `+52 ${areaCode} ${firstPart} ${secondPart}`;
  }

  // Handle 3-digit area code format
  if (cleaned.length === 12 && cleaned.startsWith('52')) {
    const areaCode = cleaned.slice(2, 5);
    const firstPart = cleaned.slice(5, 8);
    const secondPart = cleaned.slice(8);
    return `+52 ${areaCode} ${firstPart} ${secondPart}`;
  }

  // Handle numbers without country code (10 digits)
  if (cleaned.length === 10) {
    // Assume 2-digit area code for major cities
    if (['55', '33', '81'].includes(cleaned.slice(0, 2))) {
      return `+52 ${cleaned.slice(0, 2)} ${cleaned.slice(2, 6)} ${cleaned.slice(6)}`;
    }
    // 3-digit area code
    return `+52 ${cleaned.slice(0, 3)} ${cleaned.slice(3, 6)} ${cleaned.slice(6)}`;
  }

  // Handle malformed input - return null or original
  return null;
}

// Test cases
console.log(formatNumberForDisplay("+525512345678"));      // +52 55 1234 5678
console.log(formatNumberForDisplay("525512345678"));       // +52 55 1234 5678
console.log(formatNumberForDisplay("55-1234-5678"));       // +52 55 1234 5678
console.log(formatNumberForDisplay("+52 222 123 4567"));   // +52 222 123 4567
console.log(formatNumberForDisplay("invalid"));            // null

Note: This function reflects Mexico's current unified format. Remove legacy logic that formatted mobile numbers with the "1" identifier – that format became obsolete in August 2020.

What Regulatory Requirements Apply to Mexican Phone Numbers?

Stay current with Mexican telecommunications regulations.

Key Regulations and Bodies

  • IFT (Federal Institute of Telecommunications): Mexico's primary telecommunications regulatory body. Consult their website (ift.org.mx) for current regulations and area code updates. The IFT operates as an independent, autonomous constitutional entity.
  • Number Portability: Account for number portability's impact on your validation and carrier identification processes. Users can port their number within 24 hours under IFT regulations.

[Source: IFT Press Release 54/2014]

  • Data Security: Comply with data privacy regulations and implement appropriate security measures when handling user data.

Data Privacy Compliance

LFPDPPP (Federal Law on Protection of Personal Data Held by Private Parties):

Mexico's primary data privacy law, updated March 21, 2025, applies to all private entities processing personal data in Mexico. Phone numbers qualify as personal data and require:

  • Consent: Obtain explicit consent before collecting and processing phone numbers for marketing or non-essential purposes. Tacit consent is permitted for transactional communications if users are informed and don't object.
  • Privacy Notices: Provide comprehensive privacy notices (Aviso de Privacidad) explaining data collection, purposes, and user rights. Write notices clearly, make them accessible, and present them in Spanish.
  • ARCO Rights: Honor user rights to Access, Rectification, Cancellation, and Opposition. Respond to requests within 20 business days and implement approved changes within 15 additional days.
  • Security Measures: Implement administrative, technical, and physical safeguards proportionate to data sensitivity and risk.
  • Breach Notification: Notify affected individuals immediately when security vulnerabilities significantly impact their rights.
  • Retention Limits: Delete phone numbers and related data after you fulfill stated purposes and retention periods expire (maximum 72 months for contractual non-compliance data).

Enforcement: The Secretariat of Anti-Corruption and Good Governance (Secretaría de la Función Pública) enforces LFPDPPP. Penalties range from 100 to 320,000 times the UMA (Unit of Measurement and Update, ~$108 USD as of 2024). Higher fines apply to sensitive data breaches and repeat violations. Severe violations trigger criminal sanctions.

[Sources: LFPDPPP 2025, Mexican Official Gazette, March 20, 2025]

SMS Compliance Requirements

REPEP Registry (Public Registry to Avoid Advertising):

  • Check contact lists against REPEP before SMS campaigns. Registration is indefinite (no expiration).
  • Managed by PROFECO (Federal Consumer Protection Agency) in coordination with IFT.
  • Implement automated REPEP checking and maintain internal suppression lists.

Federal Telecommunications and Broadcasting Law Requirements:

  • Support "ALTO" (STOP) and "AYUDA" (HELP) commands in Spanish
  • Respect time restrictions: No messages between 9:00 PM and 9:00 AM local time (except critical alerts)
  • Mexico spans 4 time zones: Southeast (UTC-5), Central (UTC-6), Pacific (UTC-7), Northwest (UTC-8)
  • Obtain explicit consent before sending marketing messages
  • Process opt-out requests within 24 hours

Prohibited SMS Content: Firearms, gambling, adult content, predatory loans, lead generation, text-to-pay services, controlled substances, cannabis, alcohol, and political campaigns.

For comprehensive SMS compliance guidance, see our Mexico SMS guide.

[Sources: IFT Federal Telecommunications and Broadcasting Law, PROFECO REPEP regulations, 2024]

Best Practices

  • Regular Updates: Keep your validation and formatting logic current with the latest regulations and area code changes. The 2019 and 2020 reforms significantly changed Mexico's numbering plan – ensure your systems reflect these changes.
  • Error Logging: Log validation failures and errors for monitoring and troubleshooting.
  • Performance Optimization: Cache carrier lookup results and optimize database operations for efficient processing.

Additional Resources

Frequently Asked Questions About Mexico Phone Numbers

What is Mexico's country code for phone numbers?

Mexico's country code is +52. Use this prefix when dialing Mexican phone numbers internationally. The complete format is +52 followed by a 10-digit number (area code + subscriber number).

How do you dial a Mexican mobile phone from the US?

Dial 011 (US exit code), then 52 (Mexico country code), followed by the 10-digit Mexican number (area code + subscriber number). For example: 011 52 55 1234 5678. Don't add a "1" after 52 – Mexico eliminated that format in August 2020.

What are the main area codes in Mexico?

Major Mexican area codes include:

Area CodeCity/RegionType
55 / 56Mexico City2-digit
33Guadalajara, Jalisco2-digit
81Monterrey, Nuevo León2-digit
222Puebla, Puebla3-digit
664 / 663Tijuana, Baja California3-digit
999 / 990Mérida, Yucatán3-digit
656 / 657Ciudad Juárez, Chihuahua3-digit
442 / 446Querétaro, Querétaro3-digit
844Saltillo, Coahuila3-digit
998Cancún, Quintana Roo3-digit

For a complete list, consult the Wikipedia area codes reference or the IFT website.

[Source: IFT, Wikipedia]

Can you tell if a Mexican number is mobile or landline?

No. You cannot reliably distinguish mobile from landline numbers by format alone. Since the 2019–2020 reforms, both types use the same format (+52 + 10 digits) and can share area codes due to number portability.

What happened to the +52 1 mobile format?

Mexico eliminated the "+52 1" mobile format in August 2020 to align with international standards. All Mexican numbers now use the unified format +52 [Area Code] [Subscriber Number], regardless of whether they're mobile or landline.

How long does number portability take in Mexico?

IFT regulations require carriers to complete number portability within 24 hours. Users can switch carriers while keeping their existing phone number with minimal disruption.

[Source: IFT Press Release 54/2014]

What is the E.164 format for Mexican phone numbers?

The E.164 format for Mexican phone numbers is +52 followed immediately by 10 digits with no spaces or special characters. Example: +525512345678. This international standard format is recommended for storing phone numbers in databases.

When did Mexico eliminate the 01, 044, and 045 dialing prefixes?

Mexico eliminated these prefixes on August 3, 2019, as part of IFT's numbering reform. The "01" long-distance prefix and "044"/"045" mobile prefixes are no longer needed – all domestic calls now use simple 10-digit dialing.

International SMS and MMS Considerations

SMS Delivery to Mexico

Carrier Network: Mexico's SMS market is dominated by three carriers: Telcel (58.7% market share, Q1 2024), AT&T Mexico (15.6%), and Movistar/Telefónica (16.7%).

Message Encoding:

  • GSM-7: 160 characters per message, 153 per segment for concatenated messages
  • UCS-2 (Unicode, including Spanish accents ñ, á, é, í, ó, ú): 70 characters per message, 67 per segment

Sender ID Options:

  • Alphanumeric Sender IDs: Supported with pre-registration required for Telcel and Movistar. Unregistered IDs replaced with short codes.
  • Long Codes: Domestic and international supported. Sender ID may be modified for international.
  • Short Codes: ~8 weeks provisioning time. Ideal for high-volume campaigns.

Two-way SMS: Fully supported with no special restrictions.

MMS Support

MMS messages are automatically converted to SMS with embedded URL links to multimedia content. Ensure URLs are shortened and clearly labeled to encourage engagement.

You cannot send SMS to landline numbers – attempts result in error code 21614 with no charges.

Cost Considerations

Typical International SMS Pricing to Mexico (2024 estimates):

  • Twilio: ~$0.0095–$0.015 per message
  • Sinch: ~$0.008–$0.012 per message
  • MessageBird: ~$0.009–$0.013 per message
  • Plivo: ~$0.008–$0.011 per message

Prices vary by carrier, message type, and volume. Concatenated messages charged per segment. Consult provider pricing pages for current rates.

Throughput: Standard rate: 1 message/second per source number. Burst rate: up to 30 messages/second with proper queuing and carrier agreements.

[Sources: Twilio, Sinch, MessageBird, Plivo pricing pages; Mexico SMS compliance guide, 2024]

Troubleshooting Common Issues

Validation Errors

Issue: Numbers fail validation despite appearing correct

  • Solution: Check for legacy "+52 1" format. Remove the "1" after country code.
  • Solution: Verify area code length matches subscriber number length (2+8 or 3+7 digits).
  • Solution: Ensure regex allows all valid area code prefixes (2-9, not 0-1).

Issue: API validation returns "invalid" for known working numbers

  • Solution: Number may have been recently ported. Clear validation cache and retry.
  • Solution: Check API service status and error codes for rate limiting or outages.

Formatting Errors

Issue: Display formatting produces incorrect spacing

  • Solution: Detect area code length before applying format template. Don't assume all are 2-digit.
  • Solution: Implement separate formatters for 2-digit and 3-digit area codes.

Issue: Users enter numbers in various formats (spaces, dashes, parentheses)

  • Solution: Normalize input by removing all non-digit characters before validation.
  • Solution: Support multiple input formats and convert to E.164 for storage.

SMS Delivery Failures

Issue: Messages not delivered despite valid numbers

  • Solution: Verify number is mobile (SMS to landlines fail). Use validation API to check line type.
  • Solution: Check message timing against 9 PM – 9 AM restriction window and recipient time zone.
  • Solution: Verify sender ID registration status with carriers if using alphanumeric sender.
  • Solution: Check REPEP registry – number may be on do-not-contact list.

Issue: High bounce rates or carrier filtering

  • Solution: Remove URLs from messages if sender ID not registered.
  • Solution: Avoid excessive punctuation, all-caps, and promotional language.
  • Solution: Limit frequency to 3-4 messages per week per recipient.

Compliance Issues

Issue: Unable to determine if consent was obtained

  • Solution: Implement consent tracking database with timestamp, method, and phone number fields.
  • Solution: Send confirmation message after opt-in with clear ALTO/AYUDA instructions.

Issue: LFPDPPP privacy notice requirements unclear

  • Solution: Use privacy notice template from PROFECO or legal counsel.
  • Solution: Include all mandatory elements: controller identity, data categories, purposes requiring consent, ARCO rights process.

[Sources: Twilio troubleshooting guides, IFT compliance documentation, developer community reports, 2024]

Follow these guidelines and stay informed about regulatory changes to ensure accurate, compliant handling of Mexican phone numbers in your applications.

Frequently Asked Questions

How to validate Mexican phone numbers using regex?

Regular expressions offer a powerful method for validating Mexican phone number formats. Simplified examples include `^\+52(?:1)?[2-9]\d{9,10}$` for basic validation and more specific regex for mobile (`^\+521[2-9]\d{9}$`) and landline (`^\+52[2-9]\d{9,10}$`) numbers. For production, more robust patterns are recommended to handle edge cases and area code specifics. Consult resources like the IFT website for up-to-date area code information for accurate validation in your applications.

What is the correct format for Mexican mobile numbers?

Mexican mobile numbers follow the format `+52 1 [Area Code] [Subscriber Number]`. The "1" after the country code (+52) is essential for distinguishing mobile numbers from landlines. This identifier is crucial for routing calls correctly and should always be included when storing or processing mobile numbers from Mexico.

Why does Mexico use +52 as the country code?

+52 is the internationally recognized country code assigned to Mexico. It must be included when dialing Mexican numbers from outside the country. Within Mexico, 10-digit dialing is now standard, using area code + subscriber number after the 2019 reforms.

When should I use E.164 format for Mexican numbers?

The E.164 format (+5215512345678 for mobile, +525512345678 for landline) is the international standard and is recommended for storing phone numbers. This format ensures compatibility with international systems and simplifies processing for various telecommunication applications and services, as it provides a unified structure for storing and managing phone number data from different countries.

What is the area code for Mexico City?

Mexico City's area code is 55. Major metropolitan areas in Mexico typically use 2-digit area codes, while smaller cities and rural areas use 3-digit codes. It's important to validate using updated resources, as area codes can change over time, particularly with number portability and regulatory changes.

How to format Mexican phone numbers for display?

For improved readability, format numbers with spaces or other separators. For a 12-digit mobile number, a suggested display format is `+52 1 AA BBB CCCC`, and for an 11-digit landline, `+52 AA BBB CCCC`. Remember to always store the raw E.164 format separately for processing and data consistency.

Can I rely on regex alone for Mexican number validation?

While regex is useful for initial format validation, relying solely on it for area code validation is insufficient due to number portability and dynamic area code assignments. For accurate validation, consider using a regularly updated area code database or an external API that reflects the latest changes in number assignments and portability.

What are the 2019 Mexican numbering plan reforms?

The 2019 reforms simplified Mexico's dialing system by eliminating long-distance prefixes within the country, standardizing 10-digit dialing (area code + subscriber number), and enhancing number portability. These changes simplified validation and call routing processes, as callers no longer need to dial long-distance prefixes within Mexico.

How to handle number portability in Mexico?

Number portability allows users to switch carriers while keeping their number. This makes carrier identification based solely on the number unreliable. For accurate carrier identification, consider using a real-time lookup service via API or similar methods.

What is the role of IFT in Mexican telecommunications?

The IFT (Federal Institute of Telecommunications) is the primary regulatory body for telecommunications in Mexico. Consult their website (ift.org.mx) for the latest regulations, area code updates, and other important information related to Mexico's telecommunications sector.

Where can I find a list of Mexican area codes?

You can find a list of Mexican area codes on the IFT (Federal Institute of Telecommunications) website, Wikipedia's page on area codes in Mexico, and other online resources. However, be sure to use reliable and up-to-date sources as area codes can change.