E.164 is the ITU standard for international telephone numbers: a plus sign, the country code and the national number, with no spaces or punctuation and at most 15 digits. Every serious SMS gateway, CPaaS API and messaging app expects it. Storing numbers any other way guarantees duplicates, failed sends and messy analytics.
The conversion rule
For both the Philippines and Vietnam: strip everything except digits and a leading plus, drop the domestic trunk prefix 0, then prepend the country code.
| Input | E.164 |
|---|---|
| 0917 123 4567 | +639171234567 |
| (0917) 123-4567 | +639171234567 |
| 63 917 123 4567 | +639171234567 |
| 9171234567 | +639171234567 |
| 093 312 3456 | +84933123456 |
| 0084 93 312 3456 | +84933123456 |
Validation patterns
These regular expressions validate structure after normalising to E.164. They will not tell you whether a number is in service.
// Philippines mobile: +63 then 9 or 8, then 9 more digits
/^\+63[89]\d{9}$/
// Vietnam mobile (post-2018): +84 then 3,5,7,8 or 9, then 8 digits
/^\+84[35789]\d{8}$/
// Taiwan mobile: +886 9 then 8 digits
/^\+8869\d{8}$/
A minimal normaliser (JavaScript)
function toE164(raw, defaultCC = '63') {
let s = String(raw).trim().replace(/[^\d+]/g, '');
if (s.startsWith('00')) s = '+' + s.slice(2);
if (s.startsWith('+')) return s;
if (s.startsWith('0')) return '+' + defaultCC + s.slice(1);
if (defaultCC === '63' && /^9\d{9}$/.test(s)) return '+63' + s;
return '+' + s; // assume it already includes a country code
}
Edge cases that bite
- Ambiguous 10-digit 09 numbers. 0933123456 is a valid Vietnamese mobile and a valid Taiwanese mobile. Always capture the country explicitly in your form (a country selector defaulting to the user's locale) rather than guessing.
- Legacy Vietnamese numbers. 11-digit numbers like 0168… were retired in 2018. Map them using the official conversion table or ask the user to update.
- Portability. Don't store “network” as a permanent attribute derived from the prefix. If routing cost matters, run a lookup at send time.
- Display vs storage. Store E.164; format for display (+63 917 123 4567) at render time.
- Leading-zero loss. Spreadsheets strip leading zeros. Store numbers as text or in E.164 to avoid it.
Need to clean a list right now? Use the bulk sorter to normalise and export CSV, or the format converter for single numbers.