sodcalculator

10 Tech How-To

How to Find Port Numbers in Windows 10

Guide 10-60162 · Updated · Step by step

Finding the port number a program or service uses on Windows 10 is essential for configuring firewalls, port forwarding, or troubleshooting connection issues. This guide shows you several built-in methods to identify listening ports, the processes using them, and the port numbers for common services.

What You’ll Need

  • A Windows 10 PC with administrator access (needed for some commands).
  • Command Prompt or PowerShell (both included with Windows).
  • The name of the program or service you’re investigating (optional but helpful).

Step-by-Step

Method 1: Using netstat (Command Prompt or PowerShell)

  1. Press Windows Key + R, type cmd, and press Enter. For administrator rights, press Ctrl + Shift + Enter instead.
  2. Type netstat -ano and press Enter. This lists all active connections and listening ports. The -a shows all ports, -n displays addresses numerically (faster), and -o shows the owning process ID (PID).
  3. Look at the Local Address column. The number after the colon is the port number. For example, 0.0.0.0:443 means port 443.
  4. To find which program owns a specific port, note the PID in the far-right PID column.
  5. Open Task Manager (Ctrl + Shift + Esc), go to the Details tab, and find the PID you noted. The Image name column shows the program.

Method 2: Filtering netstat Output

  1. Open Command Prompt as in Method 1.
  2. To see only listening ports (ports waiting for connections), type netstat -ano | findstr LISTENING and press Enter.
  3. To search for a specific port, replace PORT with the number: netstat -ano | findstr :PORT. For example, netstat -ano | findstr :8080.
  4. To find a specific program, first get its PID from Task Manager, then type netstat -ano | findstr PID.

Method 3: Using Get-NetTCPConnection in PowerShell

  1. Open PowerShell by pressing Windows Key + X and selecting Windows PowerShell (or Admin version).
  2. Type Get-NetTCPConnection -State Listen and press Enter. This shows all listening TCP ports with their owning process IDs.
  3. To see UDP ports (used for streaming, DNS, etc.), type Get-NetUDPEndpoint and press Enter.
  4. To filter by port, use: Get-NetTCPConnection -LocalPort 443. Replace 443 with your port.
  5. To see the program name alongside, type: Get-NetTCPConnection -State Listen | Select-Object LocalPort, OwningProcess then cross-reference with Task Manager as in Method 1.

Method 4: Using Resource Monitor

  1. Press Windows Key + R, type resmon, and press Enter.
  2. Click the Network tab.
  3. Click Listening Ports at the bottom. This shows a table with the port number, protocol, and the program name (no need to match PIDs manually).

Method 5: Finding Default Ports for Known Services

  1. If you just need the standard port for a common service (web server, email, database), check the service’s documentation or use these common defaults:
  2. HTTP: 80, HTTPS: 443, FTP: 21, SSH: 22, SMTP: 25, DNS: 53, MySQL: 3306, PostgreSQL: 5432, RDP: 3389.
  3. For Windows-specific services, open Services (type services.msc in Run), right-click a service, select Properties, and look at the Path to executable – though this doesn’t always show the port, you can then search that executable in netstat.

Common Mistakes

  • Confusing TCP and UDP: Some programs use both, but netstat shows them separately. Always check the protocol column.
  • Forgetting the PID: Without -o in netstat, you can’t identify which program owns the port.
  • Not running as administrator: Some ports (below 1024) and other users’ processes won’t show without admin rights.
  • Looking at the wrong column: The Local Address is your machine’s port; the Foreign Address is the remote end (often 0.0.0.0 or a public IP).
  • Assuming a port is unique: A single program can listen on multiple ports; a single port can be used by multiple processes (though not simultaneously for TCP).
  • Using netstat without refreshing: The output is a snapshot; if a program starts or stops, run the command again.

Tips

  • Use netstat -ab (requires admin) to show the executable name directly next to each port, saving you the PID lookup step.
  • To continuously monitor ports, use netstat -ano 5 which refreshes every 5 seconds (press Ctrl+C to stop).
  • Export netstat results to a file for later analysis: netstat -ano > ports.txt.
  • In PowerShell, you can combine commands: Get-NetTCPConnection -State Listen | Where-Object {$_.LocalPort -gt 1000} to see only high ports.
  • If you’re troubleshooting a game or app, check its official documentation – many games list required ports for multiplayer.
  • Use netstat -an | findstr /i "established" to see only active connections rather than listening ports.

Troubleshooting

  • netstat shows nothing or an error: Make sure you typed the command correctly (no typos). If it says “requested operation requires elevation,” close and reopen Command Prompt as administrator.
  • Port appears but you can’t identify the program: The PID might belong to a system process (like svchost.exe). Right-click that process in Task Manager and select “Go to service(s)” to see which Windows service is responsible.
  • Port shows in netstat but you can’t connect to it: Check Windows Firewall – even if a program listens, the firewall may block external connections. Go to Windows Defender Firewall > Advanced settings > Inbound Rules and look for a rule for that port or program.
  • Multiple PIDs for the same port: This can happen with UDP or when a program spawns child processes. Check each PID in Task Manager.
  • Port not showing at all: The program may not be running, or it may be listening on a different interface (e.g., only on 127.0.0.1). Use netstat -ano | findstr 0.0.0.0 to see all listening addresses.
  • Getting “Access denied” in PowerShell: Run PowerShell as administrator (right-click > Run as administrator).

Frequently Asked Questions

Q: What is the difference between a port number and an IP address?
A: An IP address identifies a device on a network, while a port number identifies a specific service or process on that device. Think of the IP as a building address and the port as an apartment number within it.

Q: How do I find the port number for a specific game?
A: Start the game, then open Command Prompt and run netstat -ano. Look for the game’s executable name (or its PID) in the output. The Local Address column will show which ports it’s using. Many games also list required ports in their support documentation.

Q: Can two programs use the same port number at the same time?
A: For TCP, no – only one process can listen on a given port on a specific IP address at a time. For UDP, multiple programs can bind to the same port in some cases, but it’s rare and can cause issues. If you see “address already in use,” that means the port is taken.

Q: What does port 0 mean in netstat output?
A: Port 0 is not a real listening port. It appears when a client is waiting for a response or when the system hasn’t assigned a specific port yet. It’s normal during connection setup.

Q: How do I find which port a website uses?
A: Standard websites use port 80 (HTTP) or 443 (HTTPS). To check a specific site, open Command Prompt and type ping example.com to get the IP, then netstat -an | findstr IP after visiting the site. However, most browsers handle this automatically – you rarely need to know the port manually.

Q: Is it safe to change a program’s port number?
A: Yes, if the program allows it (most servers do). However, you must update any clients, firewall rules, and port forwarding settings accordingly. Some ports are reserved for system services (0-1023), so choose a higher number like 8080 or 3000 for custom applications.

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 →