Format Salesforce phone numbers in E.164
E.164 is the format most telephony, SMS, and CTI integrations expect: a plus sign, the country
code, and the national number with no spaces, such as +16502530000. Salesforce stores
phone fields as free text, so the same number arrives as (650) 253-0000,
650.253.0000, or 001 650 253 0000. NumberForge parses each value with
Google libphonenumber and rewrites it in E.164, or another format, inside your org.
Why a validation rule or formula is not enough
A validation rule with REGEX can check characters and length, but it cannot know
that a ten-digit US number and a ten-digit Italian mobile follow different rules, or which
country code a local number needs. Correct formatting depends on per-country metadata:
valid lengths, prefixes, and national dialing rules. libphonenumber maintains that metadata
for every country, and NumberForge ships it in the package.
Local numbers need a country
A number that starts with + carries its own country. A local number such as
06 1234 5678 can only be converted when the country is known. NumberForge takes it
from the org default (a fixed country or the organization locale), from a country field on the
record, or from the field rule. When there is no country context, the result is
Needs region instead of a wrong guess.
Three ways to normalize phone fields
| Where | How | Code |
|---|---|---|
| On save | A field rule in NumberForge Configuration formats the field on insert, update, or both. | None |
| Flow | NF Process Phone with Output Format E164, then Update Records with the Formatted Value. | None |
| Apex | Parse, check, and format with the global NF class in triggers, batch, or integrations. | Yes |
NF.Phone phone = NF.parse(contact.Phone, 'US');
if (NF.isValid(phone)) {
contact.Phone = NF.format(phone, NF.Format.E164); // +16502530000
} Supported formats
| Format | Example | Typical use |
|---|---|---|
| E.164 | +16502530000 | Storage, integrations, SMS |
| International | +1 650-253-0000 | Display with country code |
| National | (650) 253-0000 | Local display |
| RFC 3966 | tel:+1-650-253-0000 | tel: links |
Records you already have
Field rules apply as records are saved. To rewrite values already stored, run a batch Apex job
with the NF API or a scheduled flow with NF Process Phone over the records you
want to normalize.
Questions
What is the E.164 phone number format?
E.164 is the international numbering format defined by the ITU: a plus sign, the country calling code, and the national number, with no spaces or punctuation, up to 15 digits. For example, +16502530000 for a US number or +390612345678 for an Italian one.
Does NumberForge rewrite invalid phone numbers?
No. Formatting applies only to numbers that are valid for their country. Invalid values stay as entered, and a field rule can write a status or flag to another field, or block the save.
Does formatting call an external API?
No. Parsing and formatting run in Apex against libphonenumber metadata packaged as static resources, so phone numbers never leave your Salesforce org.
-
Saving a rule
Set the save format on a phone field and choose when the rule runs.
-
NF Process Phone
Flow action that returns E.164, international, national, and RFC 3966 values.
-
Formatting in Apex
NF.format and the NF.Format options in the API reference.
One plan: €29,99 per org / month or €299 per year. Sandbox orgs are free. Pricing · Phone validation overview · Install