How do I find out which process is listening on a TCP or UDP port on Windows?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
On Windows, the normal workflow is simple: find the port, read the owning PID, then map that PID to a process name. You can do that with built-in tools such as netstat, PowerShell networking cmdlets, or graphical tools like Resource Monitor and TCPView.
Command Prompt: netstat Plus tasklist
The most portable answer is still netstat, because it is present on almost every Windows machine. To check TCP port 8080, run:
Typical output looks like this:
The last column is the PID. Once you have it, ask Windows which process owns it:
That returns the executable name for the process. For many troubleshooting sessions, that two-step flow is enough.
UDP Looks Different
A common point of confusion is that UDP does not show LISTENING the way TCP does. UDP is connectionless, so you usually just look for the bound local port:
You still get a PID in the final column, and you can still use tasklist to identify the process. The absence of the word LISTENING does not mean the UDP port is unused.
PowerShell Is Cleaner for Automation
If you are already in PowerShell, the networking cmdlets are usually easier to read than parsing netstat output.
For TCP:
For UDP:
This is especially useful when you need to fold the check into a script, a deployment step, or a troubleshooting runbook.
You can also print only the fields you care about:
Graphical Options
If you prefer a UI, Windows already ships one useful option and there is also a popular Sysinternals tool.
Resource Monitor
- Press
Win + R - Run
resmon - Open the
Networktab - Expand
Listening Ports - Locate the port and read the image name and PID
TCPView
TCPView from Sysinternals gives you a live process-to-port view with filtering and sorting. It is often faster than raw command output when you are interactively hunting for a conflict.
Services and Shared Host Processes
Sometimes the process you find is svchost.exe or another shared host. In that case, the port is owned by that host process, but the real answer you care about may be the Windows service running inside it.
If you hit that situation, follow up with:
Or inspect the Services tab in Task Manager for that PID. The port owner and the service name are related, but not always identical.
Administrator Rights Can Matter
On some systems, especially when services or protected processes are involved, a normal shell may not show everything clearly. If the output seems incomplete or inconsistent, rerun Command Prompt or PowerShell as Administrator.
That is not always necessary, but it avoids a lot of false conclusions during production debugging.
Common Pitfalls
- Forgetting the
-oflag innetstatremoves the PID, which makes the result much less useful. - Searching for
:80too loosely can also match:8080or similar ports, so inspect the whole row carefully. - Expecting UDP to show
LISTENINGleads to wrong conclusions about whether the port is active. - Stopping at
svchost.execan be misleading because the actual service may still need to be identified. - Running without elevation can hide or limit results on some systems.
Summary
- On Windows, the standard method is port to PID, then PID to process name.
- '
netstat -aonwithtasklistworks almost everywhere.' - PowerShell cmdlets such as
Get-NetTCPConnectionandGet-NetUDPEndpointare cleaner for scripts. - TCP usually shows
LISTENING; UDP usually does not. - If the result points to a shared host process, inspect the underlying service as the next step.

