Skip to content
TrySitePrice

URL to domain extractor

Paste a column of URLs and each one's host comes back, deduplicated, counted and exportable as CSV. The parsing is the browser's own URL parser rather than a regular expression, so ports, credentials, query strings and fragments come off correctly instead of nearly correctly.

One per line, or separated by spaces, commas or semicolons. Nothing is sent anywhere — the parsing happens in this tab.

What comes back is the host, which is what the URL standard defines and what the browser's own parser returns. It is not the registrable domain: for blog.example.co.uk you get blog.example.co.uk, not example.co.uk. Working out where the registerable part starts cannot be done by rule — the standard defers to the Public Suffix List, and that list exists precisely because, in its maintainers' words, there is no algorithmic method of finding the level at which a domain may be registered for a given top-level domain. Shipping a copy of that list would make this tool depend on someone else's data file, so instead the host is reported exactly as parsed and the guess is not made.

Questions about extracting domains

01Why do I get blog.example.co.uk instead of example.co.uk?

Because the second one cannot be worked out by rule. The URL standard defines the host, which is what you get here, and for the registrable domain it defers to the Public Suffix List. That list exists because there is no algorithmic method of finding the level at which a domain may be registered for a given top-level domain — co.uk takes two labels, com takes one, and plenty of suffixes are stranger than both. Shipping a copy of that list would make this tool depend on someone else's data file, so the host is reported as parsed and the guess is left unmade.

02What happens to ports, query strings and tracking parameters?

They are separated, not stripped blindly. The host column is the host alone; the scheme, port and path are reported in their own columns so you can see what was there. Query strings and fragments never reach the host, which is exactly the kind of thing a hand-rolled regular expression gets wrong on a URL with an @ in it.

03Why is one of my lines reported as having no host?

Because neither the URL parser nor the fallback could find one. A bare path, a spreadsheet cell that was really a note, or a mangled copy-paste all land there. They are listed rather than silently dropped, because a tool that quietly discards four lines out of two hundred is worse than one that shows you the four.

Related tools