The B2B CRM Regex & E.164 Formatter
If you are automating SMS outreach, voicemail drops, or automated WhatsApp messages, you will inevitably encounter the most common error in B2B automation: Invalid Phone Number Format.
Sales representatives enter data into Salesforce and HubSpot in a hundred different ways: (555) 123-4567, 555.123.4567 ext 9, or even just 1234567890. If your automation passes that raw string directly into a communications API, the workflow will instantly crash. Use the live tool above to test your messy CRM data and generate the exact Regex/JavaScript needed to clean it on the fly.
Communication APIs (like Twilio, Plivo, MessageBird, and WhatsApp Business API) operate on a global telecommunications network.
They do not know if 555-0199 is a local number in New York or a local number in London.
To route a message internationally, these APIs strictly enforce the E.164 telecommunications standard. If a payload arrives that contains parentheses, spaces, dashes, or lacks a designated country code, their servers will instantly return an HTTP 400 Bad Request error, halting your automation.
To make a phone number E.164 compliant, it must follow three strict rules:
1 for North America, 44 for the UK).Example Transformation:
(415) 555-2671 ext. 33+14155552671 (Note: The extension is completely stripped out by our Regex logic above, as SMS gateways cannot dial extensions).You do not need to fix the data inside your CRM manually. The best practice is to let sales reps type however they want, and sanitize the data mid-flight inside your iPaaS platform.
In Make.com, you do not need to run a complex script. You can use their native replace() function combined with a regular expression (Regex) directly inside the Twilio node’s input field. Select the “Make.com Formula” tab in the tool above to copy the exact expression that prepends your country code and strips all non-digit characters /[^\d+]/g.
If you are using n8n or writing a custom AWS Lambda function, you should process the string using a Code Node. Select the “Node.js” tab above to get our robust toE164() function. This script intelligently checks if the user already typed a country code before blindly prepending a new one (preventing errors like +1+1555...).
If your CRM contains international leads, setting a static +1 default country code will break your European numbers. In this scenario, you must build a router in your automation tool that checks the “Country” field in your CRM (e.g., “Germany”). If the country is Germany, route the data through a text formatter that explicitly applies the +49 prefix before hitting the SMS API.
Tired of debugging failed webhooks? Stop letting dirty data crash your pipelines. Download our library of pre-built, fault-tolerant data sanitation modules for n8n and Make.com.