What an open port actually means

A port is a numbered channel on your computer where programs send and receive data from the internet or your local network. When you say a port is "open," you mean a program is actively listening on that port — waiting for incoming connections. Port 80 is where web browsers connect to websites. Port 22 is where remote login tools connect. Port 443 is where encrypted web traffic goes.

Your computer has 65,535 possible ports. Most are closed by default, meaning nothing is listening. When you install a program that needs to receive connections — a game server, a file-sharing tool, a security camera app — it opens a port and listens for traffic. You might need to check whether that port is actually open, either because the program isn't working or because you're troubleshooting a network problem.

The difference between "open" and "closed" matters because it tells you whether a program can actually receive connections from outside your computer. A closed port means incoming traffic gets rejected. An open port means it gets through to the program listening on it.

Key Takeaways

  • On Windows, use the Command Prompt command netstat -ano to see which ports your computer is listening on right now.
  • On Mac or Linux, use the Terminal command lsof -i -P -n to list open ports and which programs are using them.
  • A port showing as "LISTENING" in netstat means a program on your computer is ready to receive connections on that port.
  • To test whether a port is reachable from outside your network, use an online port checker tool with your public IP address, or ask someone outside your network to try connecting.
  • Firewalls and routers can block ports even when a program is listening, so an open port on your computer might still be unreachable from the internet.

Checking open ports on Windows

Open the Command Prompt by pressing Windows key + R, typing cmd, and pressing Enter. Type this command exactly:

netstat -ano

Press Enter. You will see a list of all active connections and listening ports. Look for rows that say LISTENING in the State column. The number in the Local Address column before the colon is the port number. For example, 0.0.0.0:8080 means port 8080 is open and listening. The number at the far right (the PID) tells you which program is using it — you can match that number to a program name by opening Task Manager (Ctrl + Shift + Esc), going to the Details tab, and looking for that PID.

If you want to see the program name directly without checking Task Manager, use this command instead:

netstat -ano | findstr LISTENING

This filters the list to show only listening ports, making it easier to scan.

Checking open ports on Mac and Linux

Open Terminal. On Mac, press Command + Space, type terminal, and press Enter. On Linux, open Terminal from your applications menu. Type this command:

lsof -i -P -n

Press Enter. You will see a list of all network connections and listening ports. Look for rows where the STATE column says LISTEN. The NAME column shows the port number — for example, *:8080 means port 8080 is listening. The COMMAND column at the left shows which program is using it.

If you want to see only listening ports and filter out active connections, use:

lsof -i -P -n | grep LISTEN

This makes the output shorter and easier to read.

Understanding what "listening" means

When netstat or lsof shows a port as LISTENING, it means a program on your computer is actively waiting for incoming connections on that port. This is different from a port being closed, where no program is listening and incoming traffic gets rejected automatically.

However, a port being open on your computer does not automatically mean it is reachable from the internet or from other devices on your network. Your firewall, your router, or your internet service provider can all block traffic to that port even if a program is listening. So a listening port is a necessary condition for connections to work, but not always a sufficient one.

Testing whether a port is reachable from outside your network

To know whether someone outside your network can actually reach a port, you need to test from outside. The simplest way is to use an online port checker tool. Search for "port checker" in your web browser. These tools ask for your public IP address (the address your internet service provider assigns to your home or office) and a port number, then try to connect to that port from their server.

To find your public IP address, search "what is my IP" in your browser. Then enter that IP and the port number into the port checker tool. If it says the port is open, traffic from the internet can reach it. If it says closed or unreachable, either the port is not listening on your computer, or your firewall or router is blocking it.

Another way to test is to ask someone outside your network to try connecting directly. If you are running a game server on port 25565, for example, give them your public IP address and ask them to try joining. If they cannot connect, the port is not reachable from outside, even if netstat shows it as listening.

Why a port might show as listening but still be unreachable

Your Windows Firewall, Mac firewall, or Linux firewall can block outgoing connections to a port even when a program is listening on it. To allow traffic through, you usually need to add the program or the port to your firewall's allow list. On Windows, search for "Windows Defender Firewall" in Settings, click "Allow an app through firewall," and add your program to the list. On Mac, go to System Preferences > Security & Privacy > Firewall Options and add the program there.

Your router can also block ports. If you want devices outside your home network to reach a port on your computer, you may need to set up port forwarding in your router settings. This tells the router to forward incoming traffic on a specific port to your computer's local IP address. The steps vary by router model, but usually involve logging into your router's admin panel (often at 192.168.1.1 or 192.168.0.1) and finding the port forwarding section.

Your internet service provider may also block certain ports for security reasons. Common ports like 25 (email), 80 (web), and 443 (find web) are sometimes blocked on residential connections. If a port checker says a port is closed even though your firewall allows it and your router forwards it, contact your ISP to ask whether they are blocking that port.

Common ports and what they do

Port 22 is used by SSH, a tool for remote login to servers. Port 80 is used by unencrypted web traffic (HTTP). Port 443 is used by encrypted web traffic (HTTPS). Port 3306 is used by MySQL databases. Port 5432 is used by PostgreSQL databases. Port 8080 is a common alternative port for web servers when port 80 is already in use. Port 25565 is the default port for Minecraft servers. Port 27015 is used by many game servers.

If you see a port listening that you do not recognize, search the port number online to find out what program typically uses it. Then check your installed programs to see if something you installed is using that port. If you do not want a program listening on a port, you can usually disable it in the program's settings or uninstall the program entirely.

Frequently Asked Questions

What does "port closed" mean?

A closed port means no program is listening on it. When traffic arrives at a closed port, your computer automatically rejects it. This is the default state for most ports — they are closed unless a program specifically opens them.

Can I close a port that is open?

Yes. If a program is listening on a port you do not want open, you can close it by quitting the program, disabling the feature in the program's settings, or uninstalling the program entirely. You can also block it with your firewall without closing it — the port stays listening, but your firewall prevents outside traffic from reaching it.

Is it dangerous to have open ports?

Open ports are only dangerous if a program listening on them has security flaws that attackers can exploit. A program listening on a port with no known vulnerabilities is safe. If you have a port open that you are not using, closing it removes a potential attack surface, but the risk depends on what program is listening and how well it is maintained.

Why would I need to check if a port is open?

You might check to troubleshoot why a program is not receiving connections, to verify that a server you set up is actually listening, or to find out which program is using a port you see in your network settings. You might also check before opening a port to your firewall, to confirm the program is already listening and ready to receive traffic.

Do I need to open ports for normal internet use?

No. Browsing the web, checking email, and using most everyday programs work fine with all ports closed. You only need to open ports if you are running a server, hosting a game, or using a program that needs to receive incoming connections from other computers.