Skip to content

Extract Domain from URL

Paste URLs, one per line, and get the domain, hostname, subdomain or suffix of each in bulk.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Extract Domain from URL?

A URL contains several "domain" notions: the full hostname (blog.example.co.uk), the registrable domain you can buy (example.co.uk), the subdomain (blog) and the public suffix or TLD (co.uk). Marketers, SEO specialists and developers often need one of them for a long list of links.

For each line the tool parses the URL (a bare hostname works too), then returns the part you select. A table shows all four parts side by side, and you can keep only unique results, sort them, and display internationalized names in Unicode. IP addresses are returned as they are.

How does it work?

  1. Paste URLs or hostnames, one per line. Ports, paths, query strings and credentials are ignored.
  2. Choose what to extract: registrable domain, full hostname, subdomain or TLD.
  3. Tick unique and sort if you want a de-duplicated list, and Unicode to show internationalized names readably.
  4. Copy the result list, or read the table for the details of each URL.

Common use cases

  • Building a list of referring domains from a backlink export.
  • Grouping a bookmark or log file by site.
  • Preparing an allow-list or block-list of domains from full URLs.
  • Counting how many distinct sites appear in a batch of links.

Examples

Try this input in the tool above:

Input
https://blog.example.co.uk/post/1
https://www.example.com:8080/a?b=c
http://shop.example.com.au
https://münchen.example.de/
https://[2001:db8::1]:8443/x
Output
example.co.uk
example.com
example.com.au
example.de
[2001:db8::1]

Privacy

Extract Domain from URL runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

The registrable domain is a heuristic based on a small built-in list of common multi-part suffixes (co.uk, com.au, co.jp, com.br…), not the full Public Suffix List, so rare suffixes and private ones such as github.io are not recognized.

Frequently asked questions

Why is example.co.uk not reduced to co.uk?

"co.uk" is a public suffix, so the registrable domain keeps one more label. The tool recognizes a set of common two-part suffixes for this reason.

What happens with an IP address or localhost?

IPv4 and IPv6 hosts are returned as they are, with no subdomain or TLD, and a single-label host such as localhost is treated as its own domain.

How are internationalized domains displayed?

By default in punycode (xn--…), which is how URLs carry them. Tick the Unicode option to see the readable form, such as münchen.

More tools in Developer Tools →