Standardize US Phone Numbers (Multiple Formats) - n8n Workflow

Use this essential n8n workflow to clean, validate, and format messy US phone numbers into E.164, National, and International standards. A powerful n8n template for data normalization.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Users managing large Customer Relationship Management (CRM) databases where data quality is critical.

  • Sales operations professionals needing consistent data input for dialing systems.

  • Developers or data engineers building reusable data validation functions within their n8n automation.

  • Anyone seeking a reliable n8n template for data cleaning tasks.

Overview

Handling inconsistent phone number formats is one of the most tedious aspects of data management. This robust n8n workflow template is designed to automatically clean, validate, and standardize US phone numbers, regardless of how messy the initial input is (e.g., 1(800)-555.5555 extension 123). The automation first strips all non-numeric characters, then uses core logic flow control to check for proper length and country code (1). If a valid 10-digit number is detected, the required country code is automatically added. The final step generates five distinct, ready-to-use output fields (E.164, National, International, etc.), ensuring data consistency across all your integrated applications. This reusable n8n node setup dramatically reduces manual data cleaning efforts.

How it Works

This reusable n8n workflow functions as a subroutine, triggered by another automation using the dedicated n8n trigger. The process is highly logical and handles multiple input scenarios:


  1. Input Stripping: The Strip phone number formatting n8n node is executed first, using a regular expression to remove all non-digit characters, normalizing the raw input string.

  2. Length Validation & Routing: The Check number of digits in phone number n8n node (a Switch node) checks the length of the sanitized number.

Numbers with 11 or more digits (already containing a potential country code and extension) are routed to country code validation.
Numbers exactly 10 digits long are routed to add the country code.
* Numbers shorter than 10 digits or inputs that are not numerical are flagged as invalid and routed to be cleared.

  1. Country Code Logic: If the number has 10 digits, the Add valid country code n8n node prepends '1'. If it has 11+ digits, the Check if first digit is valid country code n8n node verifies if the first digit is '1'. If not, the number is cleared.

  2. Final Formatting: Once validated and standardized to 11 digits (or more if an extension exists), the final Format phone numbers n8n node uses dynamic expressions to slice the number into various standardized formats: E.164 (used globally), National (localized formatting), Full National, and International format. It also isolates any detected extension digits.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the entire JSON code provided and paste it into your n8n canvas using the 'New' -> 'Import from JSON' option.

  2. Activation: Ensure the workflow is set to 'Active' so it can be called by other workflows.

  3. Usage: This n8n template uses the When Executed by Another Workflow n8n trigger. You must call this workflow from another active n8n workflow using the Execute Workflow n8n node, passing the raw phone number string in the 'Phone Number' input parameter.

Node Details

When Executed by Another Workflow (n8n trigger): Acts as the entry point, allowing this automation to be called as a standardized function within larger n8n workflow designs. Expects a 'Phone Number' input.
Strip phone number formatting (Set n8n node): Essential data preprocessing step. It uses a regex assignment (.match(/[0-9]+/gmi).join('')) to extract only numeric digits, removing all potential formatting characters.
Check number of digits in phone number (Switch n8n node): Provides core flow control logic. It dynamically routes the workflow based on whether the number has 10 digits, 11+ digits, or is invalid (less than 10 digits). This decision structure is central to the entire n8n workflow.
Add valid country code (Set n8n node): For 10-digit numbers, this n8n node prepends '1', ensuring the number conforms to a full 11-digit US standard.
Check if first digit is valid country code (If n8n node): Validates the input for numbers already containing extra digits (potential country codes or extensions), ensuring the first digit is exactly '1'.
Format phone numbers (Set n8n node): The final processing step. This powerful n8n node slices the clean 11+ digit number to generate standardized outputs, including +1... (E.164), (XXX) XXX-XXXX (National), and extracts extensions.

Related n8n Workflows

Free

Nodes: 4 Nodes
Updated: December 26 2025
View all
Created by
Sunny Thaper
Sunny Thaper

Featured*