Connection refused vs timed out: what each error means
"Connection refused" means your request reached the machine but nothing accepted it, usually because the service is off, on another port or blocked. "Timed out" means no answer came back at all, which points to a wrong address, a silent firewall, a network problem or an overloaded server.
Both errors mean your device could not open a connection, but they fail in different ways. "Connection refused" is a fast, clear no: your request reached the other machine, and nothing there accepted it. "Connection timed out" is silence: your device waited, heard nothing back and gave up. That difference tells you where to look.
What "connection refused" means
Microsoft's Windows Sockets reference describes it this way: "No connection could be made because the target computer actively refused it." It adds that this "usually results from trying to connect to a service that is inactive on the foreign host", in other words a machine with no server program running on that port. The Node.js documentation uses almost the same wording for its ECONNREFUSED error.
A port is a numbered door on a computer. A web server usually listens on port 443 for secure pages, a database on another number. If you knock on a door nobody is behind, you get refused.
Typical causes:
The service is not running, has crashed or is still starting.
You are using the wrong port number.
The service only listens on one address (for example, only on the machine itself) and you are connecting from outside.
A firewall or security tool rejects the connection outright. Chrome's help page sums up its version, ERR_CONNECTION_REFUSED, as "The page didn't let Chrome connect or the page is blocked."
What "connection timed out" means
Microsoft defines the timeout as a connection attempt that "failed because the connected party did not properly respond after a period of time". Chrome describes ERR_CONNECTION_TIMED_OUT as "The page took too long to connect", adding that your connection might be too slow or the page too busy.
Typical causes:
The address is wrong or points to a machine that is switched off.
A firewall somewhere along the way silently drops the traffic instead of rejecting it.
Your own network is down, very slow or stuck behind a captive Wi-Fi sign-in page.
The server is so overloaded that it cannot answer.
A VPN or proxy is not passing the traffic through.
How the two look in real error messages
The same failure is worded differently by each tool. These samples are synthetic, from a fictional Northgate Tasks app:
Error: connect ECONNREFUSED 127.0.0.1:5432
ConnectionRefusedError: [Errno 111] Connection refused
curl: (7) Failed to connect to tasks.example port 8080: Connection refused
And for timeouts:
Error: connect ETIMEDOUT 198.51.100.40:443
curl: (28) Connection timed out after 30001 milliseconds
socket error 10060: Connection timed out
In curl's documentation, error 7 means "Failed to connect() to host or proxy" and error 28 means a time-out period was reached. On Windows, 10061 is the refused code and 10060 the timed-out code. Whatever the wording, look for the address and port in the message: they tell you exactly where your device was trying to go.
Related errors that are easy to confuse
Connection reset: the connection opened and was then cut. Microsoft describes it as "forcibly closed by the remote host", for example because the program on the other end stopped or the machine rebooted.
Name not resolved or host not found: the connection never started, because the name could not be turned into an address. Chrome says ERR_NAME_NOT_RESOLVED means the web address "doesn't exist or now has a different IP address". Node.js calls this ENOTFOUND.
Address already in use: this one happens on the server side, when a program tries to start listening on a port another program already holds.
What to check for "connection refused"
Is the service running? Restart the app, server or container you are trying to reach.
Is the port right? Compare the port in the error with the one in the service's settings.
Is it localhost? 127.0.0.1 and localhost mean "this same machine". If the service runs elsewhere, such as in a container or on another computer, localhost points to the wrong place.
Did something block it? Check firewall or security software logs for a block at that time.
Did it just start? Some services refuse connections for a few seconds while they boot. Wait and retry once.
What to check for "connection timed out"
Try another network. Load the same site on a phone using mobile data. If it works there, the problem is likely your Wi-Fi, router or a local firewall.
Check the address. A mistyped IP address or an outdated setting often points to a machine that does not exist.
Turn off the VPN or proxy briefly to see whether it is in the way.
Sign in to public Wi-Fi. Hotel and airport networks often block traffic until you accept their terms page.
Test the port directly. On Windows, PowerShell's Test-NetConnection command with -ComputerName and -Port reports TcpTestSucceeded as True or False, which tells you whether the port answers at all.
Wait if the service is busy. If everyone is reporting the same outage, retrying every few seconds will not help.
When to ask for help
If the service belongs to someone else, such as your hosting company, an IT team or a software vendor, send them the full error, the address and port, the time it happened and what you have already tried. Remove passwords, keys and personal details first; our guide to sharing logs safely explains how. If the error came with a long trace, our guide to reading a stack trace helps you find the line that matters.
Have the message read for you
EasyToDecode, launching soon, will take a pasted error or log, quote the lines that show whether the connection was refused or timed out, point to the address and port involved, and list what to check first and what to ask your provider. See how it works or join the waitlist to hear when it opens.
Questions
Does "connection refused" mean the server is down?
Not necessarily. The machine answered, so it is on; the specific service or port you asked for was not accepting connections, or something rejected the request.
Why do I get ECONNREFUSED on localhost?
Usually the program you are trying to reach is not running, is on a different port, or runs in another environment such as a container, where localhost means something else.
Can a firewall cause both errors?
Yes. A firewall that rejects traffic tends to produce a refusal, while one that silently drops it tends to produce a timeout.
What do Windows error codes 10060 and 10061 mean?
In Microsoft's Windows Sockets reference, 10060 is "Connection timed out" and 10061 is "Connection refused".
Sources
- Microsoft Learn: Windows Sockets Error Codes (checked October 10, 2026)
- Node.js documentation: Errors (common system errors) (checked October 10, 2026)
- Google Chrome Help: Get help with common error messages in Chrome (checked October 10, 2026)
- curl: libcurl error codes (checked October 10, 2026)
- Microsoft Learn: Test-NetConnection (checked October 10, 2026)
About this guide. Prepared by the EasyToDecode editorial team. Facts were checked against the official sources listed above (last checked October 10, 2026).
How we prepare and check our guides
General information, not legal, financial or tax advice. Rules differ by state, province and territory and change over time; check the sources and, for decisions with legal or financial consequences, a qualified professional.