Phone Number Extractor – Pull Every Number Out of Any Text
Telephone numbers almost never arrive in a tidy column. They hide inside email threads, scraped directory pages, CRM notes fields, invoices, chat logs and meeting minutes, written in whatever shape the author felt like at the time: (415) 555-0132, +1 415-555-0132, 415.555.0132, +91 98765 43210, 0044 20 7946 0958, Tel: 020 7946 0958 ext. 221. Reading a ten-thousand-word document by eye to find them is slow and unreliable. This phone number extractor scans the whole block in one pass and returns a clean, de-duplicated, validated list.
What E.164 is and why it matters
E.164 is the ITU standard that gives every telephone number on earth one unambiguous written form: a +, the country calling code, then the national significant number, with no spaces, punctuation or trunk prefix, and a maximum of fifteen digits in total. The London number written locally as 020 7946 0958 becomes +442079460958: the leading 0 is a trunk prefix used only for domestic dialling, so it is dropped and replaced by +44. Storing numbers this way is what makes them comparable, de-duplicable and dialable from anywhere, which is why E.164 is the default output format here.
How the extraction pipeline works
The text is normalised first, so full-width 415, Arabic-Indic ٤١٥ and Devanagari digits become ASCII, and non-breaking spaces, en dashes and em dashes become ordinary separators. Each substitution is one character for one character, which keeps every character offset valid — that is what lets the redaction view splice a mask back into your own text without shifting anything. A scanner then collects phone-shaped digit runs, re-cuts any run that accidentally swallowed two adjacent numbers, and parses each candidate: a leading + or 00 selects the country from its calling code, everything else is read using your default region.
Valid, possible and loose
Matching a pattern is not the same as being a real number. Every candidate is checked against the numbering plan of the country it resolved to — the lengths that regulator assigns and the prefixes it has allocated. Valid only keeps numbers that pass both tests. Possible keeps anything with a plausible digit count but an unrecognised prefix, which catches newly issued ranges. Loose keeps any phone-shaped run inside the four-to-twenty digit window that no plan sits outside. Whatever a mode drops is listed in the rejected panel with a plain-English reason, so nothing disappears silently.
\d{3}-\d{3}-\d{4} matches 123-456-7890 — an area code that was never assigned — while missing +44 20 7946 0958 entirely. It also happily matches dates, IP addresses, version strings and card numbers. Validating against real numbering-plan lengths and prefixes is what separates a contact list from a pile of false positives.Classification, extensions and confidence
Each number is labelled mobile, fixed line, toll-free, premium rate, shared cost or unknown, using the prefix blocks each regulator publishes — 7 for UK mobiles, 1[5-7] for German mobiles, 8(00|33|44…) for North American toll-free. Trailing extension markers ext, ext., extn, x and # are captured and carried through, so RFC 3966 output renders as tel:+1-212-555-0143;ext=4471. A deterministic confidence score out of ten sums five points for passing validation, two for an explicit country code, and one each for recognisable formatting, an exact plan length and clean word boundaries.
Shaping the list you actually need
De-duplication works on the normalised value, so (415)555-0132, 415.555.0132 and +1 415 555 0132 collapse into one entry with an occurrence count. Filters narrow the result by country, by line type, by digit window, by confidence threshold or by your own regular expressions — ^\+1555 drops the reserved placeholder range in one line. Sort by document order, ascending, descending or grouped by country, choose your separator, and wrap each entry with a prefix and suffix to paste straight into a SQL IN clause or a JSON array. Exports cover TXT, CSV with the full detail table, JSON and vCard.
Redaction and privacy
Because phone numbers are personally identifiable information, the tool also runs the pipeline in reverse: the redacted view returns your original document with every detected number replaced by a configurable mask, preserving the structure so the file is still readable when shared with a vendor or an auditor. The per-line mapping view pairs each source row with the numbers found on it, ready to join back to a spreadsheet. Every step — scanning, parsing, redacting, exporting — runs locally in your browser, and the share link carries your option settings only, never the text.