URL TLD Calculator
LastnormalizedDNSlabelofactualabsoluteURL using existing WHATWG parser. TLD string not a registry validation, public suffix or registrable domain, IP/empty hosts rejected, no network lookup.
Description
A URL hostname is made of DNS labels separated by dots.
A URL hostname is made of DNS labels separated by dots.1
Its last label is a useful textual component, while registry status and public-suffix boundaries require additional information. The calculation and input requirements are explained below.
When to use URL TLD Calculator
Paste an absolute URL.
How to use URL TLD Calculator and how it works
- Prepare the measurements or independently established model inputs described below, with matching units and observation scope.
- Enter the required fields and run URL TLD Calculator.
- Read the result fields using the formula, output units, signs and ordering explained below.
- Correct any rejected inputs and rerun; interpret the result within the stated model and its assumptions.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| actualAbsoluteUrl | Complete absolute URL; parsed without a base. DNS-host branches reject empty and IP-literal hostnames. | string | Required; other constraints below |
Paste an absolute URL. The WHATWG parser supplies its hostname; an empty hostname, bracketed IPv6 host or host consisting only of digits and dots is rejected. Remove one final dot and return the last dot-separated label. Relative URLs have no base and fail parsing. No DNS, TLD-registry or public-suffix lookup is performed.
lastLabel=hostnameWithoutFinalDot.split('.').last Apply the input ordering, units and branch conditions stated above.
| Output field | Meaning | Value type |
|---|---|---|
| result | Object containing the calculated or selected fields below. | object |
| result.observedLastDnsLabel | Observed Last Dns Label. Interpret its unit, sign, order or availability flag as explained above. | string |
{
"input": {
"actualAbsoluteUrl": "https://sub.example.co.uk/path"
},
"output": {
"result": {
"observedLastDnsLabel": "uk"
}
}
} Limitations and assumptions
The calculation uses the supplied observations and model inputs. It does not collect measurements, select a reference population or coefficient, or establish that the model applies to the actual case. The stated branch conditions and output units remain part of the result.
All fields require explicit values. Unexpected fields, wrong types, nonfinite numbers and sparse arrays are rejected. Alignment, bounds and supported-token rules are explained above; extremely large inputs or nonfinite results can also fail. Input errors differ from successful false comparisons, unavailable-domain flags and empty match lists.
URL parsing and hostname normalization follow the runtime WHATWG URL implementation. The last-label operation still does not verify registration or public-suffix status.2
Alternative or Complementary methods
Use URL Subdomain Calculator for a complementary operation: A subdomain is the hostname prefix above a registrable domain.
Use URL Domain Calculator for a complementary operation: A registrable domain consists of a public suffix and the immediately preceding DNS label.
References
-
URL TLD Calculator — tool.io
-
WHATWG URL Standard — WHATWG
Similar or alternative tools
- URL Subdomain Calculator
A subdomain is the hostname prefix above a registrable domain.
- URL Domain Calculator
A registrable domain consists of a public suffix and the immediately preceding DNS label.