For unit tests
Pin the dataset version and assert exact E.164 output. When the version changes, review affected countries instead of accepting every diff automatically.
Open developer data
Download calling codes, national patterns, E.164 examples, length notes and official-source links for the 31 countries currently supported by GetPhoneNum.
The dataset is available under the MIT license. When it supports documentation, research or an open-source project, link to this canonical page so readers can find the current version and official source notes.
GetPhoneNum country phone format fixtures, version 2026-07-20. https://getphonenum.com/phone-number-datasetSource code, version history and corrections are available in the GitHub repository. Please report stale numbering rules through GitHub Issues with an official reference.
The public JSON Schema Draft 2020-12 contract defines required fields, ISO and E.164 patterns, value types and allowed record properties. Pin the dataset version in reproducible tests and validate updates before importing them.
npx ajv-cli validate -s country-phone-formats.schema.json -d country-phone-formats.json| Field | Meaning |
|---|---|
iso2 | ISO 3166-1 alpha-2 country code used by the tools. |
callingCode | International E.164 country calling code. |
nationalPattern | Human-readable national presentation pattern. |
e164Example | Canonical test fixture used in examples. |
fixtureSafety | Whether the example is reserved or only structurally plausible. |
sourceUrl | Official numbering authority or international reference. |
Start with the fixtureSafety field. If a record cites a reserved, drama or creative-work example, it is better suited for screenshots and public documentation. If a record is labelled structural, keep it in local or isolated QA environments and disable outbound delivery. The label is part of the data contract; do not strip it when importing the CSV into a spreadsheet or the JSON into a test factory.
Next, review the sourceUrl and the country guide linked below. Some sources describe a complete national plan, while others describe a specific example range. Those two source types support different claims. A national plan can justify formatting and length tests; it does not automatically make every generated value fictional.
Pin the dataset version and assert exact E.164 output. When the version changes, review affected countries instead of accepting every diff automatically.
Copy the country, national pattern, E.164 example and safety note together. An isolated phone string loses the warning that tells readers not to call or text it.
Keep generated fixtures separate from production contacts. Do not enrich them, upload them to messaging tools or mix them with customer records.
Load the JSON into fixture factories or import the CSV into QA tools. Pin the version when reproducibility matters.
National plans change. Follow each record's source URL and use a maintained numbering library for production validation.
Found a stale pattern or source? Use the contact link in the About page and include the official reference.