🔍 Phone Number Regex Builder (30+ Countries)
Instantly generate validation regex for phone numbers across 30+ countries. Four variants (E.164 / International / Flexible / Mobile-only), multi-country OR combination, live tester and ready-to-paste snippets for JavaScript, PHP, Python, Ruby and Go. Perfect for form validation, log extraction and data cleansing.
100% Free
No signup
Browser-only
5 languages
Dark mode
🔒 About Privacy
- ・All processing runs entirely in your browser (JavaScript)
- ・The phone numbers you enter are never sent to any server
📝 Generated regex
/^.+$/g
🧪 Live tester
✅ 0 matched
❌ 0 unmatched
💻 Code snippets per language
📖 How to Use
-
1
Pick target countriesPick a single country or several to combine into one OR pattern (perfect for international forms). 30+ countries supported.
-
2
Choose a variantPick from E.164 (strict + country-code), International (with separators), Flexible (intl + national) or Mobile-only.
-
3
Copy or testCopy the regex with one click. Paste a list of numbers into the live tester to see matches and failures in real time.
-
4
Paste into your languageReady-to-run snippets for JavaScript, PHP, Python, Ruby, Go and Java are generated automatically with proper escaping.
❓ Frequently Asked Questions
Why not use libphonenumber?
libphonenumber-js is around 70 KB which is overkill if you just want a small regex for form validation. We hand-write rules for 30+ common countries so you can copy-paste with zero dependencies. For full accuracy use libphonenumber.
What is the difference between International and E.164?
E.164 is the ITU-T standard (e.g. +819012345678) — pure digits, max 15, no spaces or punctuation. International format is the human-readable variant with spaces and hyphens (+81 90-1234-5678). Convention: store as E.164, display as International.
Can I combine multiple countries into one regex?
Yes. Tick multiple countries and the tool emits a single OR (|) pattern combining all of them — perfect for global form validation or extracting numbers from mixed logs.
Is the generated regex perfect?
It is a practical approximation aimed at ~80% validity. Numbering plans drift across carriers and years, so for bank-grade or telco-grade validation use libphonenumber or each national telecom regulator. For form inputs and log extraction these patterns are plenty.
🔗 Related Tools
- ・Phone Number Formatter — Convert to International / National / E.164 / tel: URI
- ・Regex Tester — Real-time JavaScript regex testing
- ・Email Validator — RFC 5322, disposable & role-account detection
🐛 Found a bug or issue with this tool?
Free to use, no signup. Even just the steps to reproduce are helpful. Reports go directly to the operator and help us fix issues.
✅
Thanks for your report!
Your report has been delivered to the operator and will be used to improve the tool.