Extract Phone Numbers from Text

Paste any text that mixes prose, signatures or scraped HTML, and pull out every phone number it contains. The extractor recognizes North American (xxx) xxx-xxxx, European space-separated forms, compact international +CC..., and the loose styles people type into emails (555.123.4567, +44 20 7946 0958). Output is returned in the shape it was found, so you can normalize later against a library like libphonenumber.

How to extract phone numbers

  1. 1

    Paste the source

    Drop in the text: contact pages, email signatures, CSV exports, chat logs.

  2. 2

    Run the scan

    The regex walks the text looking for digit runs with at least 7 digits plus recognizable separators or country codes.

  3. 3

    Review matches

    The results show one candidate per line, with duplicates removed automatically. Scan the list for false positives (order numbers, dates) and fix the source text if anything slipped through.

  4. 4

    Copy or export

    Grab the clean list as plain text, one number per line, ready for your CRM or dialer.

Phone number shapes it recognizes

Phone numbers are messy because every country has its own convention and people ignore the rules anyway. The extractor targets the practical shapes you see in real text.

Accepted formats (sample)

Format Example Notes
E.164 +14155552671 Gold standard; use this for storage.
International spaced +44 20 7946 0958 UK landline with space-separated groups.
North American NANP (415) 555-2671 Parentheses around area code.
North American dotted 415.555.2671 Common in email signatures.
European local 020 7946 0958 Leading zero trunk prefix.
Mexican 10-digit 55 1234 5678 No country code.

False positives to watch

  • Order and tracking numbers. A 13-digit FedEx tracking number can look like a phone number if written with spaces. Inspect the surrounding context.
  • Dates. 2024 09 15 can match a 7+ digit pattern depending on the regex mode. Filter dates first if your source is date-heavy.
  • Credit card numbers. 16 digit groups in 4xxx xxxx xxxx xxxx form can match. Pre-redact PCI data before extraction.

Tip: normalize before you store

Different inputs for the same real number are the root of CRM deduplication pain. A quick pass with a library that understands country rules (libphonenumber, phonenumbers in Python, laravel-phone in PHP) will convert everything to E.164, the only format you should keep in a database.

Frequently Asked Questions

The extractor returns the raw match; country inference requires a data pack of dialing codes and length rules. If you only care about the +CC prefix, that portion is preserved verbatim in the output.

The extractor returns only the main number; an inline extension such as 555-2671 ext. 123 is not part of the match. For strict E.164 storage, strip everything after ext, x or # into a separate field.

Yes, US toll-free numbers (800, 888, 877, 866, 855, 844, 833) match the normal NANP pattern. UK 0800 and similar local toll-free shapes also come through because they look like regular landlines.

No copy of your input is kept once the extraction response is sent back; processing happens in memory within the request.

Related Tools

Tool available in other languages