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.
https://support.google.com/analytics/answer/10089681?hl=engoogle.comHow to Extract Root Domain from Website URL
Parse the website URL
Identify the hostname portion of the URL. For https://blog.example.com/page, the hostname is blog.example.com.
Remove protocol and page path
Drop http://, https://, folders, slugs, filenames, query strings, and fragments.
Normalize www and subdomains
Remove www and optional subdomains when you need the website-level root domain.
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 URL | Extracted Root Domain |
|---|---|
https://blog.hubspot.com/marketing/email-list-building | hubspot.com |
https://www.shopify.com/blog/ecommerce-seo | shopify.com |
https://developer.mozilla.org/en-US/docs/Web/API/URL | mozilla.org |
https://www.gov.uk/guidance/import-controls | gov.uk |
https://support.google.com/webmasters/answer/7451184 | google.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.