How To See Active Network Connections With Netstat (2026)
Netstat is a built-in Windows command that lists the connections your PC has open and the ports it is listening on.
It is the quickest way to see which program is talking to the network and which program is holding a port.
It runs in Command Prompt on Windows 11, and Microsoft documents every option on Microsoft Learn.
Quick answer
| Goal | Command |
|---|---|
| Show active TCP connections | netstat |
| Show connections and listening ports | netstat -a |
| Show numbers instead of names, with the process ID | netstat -ano |
| Show the program behind each connection | netstat -b (run as administrator) |
| Refresh the list every 5 seconds | netstat -o 5 |
| Match a process ID to a program name | tasklist /fi "PID eq 1234" |
Open Command Prompt
- Select Start and type cmd.
- Select Command Prompt from the results.
- Type a command and press Enter.
Most netstat options work without administrator rights.
The -b option is the exception, so right-click Command Prompt and select Run as administrator when you need it.
See your active connections
Type netstat on its own to list the active TCP connections.
Add -a to include every TCP connection and the TCP and UDP ports your PC is listening on.
Add -n to show addresses and port numbers as numbers, which is faster because Windows skips the name lookups.
The command netstat -an is a good everyday starting point.
What the columns mean
| Column | Meaning |
|---|---|
| Proto | The protocol, TCP or UDP |
| Local Address | Your PC’s IP address and port for that connection |
| Foreign Address | The remote address and port, or an asterisk when nothing is connected yet |
| State | The TCP connection state, such as ESTABLISHED or LISTENING |
| PID | The process ID, shown only when you add -o |
Microsoft lists the possible states as CLOSE_WAIT, CLOSED, ESTABLISHED, FIN_WAIT_1, FIN_WAIT_2, LAST_ACK, LISTEN, SYN_RECEIVED, SYN_SEND and TIME_WAIT.
ESTABLISHED means a live connection, and LISTENING means a program is waiting for incoming connections on that port.
Find which program uses a connection
There are two ways to link a connection to a program.
- Run
netstat -anoand note the number in the PID column for the line you care about. - Run
tasklist /fi "PID eq 1234", replacing 1234 with that number, to see the program name.
Microsoft’s netstat page says you can also look the process ID up in Task Manager.
The other way is netstat -b, which shows the executable that created each connection or listening port.
Microsoft warns that -b can take a while and fails without enough permissions, so run it as administrator.
Find what is using a specific port
When an app says a port is already in use, list the ports with netstat -ano and look for the port number after the colon in the Local Address column.
To show only matching lines, type netstat -ano | findstr :8080, replacing 8080 with your port.
Findstr is a separate built-in command that prints only the lines containing your text.
The PID on the matching line tells you which process holds the port, and tasklist turns that PID into a name.
Useful netstat options
| Option | What it does |
|---|---|
-a | Shows all connections and listening ports |
-n | Shows addresses and ports numerically |
-o | Adds the process ID to each line |
-b | Shows the executable behind each connection; needs administrator rights |
-p tcp | Shows only one protocol: tcp, udp, tcpv6 or udpv6 |
-e | Shows Ethernet statistics such as bytes and packets sent and received |
-s | Shows statistics for each protocol |
-r | Shows the IP routing table, the same as route print |
5 (a number at the end) | Repeats the output every 5 seconds until you press Ctrl+C |
Microsoft gives netstat -anobq as an example that combines several of these at once.
Examples from Microsoft
| Command | Result |
|---|---|
netstat -e -s | Ethernet statistics plus statistics for all protocols |
netstat -s -p tcp udp | Statistics for TCP and UDP only |
netstat -n -o | Active TCP connections in numeric form, with process IDs |
netstat -o 5 | Active TCP connections with process IDs, refreshed every 5 seconds |
netstat -anobq | All connections and listening and bound ports, numeric, with the PID and the executable |
The -q option adds bound ports that are not listening, and those may or may not have an active connection.
Microsoft’s page does not document the -t, -x or -y switches, so run netstat /? to see what your version supports.
Useful tasklist filters
| Command | What it shows |
|---|---|
tasklist | Every running process in a table |
tasklist /fi "PID eq 1234" | Only the process with that ID |
tasklist /svc | The services running inside each process |
tasklist /v | Verbose details for each task |
The /svc option helps when the process is a shared system host and you need to know which service it is running.
What to do with what you find
- If a program you do not recognize holds a connection, look up its name before you end it.
- If a trusted app is blocked, see how to allow an app through Windows Firewall.
- If a connection looks slow or drops, test it with ping and tracert.
- If you need your own addresses to read the list, see how to find your IP and MAC address.
A long list of connections is normal, because browsers, Windows and background apps all open many at once.
Netstat shows what is connected right now, so run it again when the problem is happening.