1. Clean the input
Remove spaces, parentheses and hyphens while preserving the digits and country context.
+52 test data
Generate Mexico phone number examples for development, QA, input masks and documentation. Results are not live subscriber lines.
| Calling code | +52 |
|---|---|
| National pattern | xx xxxx xxxx |
| E.164 example | +525512345678 |
| Typical length | 10 national digits |
Remove spaces, parentheses and hyphens while preserving the digits and country context.
Keep the full 10-digit national number and add +52; omit historic 01, 044 and 045 prefixes.
Use +525512345678 for machine storage and format it for display at the edge of your application.
| Case | Fixture | Expected test behavior |
|---|---|---|
| National display | xx xxxx xxxx | Accept punctuation, then normalize. |
| Valid E.164 structure | +525512345678 | Accept for format testing; do not infer reachability. |
| Invalid length | +52551234567 | Reject before storing or sending to an API. |
Manually reviewed country notes
Mexico uses a unified ten-digit national format. Modern E.164 conversion keeps those ten digits after +52 and excludes the historic 01, 044 and 045 dialing prefixes that were removed from the national dialing scheme.
IFT's dialing guidance explains the format but does not designate this example as a fictional subscriber line. Use it only as local test data with outbound communications disabled.
Keep exactly ten national digits for this fixture.
Do not store historic 01, 044 or 045 prefixes.
Preserve the two-digit geographic or service prefix as part of the national value.
These cases document the fixture contract used by GetPhoneNum. They test parsing and normalization only; they never prove that a subscriber exists.
| Input | Expected result | Reason |
|---|---|---|
55 1234 5678 | +525512345678 | Add +52 to ten national digits |
+52 55 1234 5678 | +525512345678 | Normalize an international input |
044 55 1234 5678 | +525512345678 | Remove a historic dialing prefix |
551234567 | Reject | One national digit short |
+525512345678 | Structure only | Do not infer assignment |
Reviewed by GetPhoneNum Editorial Team · Last reviewed August 11, 2026
Test empty input, pasted punctuation, a missing country code, one digit too few and one digit too many. Avoid using a single global regex for every country.
Test a JavaScript regexStore a normalized E.164 value and keep display formatting separate. Try the E.164 formatter or structural validator.
Numbering plans change. Use a maintained numbering library and treat carrier, line type and reachability as separate checks.
Browse calling-code referencesRelated generators and tools
They are generated test fixtures, not verified subscriber lines. Even a structurally valid value may coincide with an assigned number unless it comes from an officially reserved fictional range.
+52 is the international country calling code for Mexico. In E.164 format it appears after the leading plus sign and before the national number.
No capability is provided or verified. Do not call, text or use generated values for account verification.
Numbering rules can change. Check the IFT 10-digit dialing guidance before enforcing production rules.
Create up to 100 local fixtures in the browser, download the open dataset, or use the API design reference to define a deterministic contract for automated test suites.