Domain Extractor
Turn a list of URLs into hostnames or registrable root domains — using the Public Suffix List, so example.co.in comes back as example.co.in and not as co.in.
- You provide
- A list of URLs, or mixed text containing them.
- You receive
- The hostname, or the registrable root domain, for each entry — with counts and an option to keep only unique values.
- Use it when
- Use it to see which sites a link list points at, or to group thousands of URLs by domain.
The root domain uses the Public Suffix List, so co.in, co.uk and com.au are handled correctly — not by taking the last two labels.
Your list is parsed in this browser tab against a bundled copy of the Public Suffix List. Nothing is uploaded.
What this tool cannot do
- IP addresses have no registrable domain. They are labelled as IP addresses rather than being forced into a domain column.
- localhost and private-use zones are labelled too, for the same reason.
- An unknown top-level domain is reported as unrecognised. The Public Suffix List algorithm would otherwise accept anything.
- Internationalised hostnames come out in their punycode (xn--) form, which is what the address actually resolves as.
- Email addresses are refused unless you turn that option on, so a stray address in a URL list does not quietly become a domain.
Why "the last two labels" is wrong
The most common way to get a root domain is to split on dots and keep the last two. It works for example.com. It fails for an enormous part of the internet:
| Input | Last two labels | Correct registrable domain |
|---|---|---|
| shop.example.co.in | co.in ❌ | example.co.in ✓ |
| www.bbc.co.uk | co.uk ❌ | bbc.co.uk ✓ |
| deep.sub.example.com.au | com.au ❌ | example.com.au ✓ |
| news.example.com | example.com ✓ | example.com ✓ |
The reason is that co.in, co.uk and com.au are public suffixes: parts of the namespace under which anyone can register. The Public Suffix List is the maintained record of which suffixes those are, and this tool uses a bundled copy of it.
Hostname or root domain?
Hostname keeps the whole thing: shop.example.co.in. Use it when the subdomain matters — separating a blog from a shop, for example.
Registrable root domain collapses to one registrable unit: example.co.in. Use it when you want to know which organisations a link list points at, regardless of which subdomain.
There is a third case worth knowing about. Hosting suffixes such as github.io and vercel.app are on the list's private section. With the default setting, me.github.io has a root domain of github.io — technically correct, and usually not what you mean. The "treat hosting suffixes as public suffixes" option flips that so each project site becomes its own root domain.
Everything that is not a domain
Real URL lists contain things that are not domains, and each gets an explicit classification rather than being silently dropped:
- IP addresses —
192.168.1.10has no registrable domain, and is labelled as an IP. - localhost — likewise.
- Unknown top-level domains —
example.notarealtldis reported as unrecognised. This matters more than it sounds: the Public Suffix List algorithm falls back to accepting any final label, so without this check every typo would become a valid domain. - Email addresses — refused unless you enable them, then the part after the @ is used.
- Ports — kept out of the output unless you ask for them.
"Show skipped lines" lists every one of these with the reason.
Frequently asked questions
What is the Public Suffix List?
A maintained list of the domain suffixes under which the public can register names — .com, .co.uk, .co.in, and thousands more, including hosting suffixes such as github.io. It is the only reliable way to decide where a registrable domain begins, and it is why browsers can stop one site setting cookies for another.
Why did an internationalised domain change?
Hostnames with non-ASCII characters are converted to their punycode form — bücher.example becomes xn--bcher-kva.example. That is the form the address actually resolves as, and it is what you want in a list you are going to process further.
Can I count how many links point at each domain?
Yes — that is the default. Unique values are shown with an occurrences column, and sorting by that column gives you a ranking straight away.
Related tools
- You provide:
- A list of URLs, one per line.
- You receive:
- The de-duplicated list, plus a preview of exactly which entries were removed and which entry they matched.
- Use it when:
- Use it after combining exports from several sources, or before importing a list somewhere that rejects duplicates.
- You provide:
- A list of URLs, one per line.
- You receive:
- The cleaned list, with a before/after view of every address that changed.
- Use it when:
- Use it before sharing links, publishing a reference list, or importing URLs that would otherwise carry campaign parameters.
- You provide:
- Pasted text, or a local TXT, CSV, JSON or Markdown file.
- You receive:
- Every web address found, with its line number, in the order it appeared.
- Use it when:
- Use it when the links are sitting inside prose, an email, a chat log, a notes file or a data export.
- You provide:
- A public sitemap address, an uploaded .xml or .xml.gz file, or pasted XML.
- You receive:
- Page URLs separated from child sitemap files, with lastmod when the file provides it, ready to copy or export.
- Use it when:
- Use it before a migration, for a content inventory, or any time you need a site’s declared URL list as a spreadsheet.
Guides for this tool
- How to Extract URLs with RegexPatterns that work, measured failures from the ones that do not, and a clear account of why no regular expression can fully validate a URL.
- How to Extract URLs from Text Using PythonA working extractor in about thirty lines — find candidates, trim punctuation without breaking balanced brackets, then validate with urlparse rather than trusting the pattern.
- How to Extract URLs and Domains from Text in Google SheetsFormulas that pull addresses out of a text column, get the hostname, and — importantly — why the popular "root domain" formula is wrong for half the internet.
- How to Extract URLs from a Sitemap and Export ThemPaste, upload or fetch an XML sitemap and turn it into a URL list you can open in Excel — keeping page URLs separate from child sitemap files, and knowing when the list is incomplete.