TL;DR — Quick Summary

Find which Windows application is using a specific port using netstat, PowerShell Get-NetTCPConnection, Resource Monitor, and TCPView. Resolve port conflicts and free up ports for your services.

Finding Which Application Uses a Specific Port on Windows

Port conflicts are one of the most common issues when running multiple services on Windows. When you get “port already in use” or a service fails to start, you need to identify which process is occupying the port.

Method 1: netstat (Command Prompt)

Open an elevated Command Prompt (Run as Administrator):

netstat -ano | findstr :80

Output example:

  TCP    0.0.0.0:80    0.0.0.0:0    LISTENING    4
  TCP    0.0.0.0:443   0.0.0.0:0    LISTENING    4

The last column is the PID (Process ID). Find the process name:

tasklist | findstr 4

Useful netstat Flags

FlagDescription
-aShow all connections and listening ports
-nShow addresses and port numbers numerically
-oShow the owning process PID
-bShow the executable name (requires admin)
-p TCPShow only TCP connections
:: Show all listening ports with process names
netstat -anob | findstr LISTENING

:: Show only TCP connections on a specific port
netstat -ano -p TCP | findstr :8080

:: Show all established connections
netstat -ano | findstr ESTABLISHED

PowerShell provides a cleaner one-liner:

# Find which process uses port 80
Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess

# Show details with port state
Get-NetTCPConnection -LocalPort 80 | Select-Object LocalPort, State, OwningProcess, @{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}

# Find all listening ports
Get-NetTCPConnection -State Listen | Select-Object LocalPort, OwningProcess, @{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | Sort-Object LocalPort

# Check UDP ports
Get-NetUDPEndpoint -LocalPort 53 | Select-Object LocalPort, OwningProcess

Method 3: Resource Monitor (GUI)

  1. Press Win+R, type resmon, press Enter.
  2. Click the Network tab.
  3. Expand Listening Ports.
  4. Sort by Port to find the process using your port.

Method 4: TCPView (Sysinternals)

Download TCPView from Sysinternals. It provides a real-time GUI showing all TCP/UDP connections, their state, and the process using them. You can right-click to kill a process directly.


Commonly Conflicting Ports

PortCommon Services
80IIS, Apache, Nginx, Skype (legacy)
443IIS, Apache, Nginx (HTTPS)
3306MySQL, MariaDB
5432PostgreSQL
1433SQL Server
8080Tomcat, development servers, proxies
3000Node.js (Express, React dev)
5000Python (Flask), Docker Registry
3389Remote Desktop (RDP)
53DNS (Windows DNS Server, Pi-hole)

Freeing Up a Port

Stop the Process

:: Force kill by PID
taskkill /PID 1234 /F

:: Kill by process name
taskkill /IM httpd.exe /F

Stop a Windows Service

:: Stop IIS
net stop w3svc

:: Stop a specific service
net stop "Service Name"

Or use services.msc to stop the service graphically.

Check from Outside (Remote Port Test)

# PowerShell
Test-NetConnection -ComputerName 192.168.1.100 -Port 80

# CMD
telnet 192.168.1.100 80