Scrape data in seconds

No proxies needed

Start Free
Web Scraping

How to Extract Phone Numbers From a Website

A six-step method for pulling published phone numbers off websites, turning them into one international format and keeping the list clean.

VK
Varun Kumar
··9 min read
How to Extract Phone Numbers From a Website: Pulldata blog cover

Extracting phone numbers from a website means pulling every published number off a company's pages and saving it in one clean format. The hard part is that the same number can appear five different ways on one site, and some of those "numbers" are really fax lines, order IDs or dates.

Call the right line the first time

Pulldata is a no-code web data platform that collects live, structured data from the public web. Give its contact details extractor a list of company websites and it returns the phone numbers, emails and social links each site publishes; you pay only for results that come back, and it's free to start.

How do you extract phone numbers from a website?

To extract phone numbers from a website, collect the site's contact, about and location pages, pull out every number in the visible text and in tel: links, then convert each one to a single international format. Finish by removing duplicates and labelling what each line is for.

For one site you can do this by hand in a few minutes. For a list of fifty or five hundred websites, a contact extractor does the page visits for you and leaves the cleanup to a spreadsheet or a few lines of code.

A website wireframe marking where phone numbers usually sit: header, tel: button, locations block, contact page and footer

The format step is the one most people skip, and it's the one that matters most. A CRM or dialer can't tell that "(555) 010-0199" and "+1 555 010 0199" are the same line until both are written the same way.

Four differently written versions of one fictional US number all collapsing into the same single E.164 value

What You Need Before You Start

  • A list of company websites, one per row, or a single site to check
  • The country each business operates in, so local numbers can be read correctly
  • A spreadsheet or CRM to hold the results
  • A free Pulldata account if you're checking more than a handful of sites
  • A clear idea of who you'll call and why, since calling rules depend on it

How to Extract Phone Numbers From a Website, Step by Step

These six steps take you from a list of sites to a clean, labelled phone column. Steps 4 and 5 are the same whether you collect the numbers by hand or with a tool.

Step #1: Create a free account

Open the Pulldata sign-up page and choose Continue with Google, or enter an email and a password of at least 8 characters, then click Create account. The page says new accounts get $10 free credit, and no card is required.

Pulldata create your account page with Continue with Google, email and password fields and a Create account button
The public sign-up page at app.pulldata.io/signup.

Step #2: Prepare your list of websites

Put one website per row and remove duplicates before you run anything. Keep the homepage address rather than a deep link, so the extractor can find the contact and location pages itself.

Add a column for the country if your list spans more than one. A number written as "020 7946 0018" only makes sense once you know it's a UK number, and that column decides how step 4 reads it.

A phones sheet where the same digits 020 7946 0018 become +442079460018 with country UK but are not valid with country US
Good habit

Keep the original text of each number in its own column next to the cleaned version. When a formatted number looks wrong later, you can see exactly what the page said without visiting the site again.

If you don't have websites yet, start from a map search. Our guide to the Google Maps email extractor shows how to pull business websites for a category and city first.

Step #3: Run the contact details extractor

In Pulldata, open No-Code Tools and choose Website Contact Details. Paste your list of websites, run it, and wait for the results to come back.

The tool visits each site and returns the public contact details it finds, including phone numbers, emails and social links. Sites that publish nothing come back empty, and empty results aren't billed.

Developers can send the same list through the contact details API and get JSON back. Our guide on how to extract emails from a website walks through the same tool with a focus on the email column.

Step #4: Convert every number to one format

Rewrite each number in E.164, the international format that starts with a plus sign and the country code. Twilio's summary of the ITU standard puts the limit at 15 digits, with no spaces, dashes or brackets (Twilio E.164 glossary).

The number +442079460018 in a text-formatted cell, with brackets marking the plus sign, country code 44 and national number

The table shows how common page styles map to E.164. All the numbers are fictional examples.

Written on the page

Country

E.164 version

(555) 010-0199

US

+15550100199

555.010.0199 ext. 24

US

+15550100199, extension kept in its own column

020 7946 0018

UK

+442079460018

+44 (0)20 7946 0018

UK

+442079460018, the (0) is dropped

1-800-555-0123

US

+18005550123

The "(0)" case trips up a lot of cleanup formulas. The zero is only dialled inside the country, so it has to go once the country code is in front.

The bracketed (0) in +44 (0)20 7946 0018 struck out as a zero dialled only at home, leaving the clean number +442079460018

Step #5: Remove duplicates and label each line

Once every number is in the same format, duplicates are easy to spot. Sort by company, then by number, and keep one row per number with the page it came from.

Then add a short label: main line, sales, support, a branch location, or fax. The page usually tells you, since a number sits next to words like "Fax", "Orders" or a street address.

A contact page lists Fax, Orders and Head office numbers; Orders next to one number becomes its sales label in a CRM row

Extensions need their own column too. A number like "555.010.0199 ext. 24" reaches the same switchboard as the main line, so storing the extension separately keeps the main number deduplicated and still tells the caller which desk to ask for.

Worth knowing

A footer number appears on every page of a site, so a page-by-page extractor can return it dozens of times. Deduplicating on the E.164 value, not the raw text, collapses all of those copies into one row.

Step #6: Check before anyone dials

Spot-check a sample against the live site and look for numbers that don't fit. A 15-digit string with no country code is often an order or tracking number, not a phone.

A page footer with a phone number, a date, an order ID and a tracking code, where only the phone reaches the extracted column

Mark mobile numbers separately from landlines where you can tell them apart. In the US, calling or texting a mobile with automated tools has its own consent rules, covered further down.

A business desk phone marked relevant call with care, beside a mobile phone that needs written consent for automated calls

Then export the cleaned list to your spreadsheet or CRM. Costs for the run are per result returned, and current rates are on the Pulldata pricing page.

Variations: By Hand, With Code, or for Many Sites

The steps hold for every method. What changes is who does the page visits and where the cleanup happens.

One website, by hand

Check the header, footer, contact page and any locations page. Then open the page source and search for "tel:", because click-to-call buttons often hold the number in a link the page shows only as "Call us".

The tel: link format is defined in RFC 3966, and its target is usually already in international form. When the visible text and the tel: link disagree, the link is the one the site's own button dials.

A web page with a Call us button beside its page source, where the link behind the button reads tel:+442079460018

Many websites, no code

For a list of companies, run the whole list through the contact details tool in one go, then do steps 4 and 5 in a spreadsheet. Sorting by company first makes the duplicate check fast.

If you also want each company's inbox, the same run returns emails, so you don't need a second job. Our explainer on what email scraping is covers how those addresses are found.

For lists of more than a few hundred sites, split the run by country. Each batch then shares one default country for the format step, which removes the most common cause of badly read local numbers.

Your own Python script

Developers who scrape pages themselves can let a library handle the format step. Google's libphonenumber parses, formats and validates international numbers, and it has a Python port called phonenumbers (libphonenumber on GitHub).

python
import phonenumbers

raw = "+44 (0)20 7946 0018"
num = phonenumbers.parse(raw, "GB")
print(phonenumbers.format_number(num, phonenumbers.PhoneNumberFormat.E164))
# +442079460018

The second argument is the default country, used when a number has no plus sign. That's why the country column from step 2 matters even in code.

Tip

Run a library's matcher over the page text instead of writing your own regular expression. Hand-written patterns catch dates and order IDs and miss extensions, while a matcher that knows each country's numbering rules skips most of that noise.

Through an AI agent

An AI agent in Claude or Cursor can run the contact details lookup for a list of sites over MCP and return a phone table in the chat. The setup is in the Pulldata MCP docs.

Ask the agent to keep the source page next to each number. It makes the label step in step 5 much quicker, and it lets you check any number that looks wrong.

Troubleshooting: Missing or Messy Numbers

When phone results look wrong, the cause is usually one of these.

  • Number shown as an image: text extractors can't read it. Copy it by hand from the page.
  • Number loaded by a script: some sites insert it after the page loads, so a plain request misses it. Use a tool that renders pages like a browser.
  • Click-to-reveal numbers: the full number appears only after a click. Check the tel: link in the page source.
  • Tracking numbers: some sites swap in a different number per visitor to measure ad clicks. Prefer the number on the contact page over one in a banner.
  • Wrong country: a local number was read with the wrong default country. Fix the country column and reformat.
  • Too many numbers per site: a chain lists every branch. Keep the branch address with each number so you call the right location.
Visits from an ad, search and direct each show a different banner number, while the contact page main line stays fixed

Can you call numbers you extracted from a website?

You can usually call a published business line about something relevant to that business, but automated calls and texts have strict rules. In the US the Telephone Consumer Protection Act applies, and in the EU a number tied to a named person is personal data under the GDPR.

The FCC's consumer guide says telemarketing robocalls and robotexts to mobile numbers need the recipient's prior express written consent (FCC consumer guide). Under the General Data Protection Regulation, you need a lawful basis to use a named person's direct line, and national rules on marketing calls differ across EU countries.

Keep in mind

A main switchboard number is published so customers and suppliers can call it. A mobile number on a sole trader's site is often their personal phone too, so treat it with more care than a company's main line.

For named contacts at the same companies, our guide on how to find an email address by name covers the email side, which is often the gentler first contact.

Extract Phone Numbers From Website FAQ

Can I extract phone numbers from a website for free?

Yes, by hand: check the contact page and search the page source for "tel:". For a list of sites, Pulldata's $10 starting balance covers a free test run.

How do I extract phone numbers from a website into Excel?

Run the sites through a contact extractor, export the results as a CSV, and open it in Excel. Format the phone column as text so leading plus signs and zeros aren't stripped.

Why does Excel change my phone numbers?

Excel treats a number with a plus sign as a formula and long digit strings as numbers, dropping the plus and leading zeros. Import the column as text.

Can a scraper tell mobile numbers from landlines?

Sometimes. A library like libphonenumber can report the likely number type for many countries, but where mobiles and landlines share number ranges, it can't be sure.

Collecting published business numbers is generally allowed, but how you use them is regulated. Automated calls and texts face the strictest rules.

Disclaimer: This article is general information only, not legal advice. Calling, texting and privacy rules differ by country and state, so check the laws that apply to you and the people you contact before using any number.

Share this article
V

Written by

Varun Kumar

Varun Kumar is co-founder of Pulldata, where he leads the data infrastructure behind its products. A backend engineer by training, he has spent 8 years building large-scale scraping and automation systems, and now oversees how Pulldata extracts, validates and delivers web data at scale.

FAQ

Frequently asked questions

Everything you need to know about extracting web data, proxy management, and zero-cost failed rows.

Explore Documentation

Where can I extract public web data from with PullData?

PullData provides ready-to-use scrapers for Google Maps, Google Search SERP, directory listings, company websites, and social platforms, with built-in proxy rotation and automated anti-bot bypass.

Do I need coding skills or proxies to collect data?

No coding or proxy management is required. Everything runs in the cloud. You only configure your target keywords or URLs, and PullData handles rate limits, proxy rotation, and CAPTCHAs automatically.

In what file formats can I download extracted data?

You can export datasets instantly into CSV, Microsoft Excel (XLSX), or JSON. You can also connect directly via Webhook or REST API to sync rows with your database or CRM.

What happens if a scraping job encounters failed rows?

PullData only charges for successfully scraped and verified rows. Any failed row or timeout costs 0 credits, ensuring you only pay for actionable data.

Get Started Free

Ready to extract web data?

No code, no proxies, no engineering overhead. Start with $10 free credits and collect clean public data instantly.

Instant Cloud Setup $10 Free Credits Included Failed Rows Cost $0
Weekly Digest

Get weekly data-extraction insights

One short email a week — new guides, scraper tips, and the occasional teardown. No spam, unsubscribe anytime.