TCP/UDP port numbers: common ports and security checks

Contents
When you're setting up a firewall or doing port forwarding, a bare number often tells you nothing about what the port is for. Whether 3306 is MySQL or PostgreSQL, or why 8080 gets used alongside 80, is not something you memorize — it's something you look up.
A port, the basic unit of identification in network communication, has its role officially pre-assigned by the Internet Assigned Numbers Authority (IANA). This article covers how the port number ranges are divided and the roles of the main TCP/UDP ports you actually run into in development and operations.
Port numbers are divided into three ranges
When a computer communicates over a network, it needs not only an IP address (which device) but also a port number that identifies which process on that device receives the data. The port range from 0 to 65535 is split into the three sections below by purpose.
| Range | Span | Purpose |
|---|---|---|
| Well-Known Ports | 0 ~ 1023 | Permanently reserved by IANA for standard protocols. Used by core system daemons such as web and mail servers |
| Registered Ports | 1024 ~ 49151 | Registered with IANA by companies and software vendors for their own services |
| Dynamic / Private Ports | 49152 ~ 65535 | Handed out temporarily by the operating system when a client connects to a server |
Ports you meet often in development and operations
Below are the roles of the standard ports that come up constantly in practice.
- 80 (TCP · HTTP): The default port for ordinary, unencrypted web browsing.
- 443 (TCP · HTTPS): The port for secure web traffic encrypted with TLS/SSL.
- 22 (TCP · SSH): The port used for remote command-line login to Linux and Unix servers.
- 3306 (TCP · MySQL): The default communication port for the MySQL database.
- 8080 (TCP · alternate HTTP): A common alternate port used when running a local dev server (Tomcat, Spring Boot, and so on) to avoid colliding with port 80.
How to check without a tool
IANA publishes the official assignment list as the "Service Name and Transport Protocol Port Number Registry," free for anyone to browse. On macOS or Linux, you can also type cat /etc/services in the terminal to see the main port-to-service mapping stored locally.
The catch is that this means searching English source documents or scrolling through a long file by eye, which is a hassle when you want a port's purpose and its security caveats at the same time.
Check it with our free tool. Search by port number or service name (for example, ssh or mysql) and the protocol, purpose, and security recommendations for common ports show up right away in a table.
Search by port number or service name to see the standard use and security notes right away.

Plaintext protocols and their encrypted alternatives
Some older protocols send data with no encryption at all. When a replacement port does the same job with encryption, use that one whenever you can.
| Plaintext protocol | Port | Encrypted alternative |
|---|---|---|
| FTP | 21 | SFTP / FTPS |
| Telnet | 23 | SSH (22) |
| HTTP | 80 | HTTPS (443) |
| POP3 | 110 | POP3S (995) |
| IMAP | 143 | IMAPS (993) |
| LDAP | 389 | LDAPS (636) |
Beyond these, some frequently used service ports need caution in their default configuration itself. SMB (445) has had known vulnerabilities discovered again and again, so it's safest not to expose it directly to the internet, and Redis (6379) ships with no authentication by default, so you need to check the requirepass setting.
What to check when running firewalls and ports
Widely known ports like MySQL's 3306 and SSH's 22 are easy targets for automated scanning and brute-force attempts. Moving a port to a different registered range can reduce how often automated scans hit it, but that alone does not give you real security. With SSH, key-based authentication instead of passwords and blocking root login are the more substantive defenses.
A port left open that you don't use is an attack surface in itself. On macOS and Linux you can run sudo lsof -i -P -n | grep LISTEN to see which ports and processes are currently open, and you can test whether a specific port is open with nc -zv host port.
Summary
- Port ranges split into three sections: Well-Known (0 ~ 1023), Registered (1024 ~ 49151), and Dynamic/Private (49152 ~ 65535).
- 80, 443, 22, 3306, 8080, and others are standard ports you'll run into regularly in practice.
- For protocols that send plaintext, like FTP, Telnet, HTTP, POP3, IMAP, and LDAP, check the encrypted alternative first if one exists.
- You can inspect open ports yourself with standard commands like
lsofandnc; when you want to look up a port's purpose and security recommendations fast, a lookup tool is easier.
Search by port number or service name to see the standard use and security notes right away.
Frequently asked questions
Why does port 8080 exist separately?
Port 80 often requires system privileges and may collide with a web server that's already running. So when you spin up a local dev server or an application server like Tomcat, the convention is to use 8080 instead.
Do I have to change SSH's default port 22?
Changing the port can reduce how often automated scans hit you, but it isn't a security measure by itself. Using key-based authentication and blocking remote root logins are the more substantive defenses.
How do I check whether a specific port is open?
To see open ports on your local machine, use sudo lsof -i -P -n | grep LISTEN (macOS and Linux). To check whether a specific port on a specific destination server accepts connections, test it with nc -zv host port.
What's the difference between well-known ports and registered ports?
Ports 0 ~ 1023 are well-known ports, permanently reserved by IANA for core system services like web and mail. Ports 1024 ~ 49151 are registered ports, used by specific applications (databases, for example) that have registered them with IANA.
This article was adapted from our Korean original. Read the Korean original