On Windows, open Command Prompt as administrator and run netstat -ano | findstr LISTENING to list listening TCP ports with their process IDs, or run Get-NetTCPConnection -State Listen in PowerShell for a filterable list. Match each PID to a program with Task Manager or tasklist, then close or firewall any port you do not recognise or need.
Key takeaways
- netstat -ano and Get-NetTCPConnection -State Listen are the two fastest built-in ways to list open ports on Windows.
- A port listening on 0.0.0.0 accepts connections from other devices; one on 127.0.0.1 only accepts local connections.
- Always identify the owning process before closing a port, so you do not break a service you actually use.
Every program that accepts network connections on your PC listens on a port. Most of those ports are harmless, but an unexpected one can be a forgotten server, a misconfigured app, or malware. Checking takes two minutes with tools already built into Windows.
What is an open port on Windows?
An open port is a numbered endpoint, from 0 to 65535, that a program uses to send and receive network traffic. When a program is waiting for connections, its port is described as listening.
Common examples help make this concrete. Port 80 is the usual port for plain web traffic, 443 is for encrypted web traffic, and 3389 is the default for Remote Desktop. Your PC can have dozens of listening ports at once, and that is normal.
The important distinction is the address a port listens on. A port bound to 127.0.0.1 only accepts connections from your own PC. A port bound to 0.0.0.0 accepts connections from any device that can reach your PC, including other devices on your network. That second group deserves your attention.
What is the quickest way to check open ports?
Run netstat -ano | findstr LISTENING in an administrator Command Prompt. It lists every listening TCP port, the address it is bound to, and the process ID of the program behind it.
If you prefer PowerShell, run Get-NetTCPConnection -State Listen. It gives the same information in a structured form you can sort, filter and export. Both methods work on Windows 10 and Windows 11, and both are built in, so nothing needs installing.
For a graphical view, open Resource Monitor with resmon, go to the Network tab, and expand Listening Ports. You will see the program name, PID, address, port and firewall status in one table.
How to check open ports with netstat
netstat has shipped with Windows for decades, and it is still the fastest way to get a snapshot of listening ports. Open it as an administrator so process names are shown reliably.
- Press the Windows key, type
cmd, right-click Command Prompt, and choose Run as administrator. - Run
netstat -anoto list all connections and listening ports with their PIDs. - To see only listening TCP ports, run
netstat -ano | findstr LISTENING. - To check one port, run
netstat -ano | findstr :3389, replacing 3389 with your port. - To see only TCP or only UDP, add
-p TCPor-p UDP.
Read the output left to right. The Proto column shows TCP or UDP, Local Address shows the address and port, State shows LISTENING for TCP listeners, and PID shows the owning process. A typical line looks like TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4.
The -b flag shows the executable name, as in netstat -abno, but it needs an administrator prompt and can be slow. The -n flag stops netstat resolving addresses to names, which keeps the output fast and readable.
How to check open ports in PowerShell
PowerShell gives tidier output than netstat, because Get-NetTCPConnection returns objects you can filter, sort and export instead of plain text. Microsoft documents the cmdlet with -LocalPort, -State and -OwningProcess filters.
Start with the listening list:
Get-NetTCPConnection -State Listenlists all listening TCP connections.Get-NetTCPConnection -LocalPort 3389shows everything touching port 3389.Get-NetUDPEndpoint | Sort-Object LocalPortlists UDP endpoints, which have no LISTENING state.Get-NetTCPConnection -State Listen | Sort-Object LocalPortsorts the list by port number.
To add process names, pipe the result through Get-Process using the OwningProcess value. You can also export the result with Export-Csv for an audit record. That makes PowerShell the better choice when you check ports regularly or across several machines.
One limit is worth knowing: Get-NetTCPConnection covers TCP only. UDP has no connection state, so use Get-NetUDPEndpoint or netstat for UDP.
Microsoft documents the cmdlet, including its -LocalPort, -State and -OwningProcess filters, in the Get-NetTCPConnection reference on Microsoft Learn.
For a worked walkthrough of the same commands on Windows, Mac and Linux, see the DEV Community guide to checking open ports.
How do I find which program is using a port?
Take the PID from the netstat or PowerShell output, then match it to a program. That step turns a bare port number into a decision you can act on.
- Run
tasklist /FI "PID eq 1234", replacing 1234 with the PID you found. - Or open Task Manager, go to the Details tab, and look for the same PID.
- Or run
netstat -abnoas administrator to show executable names directly. - Search the program name online if you do not recognise it, before stopping anything.
System PIDs such as 4 belong to the Windows kernel and host services such as file sharing on port 445. Do not kill those processes. If a port belongs to a program you installed and no longer use, uninstalling or disabling that program is cleaner than blocking the port alone.
If the program is unfamiliar and you did not install it, treat it as suspicious. Run a full antivirus scan, check when the program was installed, and look at its file location in Task Manager before deciding what to do next.
Which open ports are normal, and which are risky?
Some listening ports are part of normal Windows operation, while others should only be open when you deliberately enabled a service. The table below is a starting point, not a verdict on its own.
| Port | Usually used by | Risk if exposed |
|---|---|---|
| 80 / 443 | Web servers and local development tools | Medium — check what web service is running |
| 135, 445 | Windows RPC and file sharing | High on a public network — should not face the internet |
| 3389 | Remote Desktop | High — a common brute-force target; use a VPN instead |
| 22 | SSH servers | Medium — secure it with keys and a strong password |
| 3306, 5432 | MySQL and PostgreSQL databases | High — databases should listen locally only |
| 8080 | Development servers and proxies | Medium — often left running by mistake |
| 53 | DNS services | Medium — unexpected DNS listeners deserve a check |
Port 445 is a good example of why context matters. File sharing inside a trusted home or office network is normal, but the same port exposed to the internet is a well-known attack target. Your router and firewall decide which of those two situations applies, which is why the next section matters.
Also watch for high-numbered ports above 49152. Programs often pick those at random, so a single unfamiliar high port is usually a temporary app connection rather than a server. Repeated listeners on the same high port are worth investigating.
How do I check if a port is open to the internet?
A listening port on your PC is not the same as a port reachable from the internet. Your router, your internet provider and Windows Firewall all sit between the two, and any of them can block inbound traffic.
First, check Windows Firewall. Run netsh advfirewall firewall show rule name=all | findstr /I 3389 with your port number to see whether a rule mentions it. In the graphical firewall, look under Inbound Rules for a rule that allows that port.
Second, check your router. Most home routers block unsolicited inbound connections by default, unless you set up port forwarding. If you did not forward the port, it is probably not reachable from outside, even though it listens locally. Our guide to how to secure your Wi-Fi covers router settings that affect this.
Third, use an external port checker only for ports you expect to be public, such as a web server you run deliberately. Enter your public IP address and the port, and the checker reports whether it can connect. You can find your public address with our free what-is-my-IP tool.
How do I close an open port on Windows?
Close a port by stopping the program that owns it, or by blocking it in Windows Firewall. Stopping the program is the cleaner option when you do not need the service at all.
To stop a service, open Services with services.msc, find the service, and set its startup type to Manual or Disabled if you are sure you do not need it. To block a port in the firewall, open Windows Defender Firewall with Advanced Security, create a new Inbound Rule, choose Port, enter the port number, and choose Block the connection.
For Remote Desktop, the safer fix is not just closing port 3389. Disable Remote Desktop in Settings if you do not use it, or reach it through a VPN so the port never faces the internet directly.
After any change, re-run netstat -ano | findstr LISTENING to confirm the port is gone. If it returns, the program restarted it, or another program is using the same port, so check the new PID.
What GUI tools show open ports on Windows?
If you prefer not to use the command line, Windows and Microsoft offer graphical options that show the same information with process names included.
Resource Monitor is built in. Press Windows + R, type resmon, open the Network tab, and expand Listening Ports. Each row shows the program, PID, address, port, protocol and firewall status, which is often enough for a quick review.
TCPView, part of Microsoft Sysinternals, is a free download that updates live. It highlights new connections, lets you close a connection from the list, and shows the process name without needing a PID lookup. It is the best graphical choice for watching ports change in real time.
Windows Firewall with Advanced Security also helps, but it shows rules rather than live listeners. Use it to confirm whether a port is allowed through the firewall, not to discover which ports are listening.
What mistakes do people make when checking ports?
The most common mistake is treating every listening port as a problem. A normal Windows PC listens on several ports, and most are local-only or part of services you use every day. Panic-closing them breaks things.
Another mistake is confusing a listening port with an internet-exposed port. A port can listen on your PC while your firewall and router block it from the outside world. Check the listening address and your firewall rules before assuming the worst.
People also forget UDP. Because UDP has no LISTENING state, a UDP-only check with Get-NetTCPConnection will miss it. Use netstat -ano -p UDP or Get-NetUDPEndpoint when you want the full picture.
Finally, a one-off check is not enough on a shared or work PC. New software can open new ports at any time, so repeat the check after installing software, and keep a short note of which ports you expect to see.
The bottom line
Checking open ports on Windows is a two-minute habit that pays off. Start with netstat -ano | findstr LISTENING or Get-NetTCPConnection -State Listen, match each PID to a program, and focus on ports listening on 0.0.0.0 that you cannot explain.
Close what you do not need, keep your firewall on, and re-check after installing new software. If you want a wider review of your home network, start with our guide to securing your Wi-Fi.
Frequently asked questions
What is the fastest way to check open ports on Windows?
Run netstat -ano in an administrator Command Prompt and look for TCP rows marked LISTENING. The last column is the process ID, which tells you which program owns each port. For a cleaner, filterable list, use Get-NetTCPConnection -State Listen in PowerShell.
How do I check if a specific port is open on Windows?
Run netstat -ano | findstr :3389, replacing 3389 with the port you want to check. If a LISTENING line appears, something is listening on that port. In PowerShell, run Get-NetTCPConnection -LocalPort 3389 -State Listen for the same check.
What does LISTENING mean in netstat?
LISTENING means a program is waiting for incoming TCP connections on that port. It does not by itself mean the port is reachable from the internet, because your firewall or router may still block it. It does mean the service is ready to accept a connection from any device that can reach it.
How do I find which program is using a port?
Note the PID in the last column of the netstat output, then run tasklist /FI "PID eq 1234" with that number, or open Task Manager, go to the Details tab, and find the matching PID. In PowerShell, Get-NetTCPConnection shows the OwningProcess for each connection.
Is it safe to close an open port?
It is safe to close a port you do not need, but first identify the program behind it. Closing a port used by a service you rely on, such as remote desktop or a local database, will break that service. Stop the program or add a firewall rule rather than deleting system services you do not understand.
Why do I see so many open ports on a normal PC?
Windows itself listens on several ports for system services, and apps such as browsers, chat tools and games open more. Most listen only on 127.0.0.1, which is local only. Focus on ports listening on 0.0.0.0 or your network address, and on programs you do not recognise.
Do I need a third-party tool to check open ports?
No. Windows includes netstat, PowerShell, Resource Monitor and Windows Firewall, which cover most checks. TCPView from Microsoft Sysinternals is a useful free graphical tool if you want a live, updating list with process names.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against Microsoft Learn documentation for Get-NetTCPConnection and published Windows port-checking guides.
How we write and fact-check →