Add to Chrome Add to Edge

How to Check Whether a Port Is Open

How to Check Whether a Port Is Open

Test whether a port is open from outside your network or on your own machine, understand open, closed and filtered results, and fix ports that are blocked.

To check whether a port is open from the internet, enter your public IP address or domain and the port number into an online open port checker: it tries to connect from outside your network and tells you if anything answered. To test from your own computer, run Test-NetConnection example.com -Port 443 in PowerShell on Windows, or nc -zv example.com 443 in Terminal on Mac and Linux.

Before you run anything, decide which question you are asking, because the two have different answers and mixing them up causes most of the confusion around ports.

Two different questions

  • Can the internet reach this port? You set up port forwarding for a game server, a camera or a home web server, or you opened a firewall rule on a VPS, and you want to know whether people outside can connect. Only a test from outside your network answers this. A test from inside your own network can succeed even when the router blocks everyone else.
  • Is a program listening on this computer? You want to know whether your web server, database or app has started and grabbed its port, or which program is already using it. That is answered on the machine itself with netstat, ss or lsof.

A port is "open" only when both are true: a program is listening, and nothing in between (firewall, router, ISP, cloud security group) drops the connection.

Check a port from outside, online

  1. Open the Open Port Checker.
  2. Enter a domain or a public IP address. To test your home connection, copy your public IP from What's My IP; the 192.168.x.x address your computer shows is private and cannot be reached from the internet (our guide to public vs private IP addresses explains why).
  3. Type the port number, or click one of the common ports, such as 22, 80, 443 or 3306.
  4. Click Check Port.

The check runs from our server, not from your browser. It resolves the name, refuses private and reserved addresses, then tries a TCP connection to the port with a 3-second timeout. If the connection is accepted, the port is reported open with a response time. If it is refused or nothing answers in time, it is reported closed, along with the system's reason. Here is what it returned when I ran it on 4 November 2026:

seopeck.com           port 443   open
2606:4700:4700::1111  port 443   open      (an IPv6 address works too)
seopeck.com           port 22    closed    Connection timed out

That reason line is worth reading. Connection refused means the server answered and said nothing is listening. Connection timed out means nothing answered at all, which usually points to a firewall. The tool tests TCP only, one port at a time, and cannot test UDP.

Check from Windows

Open PowerShell and run:

Test-NetConnection seopeck.com -Port 443

Real output:

ComputerName     : seopeck.com
RemoteAddress    : 191.101.228.214
RemotePort       : 443
InterfaceAlias   : Wi-Fi
SourceAddress    : 192.168.1.106
TcpTestSucceeded : True

TcpTestSucceeded : True means the port is open from where you are. When it fails, PowerShell prints a warning such as TCP connect to (2.57.91.187 : 3306) failed, then pings the host and shows TcpTestSucceeded : False. A successful ping next to a failed port test is a useful clue: the server is up, but that port is closed or filtered. tnc is a short alias for the same command. The old telnet host 443 trick also works, but the Telnet client is not installed on Windows by default.

To see what is listening on your own Windows machine, run this in Command Prompt:

netstat -ano | findstr :443

A line with LISTENING and an address of 0.0.0.0:443 means a program accepts connections on every network address. 127.0.0.1:443 means it only accepts connections from the same computer, so outside tests will fail. The last number on the line is the process ID; tasklist /FI "PID eq 1234" shows which program it is.

Check from Mac and Linux

In Terminal:

nc -zv seopeck.com 443

-z tells netcat to connect and close without sending data, and -v prints the result. An open port prints a line ending in succeeded!; a closed one prints Connection refused. If the command just hangs, the port is probably filtered: add -w 3 to give up after three seconds.

To see what is listening locally:

sudo lsof -i :443          # Mac and Linux: which program has port 443
sudo ss -tlnp              # Linux: every listening TCP port with its program

As on Windows, a listener on 127.0.0.1 or [::1] is reachable only from the machine itself; you want 0.0.0.0, * or the machine's network address.

Open, closed or filtered: what each result means

Command-line tools and port scanners often report three states. From outside, the difference shows up in how the connection fails.

ResultWhat happenedWhat to do next
OpenA program accepted the TCP connection.Nothing, if the service should be public. If it should not (a database, remote desktop), close it or limit it to known IPs.
ClosedThe host answered at once with a refusal ("Connection refused"). The path is clear, but nothing listens on that port.Start the service, or check it listens on the right port and address.
FilteredNo answer at all, so the attempt timed out. A firewall, router or provider dropped the packets.Work through the firewall, router and ISP steps below.

Our Open Port Checker shows both closed and filtered as "closed"; the reason line under the result (refused or timed out) tells you which one it was.

Port still closed? Fix it in this order

  1. Is the service running and listening? Check with netstat, ss or lsof on the machine itself. No listener, no open port.
  2. Is it listening on the right address? Change 127.0.0.1 to 0.0.0.0 (or the machine's LAN address) in the program's settings.
  3. Does the local firewall allow it? Add an inbound rule in Windows Defender Firewall, or allow the port in ufw, firewalld or iptables.
  4. Does the router forward it? Forward the external port to the device's private IP, and give that device a fixed (reserved) address so the rule does not break after a restart.
  5. Is your ISP blocking it, or using CGNAT? Many residential ISPs block incoming port 25, and some block 80 or 443 on home plans. If the WAN address shown on your router differs from your IP in What's My IP, your provider uses carrier-grade NAT and shares one public address between customers; port forwarding cannot work without the provider's help.
  6. On a cloud server, is the security group open? AWS, Google Cloud, Azure and most VPS providers have a network firewall in the control panel, separate from the one on the server.

Test again from outside after each step, so you know which change fixed it. If the port is open but connections are slow or drop, a Traceroute shows where along the route the delay starts.

Common ports and what uses them

PortServiceShould it be open to the internet?
21FTPRarely; prefer SFTP over port 22
22SSHOnly if you need it; limit to your IPs or use keys only
25SMTP between mail serversOnly on a mail server
53DNS (UDP and TCP)Only on a public DNS server
80HTTPYes on a web server, usually to redirect to HTTPS
110 / 143POP3 / IMAP (unencrypted)Prefer the encrypted ports 995 / 993
443HTTPSYes on a web server
587SMTP submission (mail apps sending mail)On a mail server
993IMAP over TLSOn a mail server
3306MySQL / MariaDBNo; allow only the app servers that need it
3389Windows Remote DesktopNo; use a VPN instead
5432PostgreSQLNo; same as MySQL
8080Alternative HTTP, proxies, dev serversOnly if you meant to publish it

Port 443 open but browsers still complain? That is a certificate problem, not a port problem; see SSL certificate errors explained.

A note on safety

Only test hosts you own or manage, or ones you have permission to test. Checking a single port on your own server is routine; scanning many ports on someone else's network can be treated as an attack by their provider. Our checker tests one port per request for that reason, and it refuses private addresses. Every open port is a door: keep admin and database ports closed to the world, and keep anything you do expose updated.

Frequently asked questions

How can I check if a port is open from outside my network?

Use a test that runs from outside, such as our Open Port Checker, against your public IP. A test from a computer inside your own network cannot tell you what the internet sees.

What is the difference between a closed and a filtered port?

A closed port gets an immediate refusal from the host: the path is open but nothing listens. A filtered port gets no reply at all because a firewall drops the traffic, so the test waits and times out.

Why is port 25 blocked on my connection?

Many residential ISPs block port 25 to stop infected home computers sending spam directly. Send mail through your provider's server on port 587 instead, or ask your ISP about a business plan if you run a mail server.

Port forwarding is set up but the port shows closed. Why?

Usually the program is not listening, listens on 127.0.0.1 only, the device's firewall blocks it, the rule points to an old private IP, or your provider uses CGNAT. Work through the list above in order.

Is it legal to check whether a port is open?

Testing your own servers and connections is normal administration. Probing other people's systems without permission may break your provider's terms or local law, so stick to hosts you control.

How do I see which program is using a port on Windows?

Run netstat -ano | findstr :PORT, note the process ID at the end of the line, then run tasklist /FI "PID eq ID". In PowerShell, Get-NetTCPConnection -LocalPort 443 -State Listen shows the same thing.

Next step

Run your port through the Open Port Checker and read the reason line if it comes back closed. If the whole server seems unreachable, not just one port, check whether it answers at all with Ping and follow our website down troubleshooting guide.

Keep reading

All guides

Choose which cookies SEOpeck may use. You can change this at any time from "Cookie settings" at the bottom of every page.

Your tools

    Saved in this browser only. Nothing is sent to us.

    Popular tools