My Tools Garage

Domain Parser

Split any host into subdomain, domain and TLD.

in-browser

How to use

  1. 1 Paste a domain or full URL into the input.
  2. 2 Read the subdomain, domain, TLD and port in the table.
  3. 3 Check the badges for IP, localhost or punycode hosts.
  4. 4 Copy the JSON to use the parts in code.

About Domain Parser

The Domain Parser takes a hostname or a full URL and breaks it down into the parts developers actually need: the subdomain, the registrable domain, the public suffix (TLD), the second-level label and any port.

Paste something like "https://api.shop.example.co.uk:8443/path" and it pulls out api.shop as the subdomain, example.co.uk as the domain, and co.uk as the suffix — getting the multi-label suffix right where a naive split on the last dot would fail.

Knowing the true registrable domain matters for cookies, CORS, certificate scoping, analytics grouping and security checks, and it is trickier than it looks because suffixes like co.uk, com.au and com.br span two labels.

This tool recognises a curated list of those common multi-label suffixes and falls back to the final label otherwise.

It also flags the cases that often trip code up: IPv4 and IPv6 address literals, localhost, and internationalised domains encoded as punycode ("xn--").

Input is forgiving — it accepts bare hosts, full URLs, userinfo and ports — and the structured result is shown both as a labelled table and as copyable JSON.

Everything is parsed locally in your browser, so the hostnames you test never leave your machine, and the tool works offline once loaded.

FAQ

How does it handle suffixes like co.uk?

It recognises a curated set of common multi-label public suffixes, so example.co.uk is parsed as domain "example.co.uk" with TLD "co.uk" rather than just "uk".

Does it work with full URLs and ports?

Yes. You can paste a complete URL with scheme, userinfo, port, path and query, or just a bare host; the parser extracts the hostname and port for you.

What does the punycode flag mean?

It indicates an internationalised domain name encoded with an "xn--" prefix, which represents non-ASCII characters in a way DNS can carry.