If you’re struggling to run an online game or a piece of software, you may need to open or forward specific ports. For that, you may need to find their numbers, and I will show you how to do that in this post.

How to find your port number

On Windows
On macOS
1. Press Windows Key + S.
1. Press Command + Spacebar.
2. Type in 'cmd’ and press enter.
2. Type in ‘terminal’ and press enter.
3. In the console type in ‘netstat -a’ and press enter again.
3. In the terminal type in ‘netstat -an’ and press enter again.

For a more in-depth explanation with screenshots, refer below for Windows and macOS.

    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 (Internet Protocol) number, a port works on the inside.

    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 your device to identify and handle tasks in a more efficient way. 

    What is my (a) port number?

    A port number is a digital label that helps identify different ports inside of a device.

    Since many ports are equally present in different devices, there is no such thing as “my port number.” Just like ports, their numbers are pre-set and don’t belong to anyone.

    However, you can still find a full list of ports being used inside of your device.

    A detailed guide to finding your port number

    To find a full list of your ports and their numbers, all it takes is a single console command. Basically, you can view your port number as an extension of your IP address.

    When you use the “netstat -a” command, you will see a bunch of your IP address variations with port numbers attached to them. 

    If your IP address is 255.255.255, then an IP-port will look something like 255.255.255:46664 (“46664” being the port number). From this perspective, you can view your port number as an extension of your IP address.

    Here’s exactly how to find your port numbers on different devices.

    How can I find my port number on Windows?

    To see your ports and their numbers on Windows, follow two simple steps:

    1. Step 1: In your Search Box, type in ‘cmd’ and press Enter.
    1. Step 2: 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:

    1. Step 1: In your Spotlight Search (Command+Spacebar), type in “terminal”.
    1. Step 2: 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).

    What’s the difference between TCP and UDP ports?

    Ports can communicate in many different ways. Most prominent are the TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) transport protocols, or information transfer methods, that use port numbers. 

    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, some streaming services.
    Used for time-sensitive applications and services like streaming, online games, and voice communication apps.

    TCP vs. UDP ports

    What can I do with a port number?

    There are a few things you can do with your ports:

    • Ports can help you maximize your internet speed. Opening and forwarding your ports can seriously improve your downloading as well as streaming experiences.
    • Give games and apps permission to bypass firewalls. Some software or online games use different ports and can run into problems with your firewall. By knowing their port numbers, you can configure your device to give these ports access to bypass your defenses.
    • 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.

    How do I know if I have any open ports?

    Open ports can lead to a possible security hazard, so it’s better to be safe than sorry.

    There are many port scanners, both software and online, that can help you check if you have any ports open or if your firewall is blocking any ones you have just forwarded or opened. Using them you can 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 I cannot recommend opening any ports.

    But if you’re interested in internet security and privacy, what I can recommend is to check out Surfshark VPN and its many features.

    Don’t let an open port be your final destination

    30-day money-back guarantee

    Secure yourself