Network security

What Is a Port Number? How Ports Work, Ranges and Common Ports

Every connection your computer makes carries a port number. Here is what those numbers mean, which ones matter, and how to check which ports are open on your machine.

Cysoro Security TeamPublished · 8 min read
192.168.1.10: 443IP address + port = socket 80HTTP443HTTPS22SSH 53DNS25SMTP3389RDP NETWORK SECURITY What is aport number? 0 to 65535 — and what each range means.
Quick answer

A port number is a 16-bit number, from 0 to 65535, that identifies a specific service or process on a device. The IP address gets a packet to the right computer, and the port number gets it to the right program on that computer. Common examples are port 443 for HTTPS web traffic, port 80 for HTTP, port 53 for DNS and port 22 for SSH.

Key takeaways

  • A port number is a 16-bit value from 0 to 65535 that directs traffic to the right program on a device.
  • IANA divides ports into system ports (0-1023), user ports (1024-49151) and dynamic ports (49152-65535).
  • TCP and UDP keep separate port spaces, so a complete port reference always names the protocol too.

You have seen them hiding in addresses: the :443 after a website, the :22 in a server login, the :3306 in a database error. Those numbers are port numbers, and they are the reason one computer can run a browser, an email client, a video call and a game at the same time without mixing up the traffic.

What is a port number?

A port number is a 16-bit number, from 0 to 65535, that identifies a specific service or process on a device. The IP address gets a packet to the right computer, and the port number gets it to the right program on that computer.

A port is a logical construct, not a physical socket. Your computer has no physical port 443; the number is simply a label carried in every TCP and UDP packet header. When a packet arrives, the operating system reads the port number and hands the data to the program listening on that port.

The same port number can mean different things for TCP and UDP, because the two protocols keep separate port spaces. TCP port 53 and UDP port 53 are technically different ports, even though DNS uses both. A complete port reference always names the protocol as well as the number.

How do port numbers work?

Every network connection has two ends, and each end is a socket: an IP address, a transport protocol and a port number together. Your browser picks a temporary source port, the server listens on a fixed destination port, and the pair of sockets identifies the conversation.

From address to program: how a socket works Your browsersource port 52341(ephemeral) InternetIP: 93.184.216.34port: 443 Webserverlistens on 443 IP address = which computer  ·  Port number = which program The socket (IP + protocol + port) identifies each end of the connection.
An IP address finds the computer; the port number finds the program. Illustration by Cysoro.

Here is a typical example. You open a website, and your browser picks a temporary source port, say 52341. It sends a request to the server's IP address on destination port 443, where the web server listens for HTTPS. The server replies to your IP address on port 52341, and your operating system delivers the reply to the right browser tab.

Servers listen on well-known ports so clients know where to find them. You never type the port for a normal website because browsers assume 80 for HTTP and 443 for HTTPS. When a service runs on a non-standard port, the port must appear in the address, such as example.com:8443.

Ports belong to layer 4, the transport layer, of the OSI model. The two transport protocols that use them are TCP, which guarantees reliable, in-order delivery, and UDP, which sends packets without that guarantee. You can check your own public address with our free what-is-my-IP tool.

What are the three port ranges?

The Internet Assigned Numbers Authority (IANA) divides the port space into three ranges, formalized in RFC 6335: system ports from 0 to 1023, user ports from 1024 to 49151, and dynamic ports from 49152 to 65535.

The three IANA port ranges (RFC 6335) System0–1023Core services: HTTP, HTTPS, DNS, SSH User1024–49151Registered apps: databases, games, VPNs Dynamic49152–65535Temporary client ports Port 0 is reserved and cannot be used. Dynamic ports are never assigned.
The three IANA port ranges, defined in RFC 6335. Illustration by Cysoro.
RangePortsWho uses it
System (well-known)0–1023Core internet services such as HTTP, HTTPS, DNS, SSH and SMTP. On most systems only privileged processes can listen on these ports.
User (registered)1024–49151Applications registered with IANA, such as databases, games and remote-access tools. Anyone can also use these informally, so overlaps are common.
Dynamic (private)49152–65535Temporary ports your own device picks for the outgoing side of a connection. No fixed service assignments; seeing these in logs is normal.

System ports are assigned through IETF review or IESG approval, and user ports through IETF review, IESG approval or expert review. Dynamic ports are never assigned. IANA's registry was last updated on 2026-11-19, and it is the authoritative list of which service each port belongs to.

Port 0 is reserved and cannot be used for a real connection. On Unix-like systems, binding to a system port requires superuser privileges, because these ports are considered critical to the operation of IP networks.

What are the most common port numbers?

You only need to recognize a dozen or so ports to read firewall logs, error messages and server settings with confidence. These are the ones that appear most often.

PortProtocolServiceWhat it does
20 / 21TCPFTPFile transfer; 21 is control, 20 is data
22TCPSSH / SFTPEncrypted remote login and file transfer
23TCPTelnetRemote login, unencrypted — avoid it
25TCPSMTPEmail delivery between mail servers
53TCP / UDPDNSTurns domain names into IP addresses
67 / 68UDPDHCPAssigns IP addresses on a local network
80TCPHTTPUnencrypted web traffic
110TCPPOP3Downloading email (older protocol)
143TCPIMAPReading email kept on the server
443TCPHTTPSEncrypted web traffic
993 / 995TCPIMAPS / POP3SEncrypted email retrieval
3306TCPMySQLDatabase connections
3389TCP / UDPRDPRemote Desktop Protocol
5432TCPPostgreSQLDatabase connections
8080TCPHTTP alternateWeb servers, proxies and development servers

A lookup tells you what a port is officially or commonly used for, not what is definitely running there. Any program can listen on any port, and malware often uses common ports precisely to blend in. Port 443 traffic is not automatically safe just because it is encrypted web traffic.

Two ports deserve a warning. Telnet on port 23 sends everything, including passwords, in clear text, and should never be used when SSH on port 22 exists. Remote Desktop on port 3389 should never face the open internet without a VPN or gateway in front of it.

What is the difference between TCP and UDP ports?

TCP and UDP are the two transport protocols that use port numbers, and they use them differently. TCP is connection-oriented and reliable; UDP is connectionless and fast. Many services, such as DNS on port 53, use both.

FeatureTCPUDP
ConnectionThree-way handshake before data flowsNo handshake; packets sent independently
ReliabilityLost data retransmitted, in orderNo retransmission, no ordering
SpeedSlower, because of acknowledgmentsFaster, with less overhead
Typical useWeb, email, file transfer, SSHDNS lookups, video calls, gaming, streaming
Port spaceIts own 0–65535 rangeIts own 0–65535 range

TCP breaks a stream of bytes into segments, numbers them, and retransmits anything the receiver does not acknowledge. That is why it suits email and websites, where every byte matters. UDP fires off datagrams with no handshake, no acknowledgment and no retransmission, which suits live video and games, where a late packet is worse than a lost one.

For firewalls, the difference is practical: opening TCP port 53 does not open UDP port 53. Rules must name the protocol, and a common configuration mistake is opening the wrong one. The RFC 6335 text defines both protocols' port namespaces in the same three ranges.

What is an ephemeral port?

An ephemeral port is a temporary port your device chooses for the outgoing side of a connection. It comes from the dynamic range, 49152 to 65535, although some operating systems use a wider range for this purpose.

When your browser opens a connection, it needs a source port so the server's reply can find its way back to the right tab. The operating system picks an unused ephemeral port, uses it for that one connection, and releases it when the connection closes. The next connection gets a different one.

That is why firewall logs are full of high-numbered ports. Seeing a connection to port 52341 is normal: it is the client side of an ordinary web request, not a service running on your machine. What matters in a log is the destination port, which names the service being reached.

How do you check which ports are open?

On your own computer, the built-in tools show which ports are listening and which program owns each one. Run these from a terminal or command prompt.

  • Windows: run netstat -ano in Command Prompt or PowerShell. The last column is the process ID; match it in Task Manager to find the program.
  • macOS: run lsof -i -P in Terminal to list listening ports and the processes behind them.
  • Linux: run ss -tuln to list listening TCP and UDP ports, or ss -tulnp to include process names.

To check a remote server, a port scanner such as Nmap can test whether a port answers. Only scan systems you own or have permission to test; scanning someone else's server without permission can be treated as unauthorized access.

For a quick check of your own public-facing services, our SSL checker confirms whether a site answers on port 443 with a valid certificate. A DNS lookup shows the records behind a domain name.

Which ports should be closed or blocked?

The rule is simple: a port should be open only if a service needs it and the service is patched and protected. Everything else should be closed, and anything exposed to the internet should be there deliberately.

  • Close Telnet (23). It sends passwords in clear text. Use SSH (22) instead.
  • Do not expose RDP (3389). Remote Desktop facing the internet is a favorite target for ransomware groups. Put a VPN in front of it.
  • Do not expose databases (3306, 5432). Database ports should only accept connections from your application servers, never from the internet.
  • Close file-sharing ports (445, 139). SMB ports exposed to the internet have been abused by worms and ransomware.
  • Review FTP (21). FTP sends credentials in clear text. SFTP over SSH (22) is the safer replacement.

On a home network, your router's firewall should block unsolicited incoming connections by default. If you run a server at home, forward only the ports it needs. Our guide to securing your Wi-Fi covers router settings including the firewall and remote administration options.

The bottom line

A port number is the part of an address that names the program: the IP address finds the computer, the port finds the service. The 65,536 ports split into system ports for core services, user ports for registered applications, and dynamic ports for temporary client connections.

Learn the dozen common ports in the table above, remember that TCP and UDP ports are separate, and keep anything you do not need closed. If you want to see the public side of your own setup, start with the free what-is-my-IP tool and work outward from there.

Frequently asked questions

What is a port number in simple terms?

A port number is like an apartment number for a building. The IP address is the building, and the port number says which apartment, or program, the delivery is for. Without it, your computer would not know whether incoming data belongs to your browser, your email app or a game.

How many port numbers are there?

There are 65,536 port numbers, from 0 to 65535, because a port number is a 16-bit value. TCP and UDP each have their own set of 65,536 ports, so TCP port 53 and UDP port 53 are technically different ports, even though DNS uses both.

What is the difference between a port and an IP address?

An IP address identifies a device on a network. A port number identifies a service or process running on that device. You need both to make a connection: the address to find the machine, and the port to find the program.

What port does HTTPS use?

HTTPS uses TCP port 443 by default. HTTP uses TCP port 80. A website can run on a different port, but then the port must appear in the address, such as example.com:8443.

What is port 8080 used for?

Port 8080 is a common alternative HTTP port, often used for web servers, proxies and development servers when port 80 is already taken or needs special privileges. It is in the registered port range, not the system range.

Are open ports dangerous?

An open port is only dangerous if the service behind it is vulnerable, misconfigured or should never have been exposed. A web server must listen on port 443, but an open port 3389 (Remote Desktop) or 23 (Telnet) facing the internet is a serious risk.

What is an ephemeral port?

An ephemeral port is a temporary port your device picks for the outgoing side of a connection, usually from the dynamic range 49152 to 65535. It lets replies come back to the right browser tab or app, and it is released when the connection closes.

Sources

  1. IANA — Service Name and Transport Protocol Port Number Registry
  2. IETF — RFC 6335: IANA Procedures for the Service Name and Port Number Registry
  3. Akamai — What Are Ports?
  4. Wikipedia — List of TCP and UDP port numbers
  5. WhatIsMyIP — Port Number Lookup
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against the IANA port number registry and RFC 6335, the IETF standard that defines the port ranges.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free