Extract Root Domain from Website URL

If you have a website URL like https://www.blog.example.com/articles/page?ref=twitter, the root domain is example.com. This guide shows how to extract root domain from website URL data for SEO reports, backlink analysis, prospecting, and spreadsheet cleanup.

Root Domain vs Full Website URL

A website URL points to a specific page or resource. A root domain identifies the main registered website. Extracting the root domain removes everything that is not needed for website-level grouping.

Website URL
https://support.google.com/analytics/answer/10089681?hl=en
Root domain
google.com

How to Extract Root Domain from Website URL

1

Parse the website URL

Identify the hostname portion of the URL. For https://blog.example.com/page, the hostname is blog.example.com.

2

Remove protocol and page path

Drop http://, https://, folders, slugs, filenames, query strings, and fragments.

3

Normalize www and subdomains

Remove www and optional subdomains when you need the website-level root domain.

4

Keep the registered domain and suffix

Return the domain plus public suffix, such as example.com, example.co.uk, or mysite.co.jp.

Website URL to Root Domain Examples

Website URLExtracted Root Domain
https://blog.hubspot.com/marketing/email-list-buildinghubspot.com
https://www.shopify.com/blog/ecommerce-seoshopify.com
https://developer.mozilla.org/en-US/docs/Web/API/URLmozilla.org
https://www.gov.uk/guidance/import-controlsgov.uk
https://support.google.com/webmasters/answer/7451184google.com

Common Use Cases

SEO audits

Group crawled pages by root domain and compare referring domains.

Backlink cleanup

Turn backlink URLs into unique referring websites.

Competitor research

Convert search results into a clean list of competitor domains.

Lead enrichment

Standardize website fields before matching company records.

Try the Free Root Domain Extractor

Paste one website URL or a bulk list below. The tool extracts root domains and lets you copy or export the results.

Frequently Asked Questions

Is the root domain the same as the homepage URL?

No. A homepage URL is usually https://example.com/. The root domain is just example.com.

Should I keep subdomains?

Keep subdomains when you need host-level analysis. Remove them when you need website-level deduplication or SEO referring domain counts.

Related Guides