sodcalculator

10 Tech How-To

How to Check Ports in Use on Windows 10

Guide 10-46311 · Updated · Step by step

This guide shows you how to see which TCP and UDP ports are currently active on your Windows 10 PC, and which program or process is holding each one. You’ll use built-in command-line tools—no extra software required—to identify port conflicts, find the PID of a process, and free up a port if needed.

What You’ll Need

  • A Windows 10 PC with administrator access (needed for some steps).
  • Basic comfort with the Command Prompt or PowerShell.

Step-by-Step

  1. Open Command Prompt or PowerShell. Press Win + R, type cmd, and press Enter. For full details (including the process name), right-click the result and choose “Run as administrator.” Alternatively, search for “PowerShell” in the Start menu and open it.
  2. List all active ports. Type the following and press Enter:
    netstat -ano
    This shows all active TCP and UDP connections and listening ports. The -a flag displays all connections and listening ports, -n shows addresses and port numbers in numeric form (faster), and -o includes the owning process ID (PID).
  3. Find a specific port. To filter for a particular port (e.g., port 8080), use:
    netstat -ano | findstr :8080
    This returns only lines that contain “:8080”. You’ll see the local address, state (LISTENING, ESTABLISHED, etc.), and the PID.
  4. Identify the process using the port. Take the PID from the last column of the netstat output. Then type:
    tasklist | findstr [PID]
    Replace [PID] with the actual number. This shows the executable name (e.g., chrome.exe).
  5. Get more detail with PowerShell (optional). In PowerShell, you can run:
    Get-NetTCPConnection -LocalPort 8080 | Select-Object LocalAddress,LocalPort,State,OwningProcess
    Then match the PID with Get-Process -Id [PID] to see the process name and path.
  6. Check UDP ports as well. UDP doesn’t have connection states, but you can still see listening UDP ports with:
    netstat -ano -p udp
    Or in PowerShell: Get-NetUDPEndpoint.
  7. Free a port (if needed). If you need to release a port held by a process you recognize (and you’re sure it’s safe), note the PID and run:
    taskkill /PID [PID] /F
    This forcefully terminates the process. Use with caution—only kill processes you know are safe to close.

Common Mistakes

  • Forgetting the -o flag. Without it, netstat doesn’t show PIDs, so you can’t identify the process.
  • Mixing up PID and port. The PID is the number in the far-right column, not the port number after the colon.
  • Not running as administrator. Some ports (especially those below 1024) may not show full details or may be hidden without admin rights.
  • Assuming “LISTENING” means the port is open to the internet. A listening port is open on your machine, but firewalls may block external access.
  • Killing the wrong process. Always verify the process name and path before using taskkill.

Tips

  • Use netstat -ab to show the executable name directly under each connection—but it can be slow and requires admin rights.
  • To see all listening ports only, use netstat -ano | findstr LISTENING.
  • For a live, refreshing view, install the free TCPView tool from Microsoft Sysinternals (not required, but handy).
  • If you’re troubleshooting a “port already in use” error, check both TCP and UDP—the conflict might be on the other protocol.
  • Remember that some system processes (like svchost.exe) may hold many ports; that’s normal.

Troubleshooting

  • netstat says “Access is denied.” Run the command prompt as administrator. Some info (like process names with -b) requires elevated rights.
  • You can’t see the process name with tasklist. The PID might belong to a system process. Try tasklist /svc /FI "PID eq [PID]" to see services, or use PowerShell’s Get-Process -Id [PID] | Select-Object *.
  • The port doesn’t show up even though a program says it’s in use. The program might be listening on a different interface (e.g., only on 127.0.0.1). Use netstat -ano | findstr [port] and check the local address column.
  • You see many TIME_WAIT connections. That’s normal after heavy network activity; they clear up on their own.
  • You can’t kill the process. Try taskkill /F /PID [PID] as administrator. If it still fails, the process might be protected—reboot and try again.

Frequently Asked Questions

What is a port in Windows networking?

A port is a virtual endpoint for network communication. Each service or program that uses the network listens on a specific port number (0–65535) to receive data.

How do I see which ports are listening?

Run netstat -ano | findstr LISTENING in Command Prompt. This shows all ports in the LISTENING state, along with the PID.

What does PID mean in netstat output?

PID stands for Process Identifier—a unique number Windows assigns to each running process. It lets you match a port to the program using it.

Can I check ports without command line?

Yes. You can use the Resource Monitor (search “resmon” in Start, go to Network tab, then Listening Ports). Third-party tools like TCPView also provide a graphical interface.

Is it safe to kill a process to free a port?

Only if you know what the process does. Killing a system process can cause instability. Always verify the process name and path first.

Why does my firewall show a port as open but netstat doesn’t?

Firewall rules can allow inbound traffic even if no program is currently listening. netstat only shows active ports, not firewall rules.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →