How to Format Phone Numbers in E.164 for Conversion Tracking
E.164 is the international phone number format required by Google Ads, Meta, Microsoft Ads, and TikTok for Enhanced Conversions. Learn how to normalize phone numbers to E.164 format with The Upload Offline Conversions App.
E.164 is the international standard phone number format required by all major ad platforms for Enhanced Conversions. If your phone numbers aren’t in E.164 format before SHA-256 hashing, the hashed values won’t match the ad platform’s records — and your phone-based matching will return zero results.
E.164 Format Rules
+[country code][national number]
| Rule | Description |
|---|---|
Start with + | Always begins with the plus sign |
| Country code | 1-3 digits (1 for US/Canada, 44 for UK, etc.) |
| No formatting | No spaces, dashes, parentheses, or dots |
| Digits only | After the +, only digits |
| Maximum length | 15 digits total (including country code) |
Common US Number Transformations
| Raw Input | E.164 Output | Valid? |
|---|---|---|
(555) 123-4567 | +15551234567 | ✅ |
555-123-4567 | +15551234567 | ✅ |
555.123.4567 | +15551234567 | ✅ |
5551234567 | +15551234567 | ✅ |
1-555-123-4567 | +15551234567 | ✅ |
+1 (555) 123-4567 | +15551234567 | ✅ |
15551234567 | +15551234567 | ✅ |
Step-by-Step Conversion
Raw: "(555) 123-4567"
Step 1: "5551234567" ← Remove all non-digit characters
Step 2: "15551234567" ← Add country code (if 10 digits)
Step 3: "+15551234567" ← Add "+" prefix
Step 4: SHA-256 hash ← Hash for Enhanced Conversions
Code Implementation
JavaScript
function toE164(phone, countryCode = '1') {
// Remove all non-digit characters
let digits = phone.replace(/\D/g, '');
// Handle US/Canada numbers
if (countryCode === '1') {
if (digits.length === 10) {
return '+1' + digits;
}
if (digits.length === 11 && digits.startsWith('1')) {
return '+' + digits;
}
}
// For other countries, prepend country code if needed
if (!digits.startsWith(countryCode)) {
return '+' + countryCode + digits;
}
return '+' + digits;
}
Python
import re
def to_e164(phone, country_code='1'):
digits = re.sub(r'\D', '', phone)
if country_code == '1':
if len(digits) == 10:
return f'+1{digits}'
if len(digits) == 11 and digits.startswith('1'):
return f'+{digits}'
return f'+{digits}'
Use the E.164 Formatter tool for quick, manual verification.
International Formats
| Country | Example Raw | E.164 |
|---|---|---|
| US/Canada | (555) 123-4567 | +15551234567 |
| UK | 020 7946 0958 | +442079460958 |
| Australia | (02) 1234 5678 | +61212345678 |
| Germany | 030 123456 | +4930123456 |
The Full Pipeline: Normalize → Format → Hash
Raw phone: "(555) 123-4567"
↓
E.164: "+15551234567"
↓
SHA-256: "d4f5c3b1e72a9f8d..."
↓
Send to platform as hashed_phone_number
All three steps are required. Skip any one and matches will fail.
Common Mistakes
| Mistake | Hash of | Platform’s Hash of | Match? |
|---|---|---|---|
| No E.164 | SHA("5551234567") | SHA("+15551234567") | ❌ |
Missing + | SHA("15551234567") | SHA("+15551234567") | ❌ |
| Kept dashes | SHA("555-123-4567") | SHA("+15551234567") | ❌ |
| Correct | SHA("+15551234567") | SHA("+15551234567") | ✅ |
How TUOCA Handles Phone Numbers
TUOCA automates the entire pipeline:
- Raw input — Accepts any common phone format from your data source
- Country detection — Uses the account’s country setting
- E.164 normalization — Strips non-digits, adds country code and
+ - SHA-256 hashing — Hashes the normalized E.164 number
- Platform routing — Sends the hash to the appropriate API field
You provide raw phone numbers in any format. TUOCA handles the rest.