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.

RangeNumbersWhat it is for
Well-known ports0 to 1023Reserved 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 ports1024 to 49151Assigned 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 ports49152 to 65535Never 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

These are the ports that come up in day-to-day work, picked by hand rather than by taking the lowest numbers. The very lowest numbers belong to Echo (7), Discard (9), Daytime (13), QOTD (17) and Chargen (19), which are protocols from the early ARPANET era that are enabled essentially nowhere today. How the selection is made is described on the about page.

Commonly used TCP and UDP ports, sorted by port number
PortServiceProtocolEncrypted by default
20FTP-DATATCPNo
21FTPTCPNo
22SSHTCPYes
23TelnetTCPNo
25SMTPTCPNo
53DNSTCP/UDPNo
67DHCPUDPNo
68DHCP clientUDPNo
80HTTPTCPNo
110POP3TCPNo
123NTPUDPNo
143IMAPTCPNo
161SNMPUDPNo
389LDAPTCP/UDPNo
443HTTPSTCP/UDPYes
445SMBTCPNo
465SMTPSTCPYes
587SubmissionTCPYes
636LDAPSTCPYes
993IMAPSTCPYes
995POP3STCPYes
1433MSSQLTCPNo
3306MySQLTCPNo
3389RDPTCPNo
5432PostgreSQLTCPNo
5900VNCTCPNo
6379RedisTCPNo
8080HTTP-altTCPNo
8443HTTPS-altTCPYes
27017MongoDBTCPNo

The full list of 153 ports, including the legacy ones, is on the port numbers reference. Every entry in the JSON API carries a common flag so you can filter the same way in your own code.

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.