---
id: "port_number"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["internet"]
langs: ["common"]
quality: 90
url: "http://registry.apicrafter.io/datatype/port_number"
---

# TCP/UDP port number (`port_number`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

16-bit number from 0 to 65535 that identifies an endpoint of a transport protocol such as TCP, UDP or SCTP on a host, for example 80 for HTTP or 443 for HTTPS. RFC 6335 divides the range into system ports 0-1023 and user ports 1024-49151, which IANA assigns to services, and dynamic ports 49152-65535, which are never assigned and serve short-lived client connections. Firewall rules, network flow logs and service inventories store it. Any integer in the range matches the regexp, so the column name is needed to tell a port from another number.

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

## Detection

Regular expression (Python `re`):

```
^(?:6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)$
```

## Examples

- `80` — HTTP
- `443` — HTTPS
- `5432` — PostgreSQL
- `49152` — First dynamic port
- `65536` (invalid example) — Larger than 16 bits
- `-1` (invalid example) — Negative number

## Mappings

- wikidata: `P1641`

## Translations

- ru: Номер порта TCP/UDP: 16-битный номер порта транспортного протокола (0–65535), например 80 для HTTP или 443 для HTTPS.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Port_(computer_networking)>
- wikidata: <https://www.wikidata.org/wiki/Property:P1641>
- doc: <https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml>
- doc: <https://www.rfc-editor.org/rfc/rfc6335>

## Quality

Score 90/100. Missing: detector coverage.

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