---
id: "tld"
kind: "datatype"
status: "stable"
is_pii: false
categories: ["internet"]
langs: ["common"]
quality: 100
url: "http://registry.apicrafter.io/datatype/tld"
---

# Top level domain (TLD) (`tld`)

Last label of a domain name, the level directly below the DNS root, such as com, org, ru or de. Country-code TLDs have two letters and mostly follow ISO 3166-1 alpha-2 codes; generic TLDs such as com, info or app are longer. Internationalized TLDs are stored in Punycode form starting with xn--, such as xn--p1ai for .рф. IANA lists the delegated TLDs in the Root Zone Database. Data often writes a TLD with a leading dot, which the regexp allows; the regexp checks the form, not whether the TLD is delegated.

- Personal data (PII): no
- Categories: Internet (internet)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^\.?(?:[A-Za-z]{2,63}|[Xx][Nn]--[A-Za-z0-9-]{1,59})$
```

## Examples

- `com` — Generic TLD
- `.org` — Generic TLD written with a leading dot
- `ru` — Country-code TLD of Russia
- `xn--p1ai` — Internationalized country-code TLD .рф in Punycode
- `example.com` (invalid example) — A domain name with two labels
- `c` (invalid example) — One letter; TLDs have at least two characters

## Mappings

- wikidata: `P78`

## Supported by tools

- `greatexpectations`

## Translations

- ru: Домен верхнего уровня (TLD): Последняя метка доменного имени, например com, org или ru; национальные домены состоят из двух букв.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Top-level_domain>
- wikidata: <https://www.wikidata.org/wiki/Q14296>
- doc: <https://www.iana.org/domains/root/db>

## Quality

Score 100/100.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/tld.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/internet/tld.yaml>
