
How to Check If a Port Is Open: Complete Troubleshooting Guide
Whether you're setting up a game server, configuring remote access, troubleshooting a connection that won't work, or verifying your firewall settings, knowing how to check if a network port is open is an essential skill. A closed or blocked port is one of the most common causes of connection failures, and diagnosing port issues can save you hours of frustration.
In this guide, we'll walk through every method for checking port status, from quick online tools to powerful command-line utilities, and cover how to troubleshoot when ports aren't behaving as expected.
Understanding Ports: A Quick Refresher
Think of an IP address as a street address, and ports as apartment numbers at that address. Your computer has 65,535 available TCP ports and 65,535 UDP ports. Each port can be used by a different service or application.
Port states:
- Open: The port is actively listening for connections. A service is running and accepting traffic.
- Closed: No service is listening on the port. The system acknowledges connection attempts but refuses them.
- Filtered/Blocked: A firewall is preventing connection attempts from even reaching the port. There's no response at all, making it unclear whether the port is open or closed behind the firewall.
Common ports you should know:
| Port | Service | Protocol |
|---|---|---|
| 21 | FTP | TCP |
| 22 | SSH | TCP |
| 25 | SMTP (email sending) | TCP |
| 53 | DNS | TCP/UDP |
| 80 | HTTP | TCP |
| 443 | HTTPS | TCP |
| 3306 | MySQL | TCP |
| 3389 | Remote Desktop (RDP) | TCP |
| 5432 | PostgreSQL | TCP |
| 8080 | HTTP Alternative | TCP |
| 25565 | Minecraft Server | TCP |
| 27015 | Steam/Source Games | TCP/UDP |
Method 1: Use an Online Port Scanner (Easiest)
The quickest way to check if a port is open on your public IP is to use our Port Scanner tool. It scans ports from outside your network, showing you exactly what the rest of the internet can see.
Steps:
- Visit our Port Scanner tool
- Your public IP address is automatically detected
- Enter the port number(s) you want to check
- Click scan and review the results
Why use an online scanner? When you test ports from inside your network, you might get misleading results because your firewall may treat local traffic differently from external traffic. An online scanner tests from the outside, giving you the real picture of what others can connect to.
What the results mean:
- Open: The port is accepting connections from the internet. If this is intentional (you're running a web server), great. If not, you may have a security issue.
- Closed: The port is reachable but no service is listening. The system responded with a RST (reset) packet.
- Filtered/Timeout: A firewall is likely blocking the port. No response was received.
Method 2: Using Telnet
Telnet is a simple built-in tool that can test whether a TCP port is reachable. While telnet is primarily a remote access protocol, it's commonly used as a quick port-testing utility.
On Windows:
First, enable Telnet (it's disabled by default):
- Open Control Panel > Programs > Turn Windows features on or off
- Check Telnet Client and click OK
Then test a port:
telnet hostname_or_ip port_numberExample:
telnet google.com 443Interpreting results:
- Blank screen or connection text: The port is open
- "Could not open connection" or "Connection refused": The port is closed
- Long wait, then timeout: The port is filtered by a firewall
On macOS/Linux:
telnet hostname_or_ip port_numberIf telnet isn't installed on your Linux distribution:
sudo apt install telnet # Debian/Ubuntu
sudo yum install telnet # CentOS/RHELMethod 3: Using Netcat (nc)
Netcat is often called the "Swiss army knife" of networking. It's more versatile than telnet and available on most Unix-like systems.
Basic port check:
nc -zv hostname_or_ip port_numberFlags:
-z: Zero I/O mode (just scan, don't send data)-v: Verbose output
Check a range of ports:
nc -zv hostname_or_ip 80-443Check with a timeout (useful for filtered ports):
nc -zv -w 3 hostname_or_ip 8080Results:
Connection to hostname_or_ip 80 port [tcp/http] succeeded! # Port is OPEN
nc: connect to hostname_or_ip port 81 (tcp) failed: Connection refused # Port is CLOSED
nc: connect to hostname_or_ip port 82 (tcp) timed out # Port is FILTEREDMethod 4: Using PowerShell (Windows)
PowerShell has a built-in cmdlet for testing network connections:
Test-NetConnection -ComputerName hostname_or_ip -Port port_numberExample:
Test-NetConnection -ComputerName google.com -Port 443This gives you detailed output including:
- Whether the TCP connection succeeded
- Remote address and port
- Interface and source address used
- Round-trip time
For a quicker check:
(Test-NetConnection -ComputerName google.com -Port 443).TcpTestSucceededThis returns simply True or False.
Method 5: Using Nmap (Advanced)
Nmap is the industry-standard port scanning tool. It's more powerful and flexible than the methods above but requires installation.
Install Nmap:
- Windows/macOS: Download from nmap.org
- Linux:
sudo apt install nmaporsudo yum install nmap
Scan specific ports:
nmap -p 80,443,8080 hostname_or_ipScan a range of ports:
nmap -p 1-1000 hostname_or_ipScan all 65,535 ports:
nmap -p- hostname_or_ipService detection (identify what's running on open ports):
nmap -sV -p 80,443 hostname_or_ipNmap port states:
open: Service is accepting connectionsclosed: Port is reachable but nothing is listeningfiltered: Firewall is blocking the scanunfiltered: Port is reachable but nmap can't determine if it's open or closedopen|filtered: Nmap can't determine which of the two states applies
Important: Only scan systems you own or have permission to scan. Unauthorized port scanning may violate laws and terms of service.
Method 6: Check Locally with Netstat/SS
If you want to check what ports are open on your own machine (not remotely), use netstat or ss.
On Windows:
netstat -an | findstr LISTENINGOn macOS:
netstat -an | grep LISTENOn Linux (ss is preferred over netstat):
ss -tlnpFlags:
-t: TCP connections-l: Listening sockets only-n: Show port numbers (not service names)-p: Show the process using each port
This shows which services are listening on which ports locally, which is essential for verifying that your server software is actually running before troubleshooting external connectivity.
Troubleshooting: Port Won't Open
If a port that should be open is showing as closed or filtered, work through this checklist:
1. Is the Service Actually Running?
Before blaming the network, verify the service is running:
# Linux
ss -tlnp | grep :PORT_NUMBER
# Windows
netstat -an | findstr :PORT_NUMBERIf nothing shows up listening on that port, start the service first.
2. Check the Local Firewall
Windows Firewall:
- Open Windows Defender Firewall > Advanced settings
- Check Inbound Rules for the port
- Add a new rule if needed: New Rule > Port > specify the port number > Allow the connection
Linux (ufw):
sudo ufw status
sudo ufw allow PORT_NUMBER/tcpLinux (firewalld):
sudo firewall-cmd --list-ports
sudo firewall-cmd --add-port=PORT_NUMBER/tcp --permanent
sudo firewall-cmd --reloadmacOS:
Check System Settings > Network > Firewall and ensure it's not blocking incoming connections for your application.
3. Check Router Port Forwarding
If you're trying to make a service accessible from the internet, you need port forwarding configured on your router:
- Log into your router's admin panel (usually 192.168.0.1 or 192.168.1.1)
- Find the port forwarding section (may be under "NAT," "Virtual Server," or "Applications")
- Create a rule forwarding the external port to your device's internal IP and port
- Save and reboot the router if prompted
After configuring, verify with our Port Scanner tool from outside your network.
4. Check ISP Restrictions
Some ISPs block common ports, especially:
- Port 25 (SMTP): Blocked by most residential ISPs to prevent spam
- Port 80 (HTTP) and 443 (HTTPS): Sometimes blocked on residential connections
- Port 445 (SMB): Commonly blocked for security reasons
If your ISP blocks a port, you can often use an alternative port number and configure your service accordingly.
5. Trace the Connection Path
Use Traceroute to see where packets travel between you and the destination. If packets are being dropped at a specific hop, it can indicate where the blocking is occurring.
Security Best Practices
- Only open ports you actively need. Every open port is a potential attack surface.
- Regularly audit open ports using our Port Scanner and close anything unnecessary.
- Use non-standard ports for services like SSH (change from 22 to a higher number) to reduce automated attack attempts.
- Keep services updated to patch known vulnerabilities.
- Use fail2ban or similar tools to block repeated failed connection attempts.
Key Takeaways
- Use our Port Scanner for quick external port checks from outside your network
- Telnet, netcat, and PowerShell's Test-NetConnection are great for testing specific ports
- Nmap is the most powerful tool for comprehensive scanning
- If a port appears closed, check: service status, local firewall, router forwarding, and ISP restrictions in that order
- Only open ports you actually need, and audit them regularly
Related Articles:
WhatIsMyLocation Team
Our team of network engineers and web developers builds and maintains 25+ free networking and location tools used by thousands of users every month. Every article is reviewed for technical accuracy using real-world testing with our own tools.
Related Articles
Try Our Location Tools
Find your IP address, GPS coordinates, and more with our free tools.