Port ranges and well-known ports
A port number is a 16-bit label, from 0 to 65535, that directs traffic to a specific service on a machine. The whole space is split into three ranges, each with a different purpose.
| Range | Numbers | What it is for |
|---|---|---|
| Well-known ports | 0 to 1023 | Reserved for core services and assigned by IANA. Binding to them usually requires administrator or root privileges. HTTP (80), HTTPS (443), SSH (22), and DNS (53) all live here. |
| Registered ports | 1024 to 49151 | Assigned by IANA to specific applications on request, but not privileged. Databases like MySQL (3306) and PostgreSQL (5432) and app servers like Tomcat (8080) use this range. |
| Dynamic / ephemeral ports | 49152 to 65535 | Never permanently assigned. The operating system picks a free port from this range as the source port for each outbound connection, then releases it when the connection closes. |
How a port number is used
An IP address gets traffic to the right host; a port number gets it to the right program on that host. When your browser opens a page, it connects to the server IP on port 443 and picks a random ephemeral port for itself as the return address. The combination of source IP, source port, destination IP, and destination port uniquely identifies the connection.
That is why the same server can run a website on port 443, SSH on port 22, and a database on port 5432 at once: each service listens on its own port. For the details of any specific port, see the port numbers reference.
Common ports at a glance
Frequently asked questions
What is a port number?
A port number is a 16-bit identifier from 0 to 65535 that, together with an IP address, directs traffic to a specific service on a host. Port 443 reaches the HTTPS service; port 22 reaches SSH.
What are well-known ports?
Well-known ports are 0 to 1023. IANA reserves them for core services, and binding to them usually needs administrator or root privileges. HTTP (80), HTTPS (443), and DNS (53) live here.
What are ephemeral ports?
Ephemeral ports (49152 to 65535) are chosen automatically by the operating system as the source port for outbound connections, then released when the connection closes. They are never permanently assigned.
How many ports are there?
There are 65,536 ports per protocol (0 to 65535), for both TCP and UDP. That is because the port field in the TCP and UDP headers is 16 bits wide.