Ping tells you whether a host is reachable and how long a round trip to it takes; traceroute shows the chain of routers your traffic passes through to get there. Used together, they let you tell whether a problem is on your own network, at your ISP, or somewhere beyond, in a few minutes and with tools already built into Windows, macOS and Linux.
How ping works
Ping sends small ICMP Echo Request packets to a target and waits for Echo Reply packets to come back. For each reply it reports the round-trip time (RTT). At the end it summarizes how many packets were lost and the minimum, average and maximum times. It does not test any particular application, only basic IP reachability and latency.
Running ping on each operating system
Windows
Open Command Prompt or PowerShell. By default Windows sends four pings and stops.
ping example.com
ping -n 20 example.com
ping -t example.com
ping -4 example.com
ping -6 example.com
-n 20 sends 20 pings, which gives a more reliable picture of packet loss than four. -t pings continuously until you press Ctrl+C. -4 and -6 force IPv4 or IPv6.
macOS and Linux
Open Terminal. Ping runs until you press Ctrl+C, so use -c to set a count.
ping -c 20 example.com
ping -c 20 -i 0.5 example.com # one ping every 0.5 seconds
ping6 example.com # IPv6 on macOS
ping -6 example.com # IPv6 on Linux
Reading ping output
Here is typical output from Linux or macOS:
PING example.com (192.0.2.10): 56 data bytes
64 bytes from 192.0.2.10: icmp_seq=0 ttl=55 time=18.4 ms
64 bytes from 192.0.2.10: icmp_seq=1 ttl=55 time=17.9 ms
64 bytes from 192.0.2.10: icmp_seq=2 ttl=55 time=41.2 ms
64 bytes from 192.0.2.10: icmp_seq=3 ttl=55 time=18.1 ms
--- example.com ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 17.9/23.9/41.2/10.0 ms
- time is the round-trip latency for each packet. Physics sets a floor: light in optical fiber covers roughly 200 km per millisecond, so each 100 km of fiber adds about 1 ms to the round trip, before any routing or queuing delay.
- ttl is the remaining hop count in the reply. It is not a quality measure, but a sudden change can mean the route changed.
- packet loss is the percentage of pings with no reply. Sustained loss of even a few percent hurts calls and games.
- stddev (or
mdevon Linux) shows how much latency varies. That variation is closely related to jitter, which matters more than raw latency for voice and video. In the example, one 41 ms spike inflates it.
Common ping errors
| Message | What it usually means |
|---|---|
Request timed out | No reply arrived. The host may be down, or a firewall may drop ICMP. |
Destination host unreachable | A router (or your own PC) has no route to the target. If it comes from your own IP, your network connection or gateway is the problem. |
Ping request could not find host / Unknown host | The name did not resolve. This is a DNS problem, not a connectivity problem. |
General failure (Windows) | The network stack could not send at all: adapter disabled, no IP address, or VPN/firewall software interfering. |
Using ping to locate a fault
Ping a series of targets from nearest to furthest. The first one that fails shows where the problem starts.
ping 127.0.0.1tests your own network stack. Failure points to a broken OS network configuration.ping 192.168.1.1, or whatever your default gateway is (find it withipconfigon Windows orip routeon Linux), tests your link to the router. Failure here is a Wi-Fi or cable problem.ping 1.1.1.1orping 8.8.8.8, well-known public DNS servers, tests your internet connection without involving DNS.ping example.comtests DNS. If step 3 works but this fails with "could not find host", DNS is the culprit.
How traceroute works
Every IP packet has a TTL (time to live) field, called hop limit in IPv6, that each router decrements by one. When it reaches zero, the router discards the packet and usually sends back an ICMP Time Exceeded message. Traceroute exploits this: it sends probes with TTL 1, then 2, then 3 and so on, and each router that expires a probe reveals its address and the round-trip time to it. By default it sends three probes per hop.
| Command | Platform | What it does |
|---|---|---|
tracert example.com | Windows | Traces the route using ICMP probes |
tracert -d example.com | Windows | Skips reverse DNS lookups, which makes it much faster |
traceroute example.com | macOS, Linux | Traces the route using UDP probes by default |
traceroute -n example.com | macOS, Linux | Skips name lookups |
traceroute -I example.com | macOS, Linux | Uses ICMP probes instead of UDP |
sudo traceroute -T -p 443 example.com | Linux | Uses TCP probes to port 443 |
TCP probes help when firewalls block UDP or ICMP.
Reading traceroute output
traceroute to example.com (192.0.2.10), 30 hops max
1 192.168.1.1 1.2 ms 1.0 ms 1.1 ms
2 100.64.12.1 8.4 ms 7.9 ms 8.1 ms
3 198.51.100.17 9.0 ms 9.3 ms 8.8 ms
4 * * *
5 198.51.100.94 65.2 ms 12.4 ms 11.9 ms
6 203.0.113.5 18.7 ms 18.3 ms 18.9 ms
7 192.0.2.10 18.5 ms 18.2 ms 18.6 ms
- Hop 1 is your router. High or erratic times here point to Wi-Fi problems.
- Hop 2 is usually the first device at your ISP. An address in
100.64.0.0/10often indicates carrier-grade NAT. - Hop 4 shows
* * *: that router did not send Time Exceeded messages. Since later hops respond, traffic is clearly passing through it, so this is harmless. - Hop 5 has one 65 ms probe but the following hops are back to normal, so it is not a real problem (see below).
- The last hop is the one that matters most: it shows the true end-to-end latency.
Why a single slow hop is usually not a problem
Routers are built to forward packets quickly in hardware. Generating ICMP replies is handled separately by the router's control-plane CPU, which treats it as low priority and often rate-limits it. A busy router may answer traceroute probes slowly, or not at all, while forwarding your actual traffic at full speed. The rule is:
- Latency or loss that appears at one hop and continues on every hop after it is real.
- Latency or loss that appears at one hop but disappears at later hops is just that router deprioritizing ICMP.
Also remember that the return path can differ from the outbound path (asymmetric routing), so a delay shown at a hop may actually occur on the way back.
Continuous tests: mtr and pathping
A single traceroute is a snapshot. Intermittent problems need many samples per hop.
mtr (macOS and Linux)
mtr combines ping and traceroute and updates continuously. Install it with sudo apt install mtr or brew install mtr. For a shareable report:
mtr -rwc 100 example.com
This sends 100 probes per hop (-c 100) and prints a report (-r) in wide format (-w) with Loss%, Avg, Best, Wrst and StDev columns. Apply the same rule as traceroute: only loss that persists to the final hop is meaningful. Add -T -P 443 for TCP probes.
pathping (Windows)
pathping example.com
pathping -n -q 50 example.com
Pathping traces the route, then sends 100 queries to each hop by default and reports loss per hop. It takes several minutes; -q reduces the queries and -n skips name lookups.
Testing from your browser
If you cannot open a terminal, for example on a locked-down work laptop or a phone, our Ping & Jitter Test measures latency, jitter and failed requests from your browser. Browsers cannot send ICMP, so it times HTTP round trips to our server instead. Results include a little browser and server processing time, so expect them to be slightly higher than command-line ping, but they reflect what web applications experience. For a guided diagnosis, try the connection troubleshooter, and see how to fix common internet connection problems for fixes once you have found the fault.
Frequently asked questions
What is a good ping time?
It depends on distance. A server in the same city might be under 10 ms on a wired connection, while one on another continent can be over 100 ms simply because of the distance light must travel. Consistency matters as much as the number: low jitter and zero packet loss are signs of a healthy connection.
Why does traceroute show asterisks?
The router at that hop did not reply within the timeout, usually because it is configured not to send ICMP Time Exceeded messages. If later hops respond, ignore it. If every hop after a certain point shows asterisks, traffic may be blocked there, or the destination is filtering probes.
Can I ping a specific port?
No, ICMP has no ports. To check whether a TCP port answers, use Test-NetConnection example.com -Port 443 in PowerShell, nc -vz example.com 443 on macOS or Linux, or an online port checker.