How to check open ports on Windows with PowerShell, CMD, and GUI
Whether you are diagnosing a blocked web service, investigating local firewall rules, or troubleshooting database connections, here are the most effective ways to check open ports on Windows 10 and 11.
Method 1: Check listening ports via CMD (netstat)
The built-in netstat command displays active TCP connections and listening sockets on your local Windows PC:
# Open CMD as Administrator and run:
netstat -ano -p tcp | findstr LISTENING
# Match a specific listening port (e.g. port 8080):
netstat -ano | findstr :8080
# Find which application owns the PID from netstat:
tasklist /fi "PID eq 1234"
Limitation: netstat only shows what is listening on your local machine; it cannot test ports across your network or check remote servers.
Method 2: Test remote ports with PowerShell (Test-NetConnection)
PowerShell includes Test-NetConnection (alias tnc), which functions like a basic TCP ping:
# Test if port 443 is open on a remote host:
Test-NetConnection -ComputerName example.com -Port 443
# Quick one-liner checking only the boolean result:
(Test-NetConnection 192.168.1.1 -Port 80).TcpTestSucceeded
Limitation: Test-NetConnection tests only one port at a time and takes 2-4 seconds per check, making multi-port or subnet sweeps painfully slow.
Method 3: Multi-port and subnet scan with Open Port Scanner
For auditing dozens of ports or checking all hosts on your subnet, use Open Port Scanner:
- Download
port-scanner-windows-x64.zipand launchport-scanner.exe. - To scan your local PC, click the local host button or enter
127.0.0.1. - To scan your local Wi-Fi or office network, click the LAN target button (e.g.
192.168.1.0/24). - Select a port preset (Quick, Standard, Web, or Databases) and click Scan. Open ports appear with latency and HTTP titles in seconds.
# Or run directly from Windows Terminal / PowerShell:
.\port-scanner.exe 127.0.0.1 --profile web
.\port-scanner.exe --lan --profile quick -o scan-results.csv
Summary comparison
- netstat: Best for checking which local process PID has bound to a specific port on your own PC.
- PowerShell Test-NetConnection: Good for a single quick check against one remote IP and port without downloading tools.
- Open Port Scanner: Best for checking multiple ports, entire subnets, capturing HTTP/SSH banners, and exporting CSV/JSON reports.