What is a Port Number?

A port number is a numerical identifier in network communications used to distinguish different services or processes on a computer. It is associated with an IP address of the host and the type of transport protocol used (TCP or UDP).
Table of Contents
Why Port Numbers Matter:
- Service Differentiation: Port numbers allow a single IP address to host multiple services. For example, a web server (HTTP) typically uses port 80, while an email server (SMTP) might use port 25.
 - Network Communication: When a device sends data over the internet, the port number helps to route the data to the correct application or service on the receiving end.
 - Security: Firewalls and security systems use port numbers to filter traffic and block unauthorized access. For instance, common ports might be targeted by attackers, so managing which ports are open or closed is important for security.
 - Network Organization: Port numbers help network administrators organize and manage network traffic. Specific ports can be allocated for specific services, ensuring that traffic is properly directed.
 
Common Port Numbers:
- HTTP (Web traffic): Port 80
 - HTTPS (Secure web traffic): Port 443
 - FTP (File Transfer Protocol): Port 21
 - SSH (Secure Shell): Port 22
 - SMTP (Simple Mail Transfer Protocol): Port 25
 - DNS (Domain Name System): Port 53
 
Example
When you type a website address (e.g., www.example.com), your browser by default connects to port 80 for HTTP or port 443 for HTTPS. This tells the server that you are requesting a web page. If you are sending an email, your email client might connect to port 25 on the mail server.
Understanding port numbers is essential for configuring and troubleshooting network connections, ensuring security, and optimizing the performance of networked services.
How to find your port number
To find which ports are being used on your computer or to identify the port number associated with a specific application, follow the steps below based on your operating system.
How to find port number
Windows
Using Command Prompt
- Open Command Prompt: Press 
Windows Key + R, typecmd, and press Enter. - Run the netstat Command: Type the following command and press Enter:
 

-ashows all active connections and the ports on which the computer is listening.-oshows the owning process ID (PID) associated with each connection.-nshows addresses and port numbers in numerical form.
Using Resource Monitor
- Open Resource Monitor: Type 
resmonin the search bar and press Enter. - Navigate to Network Tab: Click on the “Network” tab.
 - View Listening Ports: In the “Listening Ports” section, you can see which ports are being used by which process.
 
macOS
Using Terminal
- Open Terminal: Go to Applications > Utilities > Terminal.
 - Run the netstat Command: Type the following command and press Enter:
 

- This command lists all the ports that are currently being listened to by your system.
 
Linux
Using Terminal
- Open Terminal: This can typically be found in your system’s application menu.
 - Run the netstat Command: Type the following command and press Enter:
 

-tshows TCP ports.-ushows UDP ports.-lshows listening ports.-nshows addresses and port numbers in numerical form.
Using Third-Party Tools
There are also third-party tools available that can help you find and manage port numbers:
- Wireshark: A network protocol analyzer that can capture and display data packets, showing the port numbers in use.
 - Advanced Port Scanner: A fast and free port scanning tool.
 
Summary
These steps will help you identify the port numbers used by various applications on your computer. Whether you are using Windows, macOS, or Linux, the commands and tools mentioned can provide detailed information on network connections and the associated ports.