A port number is a virtual address for a program on your device. It’s like a miniature-scale version of an IP address (which is a device’s address on the internet). So if someone sends you a message on Instagram, that message will have a double address: the IP of your device and the port number that Instagram uses. Now, finding what ports are open is a whole ‘nother thing. This article will tell you how to find open ports.
How to find your port number
Table of contents
What is a port?
A port is a virtual point in your device where a network connection begins and ends. In contrast to an IP address, a port is specific to the process, not the device. However, they’re both necessary for communication over the internet.
If an IP address were a building address, a port number would be an apartment number.
Ports represent different processes and services of a device. For instance, apps that use the internet will have different ports than emails or web pages. This allows the device to sort internet traffic in a tidy manner.
So if your IP is 123.6.457.8 and you’re playing a game on Steam, any web traffic related to the game will be marked 123.6.457.8:27000: your IP plus the port number Steam uses for game traffic.
What is my port number?
A port number is a digital label that helps identify different ports inside a device. Again, it’s like an apartment number appended to the building address, represented by the IP address.
Since many ports are equally present in different devices, there’s no such thing as “my port number.” The numbers are pre-set and don’t belong to anyone.
However, you can still find a full list of ports used inside your device.
A detailed guide to finding your port number
In short, it takes a single console command to find the full list of your ports and their numbers. When you use the “netstat -a” command, you will see a bunch of your IP address variations with port numbers attached to them.
Ports are always displayed with your IP address in front of them. If your IP address is 255.255.255, an IP port will look something like 255.255.255:46664 (“46664” being the port number).
That’s the short version. Let’s look at how to find your port numbers on different devices.
How do I find my port number on Windows?
To see your ports and their numbers on Windows, follow two simple steps:
- In your Search Box, type in “cmd” and press Enter.
- In the console that will appear, type in the “netstat -a” command and press Enter to see a full list of your ports and port numbers.
You will find your IP address and port number in the Local and Foreign Address columns.
How do I find my port number on macOS?
You used to be able to scan your device’s ports through a “Network Utility” app on macOS, but Apple recently removed it. To locate your port number on macOS, you need to:
- Type in “terminal” in your Spotlight Search (Command+Spacebar).
- Type in the command “netstat -an” to see a full list of your ports and their numbers.
If you find multiple sections, look for the Protocol, Local Address, Foreign Address, and State heading.
You will find your IP number paired with a port number under the Local and incoming IP addresses in the Foreign Address columns.
Meanwhile, the Protocol section shows what communication protocol the port is using. This will either be UDP (User Datagram Protocol) or TCP (Transmission Control Protocol).
How do I find my port number on Android?
It’s somewhat harder to find the port numbers on mobile devices. Nobody knows how private or secure all those network-checking apps are and what data they collect.
That’s why I asked the Surfshark Security Officer about it, and he recommended the Nmap Security Scanner. So this is the option for massive nerds.
- Download and install the Nmap Security Scanner on a PC/Mac/Linux laptop.
- Admire the living relic that is the design of the Nmap website.
- Have your laptop and phone connected to the same Wi-Fi network.
- Open the command line/terminal on your laptop.
- Enter nmap –p– your.smartphones.ip.address before pressing Enter.
- Wait for the process to run.
- Any open ports will be listed under the PORT STATE SERVICE line.
How do I find my port number on my iPhone?
The Apple App Store isn’t great at showing whether a network diagnostics app is actually trustworthy or is stealing your data like it’s going out of fashion. That’s why you should get yourself a laptop and use a program called Nmap Security Scanner.
Download and install the Nmap Security Scanner on a PC/Mac/Linux laptop.
- Connect your laptop and iPhone to the same Wi-Fi network.
- Open the command line/terminal on your laptop.
- Enter nmap –p– your.smartphones.ip.address and press Enter.
- Wait for the process to complete.
- Your iPhone’s open ports will be listed under the PORT STATE SERVICE line.
What’s the difference between TCP and UDP ports?
Ports need to use transport protocols — information transfer methods — to actually send and receive data. The most prominent are the TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
Their use cases often vary depending on the situation. Here’s how the two compare in a nutshell.
Is connection-oriented, making it stable and more reliable.
Is connectionless, meaning it prioritizes speed.
Three-way handshake makes it safer but slower.
No handshaking makes it less safe and reliable.
Used by the World Wide Web (WWW), email services, file transfer, and some streaming services.
Used for time-sensitive applications and services like streaming, online games, and voice communication apps.
Essential when integrity of the data is more important than speed.
Essential when speed is more important than all the data arriving correctly.
What can I do with a port number?
With a port number in hand, you can:
Maximize your internet speed
Opening and forwarding your ports bypasses some of the resource-consuming processes in the router. This can seriously improve your downloading as well as streaming experiences.
Give games and apps permission to bypass firewalls
Some software or online games can run into problems with your firewall. By knowing their port numbers, you can port forwarding for gaming and host game servers.
Detect open (vulnerable) ports in your devices or network
Since ports receive information in data packets, the ones left open can act as entry points for hackers. If you’re looking to secure yourself, make sure you don’t have any open ports.
What are Windows/MacOS ports?
Some processes and applications are lucky to have their own permanent ports. Here’s a list:
FTP (File Transfer Protocol) file sharing
SSH (Secure Shell) and other secure communications
SMTP (Simple Mail Transfer Protocol) for email routing
DNS (Domain Name System) or the thing you fiddle with for the most basic internet unblocking purposes
HTTP (Hypertext Transfer Protocol) or, you know, basically how you used to access websites before
IRC (Internet Relay Chat), sort of like primitive Discord
HTTPS (Hypertext Transfer Protocol Secure) or, you know, basically how you access websites today
RTSP (Real Time Streaming Protocol), which is what makes Spotify and Skype streaming go
DOOM, the granddaddy of all online FPS games
How do I know if I have any open ports?
There are many port scanners, both software and online, that can help you check if you have open ports or if your firewall is blocking any ports you have just forwarded or opened. Using them, you can also scan your system for vulnerable ports.
Open port hazard is one of the reasons why most VPNs like Surfshark do not support VPN port forwarding. Your security is our highest priority, so we cannot recommend opening any ports.
But if you’re interested in internet security and privacy, I recommend checking out Surfshark VPN and its many features.
In conclusion: know your ports, keep them closed
Ports are one of those technologies that function quietly in the background to make online communication work. However, they can also become gaps in your cybersecurity perimeter. That’s why we don’t recommend leaving any unnecessary ports open. Forwarding them when you’re using a VPN isn’t recommended either.
How do I find my IP address and port?
You find your IP address and ports by opening the console, entering the “netstat -a” command, and then looking for the numbers under Local Address.
What port number is 8080?
8080 is the port number usually used by web servers.
What are the three types of ports?
Port numbers are split into three ranges: well-known ports, registered ports, and ephemeral ports:
- Well-known ports (0-1023) — these are used by the vital processes of the operating system: HTTP for internet traffic, FTP for file transfer, and so on.
- Registered ports (1024-49151) — these were registered by companies with IATA (The Internet Assigned Numbers Authority oversees Internet) for their own use. Skype uses port 23339, BitTorrent uses ports 6902-6968.
- Ephemeral ports (49152-65535) — these are used by custom or temporary processes, like browser tabs.
What port does IP use?
Philosophically speaking, IP either doesn’t use any port or uses every port. The closest thing to an answer here would be 443, the port used by HTTPS, the protocol that handles most website traffic these days.