|

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

GoalCommand
Show active TCP connectionsnetstat
Show connections and listening portsnetstat -a
Show numbers instead of names, with the process IDnetstat -ano
Show the program behind each connectionnetstat -b (run as administrator)
Refresh the list every 5 secondsnetstat -o 5
Match a process ID to a program nametasklist /fi "PID eq 1234"

Open Command Prompt

  1. Select Start and type cmd.
  2. Select Command Prompt from the results.
  3. 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

ColumnMeaning
ProtoThe protocol, TCP or UDP
Local AddressYour PC’s IP address and port for that connection
Foreign AddressThe remote address and port, or an asterisk when nothing is connected yet
StateThe TCP connection state, such as ESTABLISHED or LISTENING
PIDThe 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.

  1. Run netstat -ano and note the number in the PID column for the line you care about.
  2. 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

OptionWhat it does
-aShows all connections and listening ports
-nShows addresses and ports numerically
-oAdds the process ID to each line
-bShows the executable behind each connection; needs administrator rights
-p tcpShows only one protocol: tcp, udp, tcpv6 or udpv6
-eShows Ethernet statistics such as bytes and packets sent and received
-sShows statistics for each protocol
-rShows 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

CommandResult
netstat -e -sEthernet statistics plus statistics for all protocols
netstat -s -p tcp udpStatistics for TCP and UDP only
netstat -n -oActive TCP connections in numeric form, with process IDs
netstat -o 5Active TCP connections with process IDs, refreshed every 5 seconds
netstat -anobqAll 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

CommandWhat it shows
tasklistEvery running process in a table
tasklist /fi "PID eq 1234"Only the process with that ID
tasklist /svcThe services running inside each process
tasklist /vVerbose 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

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.

Official sources

Leave a Reply

Your email address will not be published. Required fields are marked *