25
25 people found this article helpful
You can use a Windows command or third-party utilities
What to Know
- Easiest: Open the Start menu > type command > right-click the Command Prompt app > Run as administrator.
- Type netstat -ab > press Enter > look for items in the «LISTENING» state.
- The alternative is to use a third-party app: We like TCPView, Nirsoft CurrPorts, and PortQry Command Line Port Scanner.
This article outlines how to check for open ports in Windows 10, which is necessary if an application cannot access the internet or you want to block an application.
How to Check If a Port Is Open With Netstat
The easiest way to check if a port is open on Windows 10 is by using the Netstat command. ‘Netstat’ is short for network statistics. It will show you what ports each internet protocol (like TCP, FTP, etc.) is currently using.
The command has many parameters, but the ones you’ll need to use to check if a port is open are (a), which provides the active ports, and (b), which will tell you the name of the processes using those ports.
-
Select the Start menu and type «command.» Right-click on the Command Prompt app and select Run as administrator.
-
Type netstat -ab and press Enter. You’ll see a long list of results, depending on what’s currently connecting to the network. You’ll see a list of running processes. The open port numbers will be after the last colon on the local IP address (the one on the left).
-
Look for the items on the list with a state of «LISTENING.» These are the processes that are communicating via one of the currently opened ports.
-
If you want to know the program’s name that has a specific port open, then type netstat -aon and press Enter. This command will show the protocol the app is using, the local and remote IP addresses, and most importantly, the PID of the application using that port (the number on the far right). Remember to look for the LISTENING status.
-
To find the application related to that PID, right-click the task manager and select Task Manager. Select the Details tab. Look in the PID field for the PID you noted from the command prompt screen.
How to Check If a Port Is Working Using Third-Party Apps
If you don’t want to use the command prompt to check for open ports, there are very easy-to-use third-party apps that can help.
TCPView
TCPView is a utility included in Microsoft Sysinternals that shows you a list of all running processes and their associated open ports. This app displays ports opening and closing and packet transfers, all in real-time.
Nirsoft CurrPorts
Nirsoft CurrPorts is another utility to see all ports currently being used by applications and services on your system. Just look for the local ports column to see which of your computer’s ports are active.
The list also includes ports that are being connected to on the remote end (the server out on the internet).
PortQry Command Line Port Scanner
Install PortQry Command Line Port Scanner for another command-line utility dedicated to scanning your computer for open ports. Once you install it, open Command Prompt in administrator mode. PortQry automatically installs in the C:PortQryV2 directory, so change the directory of your command prompt to that directory.
Type the command portqry.exe -local to see all open TCP and UDP ports for your machine. It’ll show you everything you can see with the NetStat command, plus port mappings and how many ports are in each state.
What Is a Port?
Applications running on your computer reach out and get information and data from servers elsewhere on the internet. These applications and the server know how to communicate based on their IP address and the port number.
Think of the IP address as a street address and the port number as the apartment number. If either the server or application attempts to communicate using any other port number, it won’t work. Every other door will be «locked» because other ports are closed.
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe
Download Article
Download Article
Are you looking for a quick way to check if a port on your router or firewall is open? It’s actually pretty simple. The right way to do it just depends on whether you’re using a Mac or PC and what kind of port you’re checking. We’ll walk you through how to do it step-by-step on Windows and macOS.
-
1
Enable Telnet for Windows. You can use Telnet to check if a certain port is open on your local router or access point. Here’s how to enable it:
- Type windows features in to the search bar. If you don’t see the search bar, click the circle or magnifying glass to the right of the Start menu.
- Click Turn Windows features on or off.
- Check the box next to Telnet Client and click OK.
- Click Close when the app is finished installing.
-
2
Open a command prompt. Here’s how to open the command prompt:
- Type cmd into the Windows search bar.
- Click Command prompt in the search results.
Advertisement
-
3
Type ipconfig at the prompt and press ↵ Enter. This displays a bunch of network information.
-
4
Write down the router’s IP address. The address that appears next to «Default Gateway» in the ipconfig results is the local address of your router.
-
5
Type telnet at the prompt and press ↵ Enter. This opens the Microsoft Telnet prompt.
-
6
Type open (router's IP address) (port number). For example, if you wanted to see if port 25 is open on your router, and your router’s IP address is 10.0.0.1, you would type open 10.0.0.1 25.
-
7
Press ↵ Enter. Telnet will try to connect to the port.
- If you see a message that says «Please press Enter» or «Press any key to continue,» the port is open.
- If you see a message that says «Could not open connection,» the port is not open.
Advertisement
-
1
Open a Terminal window. To open a Terminal window, open Spotlight by clicking the magnifying glass at the top-right corner of the screen, type terminal, and then click Terminal in the search results.
- Use this method to see if a port is open on your local router or access point.
-
2
Type netstat -nr | grep default at the prompt and press ⏎ Return. The router’s IP address appears next to «default» at the top of the results.
-
3
Type nc -vz (your router's IP address) (port). For example, if you wanted to see if port 25 is open on your router, and your router’s IP address is 10.0.0.1, you would type nc -vz 10.0.0.1 25.[1]
-
4
Press ⏎ Return. Here’s how to interpret the results:[2]
- If the port is open, you’ll see a message that says the connection succeeded.
- If the port is closed, you’ll see a message that says the connection was refused or timed out.
Advertisement
-
1
Open Windows search and type firewall. If the search bar is not already open, click the circle or magnifying glass to the right of the Start menu to open it.
- Use this method if you want to see if Windows is set up to allow an app you’ve installed to communicate through your firewall.
- The Windows firewall is enabled by default. If you’ve installed your own firewall software, use that software to check if an app is allowed through.
-
2
Click Windows Defender Firewall. This opens your Firewall and Network Protection settings.
-
3
Click Allow an app through firewall. It’s one of the text links near the bottom of the window. A list of apps allowed through the firewall will appear.
- If the app is allowed through the firewall only when you’re connected to a network you’ve marked as «private» (such as when you’re on your home network), a check will appear in the «Private» column next to the app.
- If the app is allowed through the firewall when you’re connected to a public network, a check will appear in the «Public» column.
-
4
Allow an unlisted app or port through the firewall. If you don’t see the app on the «Allowed apps and features» list, click the Change Settings button at the top-right corner, and then follow these steps:
- Click Allow another app near the bottom.
- Click Browse, select the app, and then click Open.
- Click Network Types near the bottom-left corner, select a privacy preference, and then click OK.
- Click Add to add the app, and then click OK.
Advertisement
-
1
Go to http://www.canyouseeme.org in a web browser. You can use it to see if a port on your computer or network is accessible on the internet. The website will automatically detect your IP address and display it in the «Your IP» box.[3]
- There are many different sites you can use to check for an open port. Search for «open port check tool» in your favorite search engine to find an alternative, if desired.
-
2
Enter the port. Type the port you want to check (e.g., 22 for SSH) into the «Port to Check» box.[4]
-
3
Click Check Port. If the port is open and available, you’ll see a confirmation message. If not, you’ll see a message that says «Error: I could not see your service on (your IP address) on port (the port number).»[5]
Advertisement
-
1
Click the
menu and select System Preferences. The Mac firewall is not enabled by default.[6]
-
2
Click Security & Privacy. It’s the house icon on the top row.
-
3
Click the Firewall tab. It’s near the top-center part of the window.
- If you see the message «Firewall:On» near the top of the tab, this means your firewall is active.
- If the firewall is not active but you want it to be, click the padlock icon at the bottom-left part of the window, enter your administrator password, and then click Turn On Firewall.
-
4
Click Firewall Options. This opens your settings, including a list of apps and services set to either allow or disallow incoming connections.
- If an app or service has a green dot and the text «Allow incoming connections,» that means its port is open.
- If you see a red dot that says «Block incoming connections,» the port is closed.
- You can toggle whether a port is allowed or not allowed by clicking the double-arrow icon next to the app’s current status, and choosing an option.
Advertisement
Add New Question
-
Question
How do I check if a port is open Windows 10?
Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years.
Computer & Tech Specialist
Expert Answer
An easy way to do this is to go to canyouseeme.org and type in the port number into the webpage. It’ll be able to tell you whether or not the port is open.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
About This Article
Thanks to all authors for creating a page that has been read 499,755 times.
Is this article up to date?
Certain apps and processes in Windows 10 can cause problems if you’re not properly connected to the internet. Firewalls can cause these connection issues when they cannot determine whether incoming and outgoing connections pose a threat. Work around this issue and open ports for incoming and outgoing connections. We will know to check whether a TCP port is open or closed on the Windows operating system.
Basically, many times we need to check the port status when any of the below issues results in closing the port.
- They may not be properly working.
- External IP addresses that are in use may be set to private IPs.
- Firewall rules may block the network.
There are several ways to check open TCP/IP ports in Windows. Here are a few options:
Using Telnet Client:
Step 1: Check whether the telnet client feature is ON or not. In order to check, open the Turn Windows feature on or off settings from the search bar. OR press the ‘window’ key and type ‘windows’ features. Then press on “Turn Windows features on or off”.
Windows Features Option
A new prompt will be opened. Search for “Telnet Client” and check the box in front of ‘telnet Client’.
Windows Features
Step 2: Open the command prompt. Press the ‘windows’ key and type ‘cmd’. Press “Command Prompt”.
Command Prompt Option
Step 3: On the command prompt, type the command “telnet + IP address or hostname + port number” and check the status of the provided TCP port.
Telnet Command
Step 4: If only the blinking cursor is visible, then the port is open.
Port is Open
Step 5: If you get the message “connection failed” then the port is closed.
Port is close
Using built-in netstat command-line utility:
Step 1: Open the command prompt.
Step 2: Run the following command:
netstat -an
Using TcpView
Another option is to use the TcpView utility from Microsoft’s Sysinternals suite of tools. This utility provides a more user-friendly interface for viewing active TCP/IP connections, along with additional information such as the process ID and process name for each connection. Steps to be followed:
Step 1: Download the TcpView utility from the Microsoft Sysinternals website. You can find the download link on the TcpView page of the Sysinternals website.
Download Page
Step 2: Extract the downloaded file and run the TcpView.exe file to launch the TcpView utility. This will open the TcpView window, which shows a list of all active TCP/IP connections on your machine.
Extracted FIles
Step 3: Open the tcpview.exe (application).
By default, TcpView will display the following columns in the list of connections:
Protocol: Shows the protocol being used for the connection (TCP or UDP)
Local Address: Shows the local address and port being used for the connection
Remote Address: Shows the remote address and port being connected to
State: Shows the current state of the connection (e.g. Established, Listen, etc.)
You can use the “Local Address” and “Remote Address” columns to see which ports are being used by which applications. For example, if you see a connection with a local address of “127.0.0.1:80”, this means that the local application is using port 80 for outgoing connections.
Windows PowerShell
You can also use Windows PowerShell to check open TCP/IP ports. To do this, use the Get-NetTCPConnection cmdlet, which allows you to view a list of active TCP/IP connections and the local and remote addresses and ports being used. For example, you can run the following command to view a list of all active TCP/IP connections:
Get-NetTCPConnection | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort
Get-NetTCPConnection cmdlet
Nmap
To install Nmap in the Windows command line, follow these steps:
Step 1: Download the latest version of Nmap from the Nmap website. You can find the download link on the Nmap download page:
https://nmap.org/download.html
Step 2: Extract the downloaded file to a location on your computer. This will create a new folder containing the Nmap files.
Step 3: Open a command prompt and navigate to the directory where you extracted the Nmap files. For example, if you extracted the files to the C:nmap directory, you would run the following command:
cd C:nmap
Step 4: Once you are in the Nmap directory, you can install Nmap by running the nmap.exe file. To do this, run the following command:
nmap.exe -V
This will display the version number of Nmap, indicating that it has been installed successfully.
Step 5: To use nmap to scan for open TCP/IP ports, run the “nmap -sT” command, followed by the IP address or hostname of the machine you want to scan.
nmap -sT localhost
This will scan the specified host or IP address and display the results. You can also use the -h option to view a list of available options and arguments for the nmap command. Overall, installing Nmap in the Windows command line is a straightforward process. You can download the latest version of Nmap from the Nmap website, extract the files, and then run the nmap.exe file to install it. Once it is installed, you can use the nmap command to scan hosts and IP addresses and view the results.
What is a simple way in Windows to test if traffic gets through to a specific port on a remote machine?
asked Jul 2, 2009 at 18:01
1
I found a hiddem gem the other day from Microsoft that is designed for testing ports:
Portqry.exe
«Portqry.exe is a command-line utility that you can use to help troubleshoot TCP/IP connectivity issues. Portqry.exe runs on Windows 2000-based computers, on Windows XP-based computers, and on Windows Server 2003-based computers. The utility reports the port status of TCP and UDP ports on a computer that you select. «
answered Jul 2, 2009 at 18:30
Peter MPeter M
9968 silver badges20 bronze badges
3
Which version of Windows? For Windows 8/Server 2012 and later, the following works in PowerShell:
Test-NetConnection 128.159.1.1 -Port 80
Some Googling will also turn up alternatives which use the .NET Framework directly (since PowerShell lets you do that) for systems running lower versions of Windows that won’t have Test-NetConnection
available.
If you’re not averse to using third-party utilities, Nmap is also a very good friend to have and it works from the command line.
answered Oct 16, 2014 at 6:18
IsziIszi
2,2668 gold badges25 silver badges33 bronze badges
6
Use the telnet command to connect to the server on the specified port, and see if a connection can be established.
Success:
$ telnet my_server 25
220 my_server ESMTP Postfix
Fail:
$ telnet my_server 23632
Connecting To my_server...Could not open connection to the host, on port 23632:
Connect failed
answered Jul 2, 2009 at 18:05
Jørn Schou-RodeJørn Schou-Rode
7101 gold badge6 silver badges12 bronze badges
4
Telnet will work for TCP.
Netcat is a better tool for these sorts of things, including UDP, watch out though, some AV softwares consider it an ‘evil hacker tool’
answered Jul 2, 2009 at 18:07
whatsisnamewhatsisname
2911 gold badge3 silver badges8 bronze badges
Use netcat Windows port:
>nc -zvv www.google.com 80
www.google.com [108.177.96.103] 80 (http) open
sent 0, rcvd 0
>
>nc -zvv www.google.com 888
www.google.com [108.177.96.147] 888 (?): TIMEDOUT
sent 0, rcvd 0: NOTSOCK
>
answered Oct 25, 2016 at 12:48
rustyxrustyx
1,5963 gold badges19 silver badges30 bronze badges
the following command will list all ports in use on the machine…
netstat -a
The output contains the protocol, local address, foreign address and current state
Netstat documentation on microsoft.com
answered Jul 11, 2012 at 13:05
BaldyBaldy
1952 silver badges11 bronze badges
1
As @iszi’s answer suggested, using the free nmap
utility downloadable from nmap.org is a viable option. It could scan for UDP or TCP ports. Example:
nmap -n -P0 -p "80,443" microsoft.com duolingo.com
where
-n never do DNS resolution
-P0 do not ping to test 'up' state
-p this is the list of desired ports
"22,80,443" check in SSH, HTTP and HTTPS in TCP
The port list should be inside quotes in Windows because the comma is interpreted as space in the shell.
Result:
Nmap scan report for microsoft.com (20.53.203.50)
Host is up (0.21s latency).
Other addresses for microsoft.com (not scanned): 20.81.111.85 20.103.85.33 20.84.181.62 20.112.52.29
PORT STATE SERVICE
80/tcp open http
443/tcp open https
Nmap scan report for duolingo.com (184.72.124.184)
Host is up (0.068s latency).
PORT STATE SERVICE
80/tcp open http
443/tcp open https
Nmap done: 2 IP addresses (2 hosts up) scanned in 0.62 seconds
Port 22 is not open on the tested hosts.
Reference: https://nmap.org/book/man.html
answered Oct 27, 2022 at 23:16
FjorFjor
1864 bronze badges
‘netstat’ is you friend.
answered Jul 2, 2009 at 18:03
2