Well-known ports are the TCP and UDP port numbers from 0 to 1023, which the Internet Assigned Numbers Authority (IANA) reserves for widely used standard services such as web servers, name resolution and remote login. Among transport protocols they form the lowest of three port ranges and act as a public convention: a client that wants to reach a web server on a host knows, without asking, that it should try port 80 or 443.
The convention matters because a transport connection is identified by addresses and ports on both ends. The client picks a temporary port for itself, but it must already know the server port. Well-known ports remove that guesswork for the most important services in Networking, and they also influence firewall rules, operating system privileges and traffic classification.
How well-known ports identify services
A port number is a 16-bit field in the TCP and UDP headers, so it ranges from 0 to 65535. Together with the IP address and protocol, it identifies one endpoint of a conversation, and the full five-tuple of source address, source port, destination address, destination port and protocol identifies the conversation itself.
A server application binds to a fixed port and listens. A client sends its first segment or datagram to that port from a temporary ephemeral port chosen by its operating system. Replies travel back with the two ports swapped. Because the server side is predictable and the client side is not, thousands of clients can talk to one service on a single well-known port at the same time.
IANA divides the space into three ranges with distinct purposes, summarized in the following table.
| Range | Numbers | Assignment | Typical use |
|---|---|---|---|
| Well-known (system) ports | 0-1023 | IANA through standards action or review | Core internet services |
| Registered (user) ports | 1024-49151 | IANA on application by vendors | Databases, applications, games |
| Dynamic or private ports | 49152-65535 | Never assigned | Ephemeral client ports |
Common well-known ports and their services
A small set of well-known ports carries most everyday internet traffic, and network engineers recognize them on sight. Most assignments cover both TCP and UDP for the same service, even when the protocol in practice uses only one of them, so the registry stays consistent if the service later adopts the other transport.
| Port | Transport | Service | Notes |
|---|---|---|---|
| 20 and 21 | TCP | FTP data and control | Legacy, sends credentials in clear text |
| 22 | TCP | SSH | Encrypted remote login and file transfer |
| 25 | TCP | SMTP | Mail relay between servers |
| 53 | UDP and TCP | DNS | TCP for large replies and zone transfers |
| 67 and 68 | UDP | DHCP server and client | Uses broadcast during address assignment |
| 80 | TCP | HTTP | Unencrypted web traffic |
| 123 | UDP | NTP | Time synchronization |
| 443 | TCP and UDP | HTTPS | UDP carries HTTP/3 over QUIC |
Port 0 is reserved and is not used on the wire. In programming interfaces, binding to port 0 is a request for the operating system to choose any free ephemeral port, which is why it appears in code but should never appear as a real destination in captured traffic.
Privileges and operating system behavior
On Unix-like systems, ports below 1024 are traditionally privileged ports: only a process with administrative rights can bind to them. The rule dates from a time when a connection from a low port suggested that a trusted administrator controlled the remote service, an assumption that no longer provides real security on modern networks.
Today the restriction mainly prevents an ordinary user from impersonating a system service on a shared machine. Linux allows a specific binary to receive the capability to bind low ports without full root rights, and the threshold itself can be adjusted. Windows does not enforce a privileged range in the same way, so access control there relies on firewall rules and service accounts.
| Platform | Default rule for ports below 1024 | Common workaround |
|---|---|---|
| Linux | Root or a granted capability required | Grant the capability or use a socket-activated service |
| BSD and macOS | Root traditionally required | Run a privileged launcher that hands over the socket |
| Windows | No privileged range enforced | Restrict with firewall rules and service accounts |
| Containers | Depends on runtime settings | Map an internal high port to an external low one |
Well-known ports compared with registered and ephemeral ports
Well-known ports describe what a server offers, while ephemeral ports describe where a client is temporarily reachable. Registered ports sit in between: they also identify services, but those services are application-specific rather than fundamental internet protocols, such as database listeners or remote desktop.
The distinction has practical consequences. A stateful firewall usually opens inbound access for a handful of well-known ports and relies on connection tracking for the ephemeral replies. Port address translation on routers rewrites client ports from the ephemeral range, but it almost never rewrites a well-known destination port, because clients would otherwise fail to find the service.
- A port assignment is a convention, not an enforcement mechanism; any service can listen on any free port.
- The same number can carry different services on TCP and UDP, although IANA prefers to keep them aligned.
- Secure variants often received separate numbers, for example 443 for HTTPS and 993 for IMAP over TLS.
Security implications and common misconceptions
Because well-known ports are public knowledge, they are the first targets of automated scanning. Any host exposed to the internet with port 22 or 3389 open receives login attempts within minutes. Effective defense relies on strong authentication, patching and access control, not on hiding the service.
Moving a service to a non-standard port reduces log noise from opportunistic scans, but it is not protection; a full scan finds it quickly. Similarly, identifying an application by port number alone is unreliable, because tunneling tools and malware deliberately use port 443 to blend in with normal encrypted web traffic.
| Belief | Reality | Better practice |
|---|---|---|
| Port 443 always means HTTPS | Any protocol can run on it | Inspect protocol behavior, not only the port |
| A changed port hides a service | Scanners test all 65535 ports | Rely on authentication and allow lists |
| Low ports are trustworthy | Privilege rules apply only locally | Authenticate peers cryptographically |
| Blocking a port stops an application | Many applications fall back to 443 | Combine port rules with application controls |
Stripped to the essentials
Think of a computer as a large office building with one street address and thousands of numbered doors. The address gets a message to the building, and the door number decides which department receives it.
Well-known ports are the door numbers everyone agreed on in advance. Web pages are served at door 443, name lookups at door 53, secure remote login at door 22. Because the numbers are shared knowledge, any computer in the world can knock on the right door without asking first. The agreement is a convenience, not a lock: anyone can still choose a different door, and attackers know the standard numbers too.
Where it is applied
A small accounting firm moves its client portal to a cloud virtual server. The administrator configures the provider’s security group to allow inbound TCP 443 from anywhere for the portal and TCP 22 only from the office IP address for maintenance, and blocks every other inbound port.
Within an hour of launch, the server log records hundreds of login attempts on port 22 from unknown addresses, all rejected by the firewall rule before reaching SSH. Meanwhile, clients reach the portal by typing only the domain name, because their browsers assume port 443 for HTTPS and never need the number spelled out.
Later, a developer wants to run a test version of the web application. Instead of opening another low port, the test service listens on a registered port above 1024 that is reachable only through the office VPN, so the public attack surface stays at a single port while the team keeps a convenient test environment.