What it means when a port is open, and why you'd check
A port is a numbered channel that your computer uses to send and receive data. When you visit a website, your browser connects through port 80 (for regular websites) or port 443 (for secure ones). When you run a game server or file-sharing software, it listens on a specific port waiting for incoming connections. A port is open when a program on your computer is actively listening on that port number, ready to accept incoming traffic.
You might need to check if a port is open to troubleshoot why a program isn't working, to verify that a service you set up is actually running, or to confirm that a port you thought you closed is no longer in use. The methods differ depending on whether you want to check a port on your own computer or test whether someone else's computer has a port open.
Key Takeaways
- On Windows, use the Command Prompt command netstat -ano to see all ports your computer is currently listening on.
- On Mac or Linux, use the Terminal command lsof -i -P -n to list open ports and which programs are using them.
- To test whether a remote computer's port is open, use the telnet command or a free online port-checking tool.
- A port showing as "LISTENING" means a program is actively using it; "ESTABLISHED" means an active connection is happening right now.
Checking open ports on your own Windows computer
The fastest way to see which ports are open on your Windows machine is through Command Prompt. Open Command Prompt by pressing the Windows key, typing cmd, and pressing Enter. Type this command exactly:
netstat -ano
Press Enter. You will see a list with columns labeled "Proto", "Local Address", "Foreign Address", "State", and "PID". Look at the "State" column. Any port showing "LISTENING" is currently open and waiting for connections. The number after the colon in the "Local Address" column is the port number — for example, 127.0.0.1:8080 means port 8080 is open on your computer.
To find out which program is using a specific port, look at the PID (Process ID) number in the rightmost column. Open Task Manager by pressing Ctrl+Shift+Esc, click the "Processes" tab, then look for that PID number in the list. The program name in that row is what is using that port. If you do not see a PID column in Task Manager, click "View" at the top and check "PID".
Checking open ports on Mac or Linux
Open Terminal on your Mac or Linux computer. Type this command:
lsof -i -P -n
Press Enter. This shows every open port on your computer along with the program name using it. The "NAME" column shows the port number and connection state. Look for entries that say "LISTEN" — those are ports currently open. The "COMMAND" column on the left tells you which program is listening on that port.
If you want to see only ports in the LISTEN state and filter out established connections, you can use this command instead:
lsof -i -P -n | grep LISTEN
Testing whether a remote computer's port is open
If you want to check whether a specific port is open on someone else's computer (or a server), you can use the telnet command. Open Command Prompt on Windows or Terminal on Mac/Linux and type:
telnet [computer address] [port number]
Replace [computer address] with the IP address or domain name, and [port number] with the port you want to test. For example:
telnet 192.168.1.100 8080
If the port is open, the window will go blank or show a blinking cursor. If the port is closed, you will see a message like "Could not open connection" or the window will close immediately. This tells you whether that port is reachable from your computer.
On Windows, telnet may not be installed by default. If you get a "command not found" error, you can use an online port-checking tool instead — search for "port checker" and enter the IP address and port number. These tools test from their own servers whether your port is reachable from the internet.
Understanding port states and what they mean
When you run netstat or lsof, you will see different states listed for each connection. LISTENING means a program is open and waiting for incoming connections on that port — this is the state that matters when you are checking if a port is open. ESTABLISHED means an active connection is happening right now between your computer and another computer. TIME_WAIT or CLOSE_WAIT means a connection recently closed but the port is not yet fully released.
If you are looking for a specific port and do not see it in the list at all, that port is closed — no program is listening on it. If you expected a port to be open and it is not showing up, the program that should be using it may not be running, or it may be configured to listen on a different port number.
Why a port might not be open even when the program is running
A program can be running but still not have an open port if it is not configured to listen for incoming connections. Some programs only make outgoing connections and never listen. Other programs might be set to listen only on localhost (127.0.0.1), which means they accept connections from your own computer but not from other computers on the network.
If you are trying to set up a service and the port is not showing as open, check the program's settings or configuration file to confirm it is set to listen on the correct port and on the correct network interface. Firewall rules can also block a port — the program might be listening, but Windows Defender Firewall or another firewall could be preventing outside traffic from reaching it.
Frequently Asked Questions
How do I know if a port is open or just in use?
A port showing "LISTENING" in netstat or lsof is open — it means a program is actively waiting for incoming connections. A port showing "ESTABLISHED" is in use for an active connection right now. Both mean the port is occupied. If a port does not appear in the list at all, it is closed.
Can I close a port that is open?
Yes. Find which program is using the port (using the PID or command name), then close that program. The port will close automatically once the program stops running. Do not force-close system ports like 80 or 443 unless you know what you are doing, as they may be needed for your internet connection.
What does "connection refused" mean when I test a port?
It means the port is closed — no program is listening on it. The computer received your request but had nothing to respond with. This is different from no response at all, which usually means a firewall is blocking the connection.
Why do I see ports I did not open?
Many programs and Windows services open ports automatically when they run. Windows Update, antivirus software, cloud backup tools, and other background services all use ports. This is normal. If you see a port you do not recognize, search the PID or program name to learn what it does.
Is checking open ports on my own computer safe?
Yes. Running netstat or lsof on your own computer is completely safe — you are just viewing information about what is already running. Testing remote ports with telnet is also safe; you are only checking whether a connection is possible, not accessing any data.