How to Check if a Port Is Open (5 Methods)

4 min read
Beginner Port Networking Firewall Server

Quick Answer: Use our free Port Scanner for the easiest check. From command line: Windows Test-NetConnection -ComputerName example.com -Port 443 in PowerShell. Mac/Linux nc -zv example.com 443. Locally, check with ss -tlnp | grep :PORT (Linux) or netstat -an | findstr :PORT (Windows).

You set up a service, opened a port in your firewall, and now you need to verify it is actually reachable from the internet. Or you are troubleshooting why a game server, web app, or remote desktop connection is not working.

Here are five ways to check if a port is open, from easiest to most powerful.

Method 1: Online Port Scanner (Easiest)

Use our free Port Scanner — enter an IP address and port number, and it checks instantly whether the port is open from the internet.

When to use: Checking if your own server's port is reachable from outside your network.

This tests from the internet to your server. If you are testing between two devices on the same local network, use the command-line methods below.

Method 2: Telnet

Telnet is built into most operating systems and is the quickest command-line test.

Windows:

First, enable telnet (it is disabled by default):

dism /online /Enable-Feature /FeatureName:TelnetClient

Then test:

telnet example.com 443
  • Connected (blank screen or banner) = port is open
  • Could not open connection = port is closed or filtered

Mac/Linux:

telnet example.com 443

Press Ctrl+] then type quit to exit.

Method 3: PowerShell (Windows)

No need to install anything:

Test-NetConnection -ComputerName example.com -Port 443

Output shows:

TcpTestSucceeded : True    ← port is open
TcpTestSucceeded : False   ← port is closed/filtered

Test multiple ports at once:

@(80, 443, 8080, 3389) | ForEach-Object {
    $result = Test-NetConnection -ComputerName example.com -Port $_ -WarningAction SilentlyContinue
    "$_ : $($result.TcpTestSucceeded)"
}

Method 4: Netcat (nc)

Netcat is the networking Swiss army knife. Available on Mac and Linux by default.

nc -zv example.com 443
  • -z = scan mode (do not send data)
  • -v = verbose output

Output:

Connection to example.com 443 port [tcp/https] succeeded!    ← open
nc: connect to example.com port 443 (tcp) failed: Connection refused    ← closed

Scan a range of ports:

nc -zv example.com 80-443

With timeout (useful for filtered ports):

nc -zv -w 3 example.com 443

Method 5: Nmap (Most Powerful)

Nmap is a full-featured network scanner. Install it first:

# Ubuntu/Debian
sudo apt install nmap

# Mac
brew install nmap

# Windows — download from nmap.org

Scan a single port:

nmap -p 443 example.com

Scan common ports:

nmap example.com

Scan specific range:

nmap -p 80-443 example.com

Nmap port states:

State Meaning
open Port is accepting connections
closed Port is reachable but nothing is listening
filtered Firewall is blocking — nmap cannot determine if open or closed
unfiltered Port is accessible but nmap cannot determine open/closed

Check If Your Own Port Is Open

If you are running a server and want to verify your port is open:

Step 1: Check Locally

First verify the service is actually listening:

Linux/Mac:

ss -tlnp | grep :443

or

netstat -tlnp | grep :443

Windows:

netstat -an | findstr :443

If nothing shows up, your service is not running or not bound to that port.

Step 2: Check Firewall

Linux (UFW):

sudo ufw status | grep 443

Linux (iptables):

sudo iptables -L -n | grep 443

Windows:

netsh advfirewall firewall show rule name=all | findstr "443"

Step 3: Check From Outside

Use our Port Scanner to test from the internet. If the port shows as open locally but closed from outside, the issue is your firewall, router NAT, or ISP blocking.

Common Ports Reference

Port Service Description
22 SSH Secure shell access
80 HTTP Web server (unencrypted)
443 HTTPS Web server (encrypted)
3306 MySQL Database
3389 RDP Windows Remote Desktop
5432 PostgreSQL Database
8080 HTTP Alt Development servers, proxies
8443 HTTPS Alt Alternative HTTPS
25565 Minecraft Game server
27015 Steam Game server

Port Is Closed? Troubleshooting

Issue Fix
Service not running Start the service, check logs
Firewall blocking Open the port in UFW/iptables/Windows Firewall
Router NAT Set up port forwarding — see our Port Forwarding Guide
ISP blocking Some ISPs block ports 25, 80, 443 on residential connections. Use a high port instead
Cloud provider firewall Check AWS Security Groups, Azure NSG, or GCP firewall rules
Wrong IP Make sure you are testing the public IP, not a local 192.168.x.x address

Related Tools