vCard

How to Standardize Phone Number Formats in VCF Files

Quick Answer

The fastest way to standardize phone numbers in a VCF file is with Python’s phonenumbers library. It parses any phone number format, validates it, adds the correct country code, and outputs clean E.164 format (+14155551234). For quick cleanup without coding, use Notepad++ regex to strip formatting characters (parentheses, dashes, spaces, dots) from TEL lines. Always back up the original file before batch-modifying phone numbers.

Introduction

A single VCF file exported from multiple sources or built over years of contact accumulation can contain phone numbers in dozens of different formats. One contact has +1 (415) 555-1234, another has 4155551234, another has 001-415-555-1234, and another has 415.555.1234. They all represent the same number, but the inconsistency causes problems: CRM systems fail to match duplicates, caller ID lookups fail on numbers missing country codes, and importing into platforms with strict format requirements produces errors.

This guide covers four methods for normalizing phone numbers inside VCF files, from simple regex cleanup to full E.164 standardization with country code validation. Each method preserves all other contact data and TYPE labels (CELL, WORK, HOME) while only modifying the phone number values.

Why Phone Numbers Are Inconsistent in VCF Files

Phone number inconsistency in VCF files comes from three sources. First, different exporting platforms format numbers differently. Google Contacts exports with country codes and spaces (+1 415-555-1234). iPhone exports with the format the user originally entered. Outlook adds parentheses around area codes ((415) 555-1234). Samsung sometimes includes trunk prefixes specific to the local phone system.

Second, contacts entered manually over time use whatever format the person typed. Early contacts might use dots (415.555.1234), later contacts might use dashes, and international contacts might include or omit the plus sign. There is no validation at entry time in most contact apps.

Third, merging contacts from multiple sources (work phone, personal phone, email client, CRM export) combines different formatting conventions into one file. A VCF file that started on an Android phone, merged with an Outlook export, and was supplemented with a CRM download will contain at least three different phone number styles.

The E.164 Standard: What Normalized Phone Numbers Look Like

E.164 is the international telephone number format defined by the ITU. A phone number in E.164 format consists of a plus sign, the country code, and the subscriber number with no spaces, dashes, parentheses, or other formatting characters. The maximum length is 15 digits (plus the leading + sign).

Examples of E.164 format: +14155551234 (US), +442071234567 (UK), +919876543210 (India), +81312345678 (Japan). This format is unambiguous, machine-readable, and universally accepted by telephony systems, CRM platforms, and contact applications. Standardizing all phone numbers in a VCF file to E.164 eliminates duplicate detection failures and import compatibility issues.

In vCard 4.0, the TEL property uses URI format: TEL;VALUE=uri:tel:+14155551234. The E.164 number fits naturally into this syntax. In vCard 2.1 and 3.0, the number is stored as plain text: TEL;TYPE=CELL:+14155551234. Both formats accept E.164 numbers without issues.

Common Phone Number Formats Found in VCF Files

Format Found Source E.164 Equivalent
+1 415-555-1234 Google Contacts +14155551234
(415) 555-1234 Outlook, manual entry +14155551234
415.555.1234 Manual entry +14155551234
4155551234 CRM export, raw data +14155551234
001-415-555-1234 International dialing prefix +14155551234
+44 20 7123 4567 UK number with spaces +442071234567
tel:+14155551234 vCard 4.0 URI format +14155551234

Method 1: Regex Find-and-Replace (Notepad++)

Best for: Stripping formatting characters when all numbers already have country codes.

This method removes parentheses, dashes, dots, and spaces from phone number values without altering the property name or parameters. Open the VCF file in Notepad++, press Ctrl+H, set search mode to “Regular expression”, and use:

Find: (TEL[^:]*:)\+?(\d)[\s\.\-\(\)]+

This approach requires multiple passes because the regex replaces one formatting character at a time between digit groups. A simpler alternative is a two-step process: first, find (TEL[^:]*:)(.*) and use a callback to strip non-digit characters from group 2. However, Notepad++ does not support callbacks natively, so the Python method is better for complex normalization.

For basic cleanup (removing just dashes and spaces), a simpler find-and-replace works: find (TEL[^:]*:\+?\d+)[\s\-\.\(\)]+([\d]) and replace with \1\2. Run “Replace All” repeatedly until no more matches are found. This iteratively strips one formatting character per pass until only digits and the leading plus remain.

Method 2: Python Script with phonenumbers Library

Best for: Full E.164 normalization including country code addition and validation.

Google’s phonenumbers library (a Python port of libphonenumber) parses phone numbers in any format, validates them, and outputs clean E.164. Install with pip install phonenumbers vobject, then use this script:

import vobject, phonenumbers
DEFAULT_REGION = 'US'
with open('contacts.vcf') as f:
    text = f.read()
cards = list(vobject.readComponents(text))
for card in cards:
    if hasattr(card, 'tel_list'):
        for tel in card.tel_list:
            try:
                parsed = phonenumbers.parse(tel.value, DEFAULT_REGION)
                if phonenumbers.is_valid_number(parsed):
                    tel.value = phonenumbers.format_number(
                        parsed, phonenumbers.PhoneNumberFormat.E164)
            except: pass
with open('contacts-normalized.vcf', 'w') as out:
    for card in cards:
        out.write(card.serialize())

Set DEFAULT_REGION to the two-letter country code (US, GB, IN, JP) for numbers without a country code. The library determines the correct country code based on the number length and area code. Numbers that are already in international format are parsed correctly regardless of the default region. Invalid numbers (wrong digit count, impossible area codes) are left unchanged by the try/except block.

Method 3: Spreadsheet Cleanup (Excel / Google Sheets)

Best for: Users who prefer visual editing over scripting.

Convert the VCF to CSV first using a VCF converter, then open the CSV in Excel or Google Sheets. Phone number columns are immediately visible and editable. Use spreadsheet functions to clean up formatting:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2," ",""),"-",""),".",""),"(","")&")" removes spaces, dashes, dots, and parentheses. For adding a country code to 10-digit US numbers: =IF(LEN(cleaned)=10,"+1"&cleaned,IF(LEFT(cleaned,1)="+",cleaned,"+"&cleaned)). After cleanup, export back to VCF format.

The downside of this method is the double conversion (VCF to CSV, edit, CSV back to VCF) which can lose data like photos, TYPE labels, and structured addresses. It works well for basic contact lists but is not ideal for files with rich metadata. For more on VCF-to-spreadsheet workflows, see our VCF and Excel guide.

Method 4: Command Line (sed)

Best for: Quick batch cleanup on Mac/Linux without installing libraries.

Strip all formatting characters from TEL lines while preserving the property name and parameters:

sed -E 's/(TEL[^:]*:)\+?([0-9 .\-\(\)]+)/\1+\2/; s/(TEL[^:]*:\+?[0-9]+)[ .\-\(\)]+/\1/g' contacts.vcf

This two-part sed command first ensures a plus sign prefix on the number, then strips spaces, dots, dashes, and parentheses from the digit sequence. Run it multiple times until the output stabilizes (no more formatting characters between digits). Redirect output to a new file: append > normalized.vcf instead of using -i for in-place editing, so you can compare the result with the original.

The sed approach cannot add missing country codes or validate numbers. It only strips formatting. For full normalization with country code resolution, use the Python method.

Adding Missing Country Codes

Numbers without country codes are the hardest to normalize because the correct country code depends on where the contact is located, not where the file was created. A 10-digit number in a US-exported file is probably a US number (+1), but it could be a Canadian number (also +1) or a completely different country’s number that happens to have 10 digits.

The safest approach is to set a default region for numbers without a plus sign and validate the result. Python’s phonenumbers library does this automatically: phonenumbers.parse('4155551234', 'US') produces +14155551234. If the number is invalid for the specified region (wrong length, impossible area code), the library throws an exception and the number is left unchanged.

For mixed-country contact lists, batch processing with a single default region will misformat some numbers. In that case, process the file with the Python script, then manually review any numbers that were left unchanged (they failed validation) and add the correct country codes by hand.

Preserving TYPE Labels During Normalization

When modifying phone numbers, you must preserve the TYPE parameters (CELL, WORK, HOME, FAX) attached to each TEL property. All four methods in this guide preserve TYPE labels because they modify only the value portion after the colon, not the property name or parameters before it.

However, be aware that some export tools reorder or rename TYPE labels during re-export. If you convert VCF to CSV and back, the CSV format may not retain the distinction between CELL and WORK numbers. The Python method using vobject preserves all parameters exactly as they appear in the original file. For a reference on how TYPE parameters work in VCF files, see our VCF file structure guide.

Frequently Asked Questions

Will normalizing phone numbers break the VCF file?

No, if done correctly. Phone number normalization only changes the value portion of TEL properties. The file structure, other properties, and TYPE labels remain unchanged. Always work on a copy and verify the result in a VCF viewer before replacing the original.

Should I use E.164 format or keep the local format?

E.164 is recommended for maximum compatibility with CRM systems, VoIP platforms, and international contacts. If the VCF file is used only within one country and contacts are never shared internationally, local format with a country code prefix (like +1 415-555-1234 with spaces) is also acceptable. Avoid storing numbers without country codes.

How do I handle extensions and special characters?

Phone extensions (like +14155551234;ext=100) should be preserved separately from the main number. The phonenumbers library recognizes extensions and keeps them during formatting. Characters like “p” (pause) and “w” (wait) used in auto-dial sequences should be left as-is since they are dialing instructions, not formatting.

Can I normalize phone numbers in a VCF file on my phone?

Not directly. Mobile phones do not have built-in VCF editing tools. The best approach is to transfer the VCF file to a computer, normalize it using one of the four methods above, then transfer the cleaned file back to your phone and import it. Alternatively, use Google Contacts as an intermediary: import the VCF, let Google normalize the numbers (it adds country codes automatically based on your account region), then re-export.

What happens to numbers that cannot be parsed?

The Python script’s try/except block leaves unparseable numbers unchanged. These are typically short codes (like 911 or 411), internal extensions (4-digit numbers), or numbers with non-numeric characters. After running the script, search the output file for TEL values without a leading + sign to identify numbers that were not normalized and review them manually.

Conclusion

Last verified: February 2026. Python phonenumbers library version 8.13.50 tested with vobject 0.9.7 on Python 3.12. Regex patterns tested in Notepad++ 8.7. sed commands tested on macOS 15 and Ubuntu 24.04. E.164 formatting validated against ITU-T Recommendation E.164.

Standardizing phone numbers in VCF files comes down to two decisions: how clean do you need the output (formatting removal only vs full E.164 with country codes), and how many contacts need processing (a few dozen vs thousands). For formatting cleanup only, Notepad++ regex or sed handles the job without any setup. For full E.164 normalization with validation, the Python phonenumbers script is the most reliable method. Whichever approach you choose, always preserve your original file and verify TYPE labels are intact after processing.

For most users, the Python phonenumbers method is the best balance of accuracy and automation. Set your default region, run the script, and every valid number gets clean E.164 formatting with the correct country code. Invalid numbers are left unchanged for manual review. The entire process takes under a minute for files with thousands of contacts.

About the Author

This guide is written and maintained by the Univik team, developers of file conversion and digital forensics tools since 2013. Phone number normalization is a core step in our contact migration and CRM integration workflows. The methods described here are used in our production tools for processing contact databases with millions of phone numbers across 200+ countries. Questions about a specific phone format? Contact our team.