Code

Prepare a Mixed Phone List for an E.164 Import

·

Use the formatter when an API or contact import takes a primary phone field in international form. The text result uses a leading plus sign and up to 15 digits. A region gives a local number the context it needs. The report keeps line numbers and extensions so you can review the conversion before copying it.

Phone Number E.164 Formatter

Convert UK and US example numbers with their original line numbers

Select Load example. The region changes to United Kingdom (+44). Keep Separate extensions and Require a numbering-plan match enabled. Run Format to E.164. Line 1, 020 7946 0100, becomes +442079460100. Line 2 keeps its explicit +1 and becomes +12025550142, with extension 52 recorded separately.

The blank third line is skipped. Line 4 has a length that fits the Singapore plan but fails the digit-pattern check in the bundled metadata. Line 5 repeats the London result from line 1 and includes a note about the removed trunk zero in its international notation. The London landline and the US 555 number are reserved examples.

Open the Phone Number E.164 FormatterOfcom telephone numbers for drama programmesNANPA reserved 555 line numberslibphonenumber-js documentation for numbering-plan metadata

Compare the strict and length-only outcomes

With the same input, turn off Require a numbering-plan match and run again. Line 4 now shows +6510000000 with a digit review note. Check it against the original contact record before importing it. An unknown calling code or an unsupported length still blocks formatting.

If your file mixes local entries from different countries, split the local rows by region before processing, or add explicit international calling codes. The region controls how the tool interprets a local entry, including where the numbering plan uses a national prefix. The format check cannot tell whether the number is assigned or reachable.

Open the Phone Number E.164 FormatterITU-T Recommendation E.164 (02/2026)libphonenumber-js documentation for numbering-plan metadata

Keep the extension and review copies before import

Return to strict mode and download the E.164 TXT. It contains three formatted lines, including the repeated London number. Open it in a text editor to confirm the plus signs. If you import it into a spreadsheet, set the destination column to text so it keeps the written phone values.

Download the JSON report to keep input lines, the accepted values, extension 52 and the findings. To require numbers without extension suffixes on input, turn off Separate extensions and format again. Line 2 is then flagged for editing. Phone numbers and reports stay on your device unless you share the files.

Open the Phone Number E.164 FormatterITU-T Recommendation E.164 (02/2026)RFC 3966 telephone URI syntax and extensions

Common questions

Is the leading zero always removed when adding a country code?

The result depends on the numbering plan for the selected region. For the London example, 0 is a national trunk prefix. In Italy, the initial 0 for a fixed line such as a Milan number remains part of the international number.

Why did the export keep both copies of the same number?

Two lines can carry different extensions or belong to different records. The tool keeps them in input order and marks later rows with the line of the first matching primary number.

Does the E.164 plus sign count toward the 15-digit limit?

The limit counts only the digits in the international number. The leading plus is the written marker for international form, and an extension belongs in a separate field.

Sources

Put it into practice.

Related guides