How to Find Which Process Is Using a Port in Windows 11
Finding out which process is using a particular network port helps when a port is already in use and blocking an application, a common situation for developers and when troubleshooting network services. Windows 11 can reveal the owning process with a couple of commands.
The Command
netstat -ano | findstr :8080
What It Does
`netstat -ano` lists all network connections with their ports and the process ID using each. Piping to `findstr :8080` filters that list to lines mentioning port 8080. The last number on each matching line is the PID of the YYGACOR process using that port. This tells you which process ID has the port occupied.
When You’d Use This
This is invaluable when starting a server or application fails because a port is already in use, a frequent frustration for developers. It identifies exactly which process holds the port so you can decide whether to stop it or use a different port. It is also useful for auditing what is listening on your system’s network ports.
Useful Variations
Replace 8080 with whichever port you are investigating. Once you have the PID, find the process name with `tasklist /FI “PID eq 1234″`, substituting the actual number. In PowerShell, `Get-NetTCPConnection -LocalPort 8080` shows the same information more directly, including the owning process ID for that port.
If It Doesn’t Work
If nothing appears, the port may not be in use, or you may need to check both the listening and established states. If you find the PID but not the program, look it up with `tasklist /FI “PID eq NUMBER”`. Some system-level ports require an administrator terminal to inspect fully, so run elevated if the results seem incomplete or a known-used port shows nothing.
Good to Know
The `-ano` flags matter: `a` shows all connections, `n` shows numeric addresses and ports, and `o` includes the owning PID. If nothing appears, the port may not be in use. Some system-level ports require administrator rights to inspect fully, so run the terminal as administrator if results seem incomplete.
Putting It Together
Once you have run it once or twice, this becomes second nature. As part of understanding and controlling what runs on your PC, this command is one you will return to whenever the system feels slow or a program misbehaves. Paired with the related process commands, it gives you a full command-line alternative to Task Manager for diagnosing and managing what is running. Like anything in the terminal, the real value comes from trying it on your own system and adapting the variations above to what you actually need, so it is worth experimenting with in a safe, low-stakes situation before relying on it in a script or during troubleshooting. Keeping a note of the commands you find most useful, along with the variations that fit your workflow, turns scattered one-off tricks into a personal reference you can draw on whenever a similar task comes up again.