Ping is a network tool that tests whether a host is reachable on an IP network and measures round-trip time. It sends ICMP echo request packets to a target and waits for ICMP echo replies, reporting the time each reply took, plus packet loss and a summary of minimum, average and maximum times. It was written by Mike Muuss in December 1983 and is available on Windows, macOS and Linux.
Key takeaways
- Ping sends ICMP echo requests and measures how long echo replies take to return, in milliseconds.
- A reply proves basic reachability, but a timeout does not prove a host is down, because many hosts block ICMP.
- Read time, packet loss and TTL together: time shows latency, loss shows instability, and TTL hints at route length.
When the internet feels broken, ping is the first tool most people reach for. It answers one clear question: can my device talk to another device on the network, and how long does it take?
What is ping?
Ping is a network tool used to test whether a host is reachable on an IP network. It sends ICMP echo request packets to a target and waits for ICMP echo replies, then reports the round-trip time for each one.
The name comes from active sonar, which sends a pulse of sound and listens for the echo to detect objects underwater. Ping works the same way: it sends a small packet out and listens for the echo back. The backronym Packet Internet Groper was created later and was not the original intention.
Ping was written by Mike Muuss in December 1983, while he worked at the Ballistic Research Laboratory, now the US Army Research Laboratory. A remark by David Mills on using ICMP echo packets for network diagnosis prompted him to create it. It is now available on Windows, macOS, Linux and most other operating systems.
The history and ICMP message format are documented in Wikipedia's ping networking utility article.
How does ping work?
Ping works by sending ICMP echo request messages to a target host and waiting for echo replies. The time between sending the request and receiving the reply is the round-trip time, measured in milliseconds.
Your device crafts a small packet with an IP header and an ICMP message and sends it toward the destination. Each router along the way decreases the TTL, or Time to Live, value by one. If TTL reaches zero, the router drops the packet and sends back a Time Exceeded message, which stops packets looping forever.
If the packet reaches its destination, the target replies with an ICMP echo reply. The reply carries the same identifier, sequence number and payload as the request, so ping can match each reply to the request that caused it. In IPv4, an echo request is ICMP type 8 and an echo reply is type 0. In IPv6, the same messages use ICMPv6 types 128 and 129.
Ping typically sends several echo requests, not just one, so it can calculate an average round-trip time and spot packet loss. Windows sends four by default. Linux and macOS keep sending until you stop them.
How do you run ping on Windows, Mac and Linux?
Running ping is simple: open a terminal and type ping followed by a domain name or IP address. The exact options differ by system, so learn the dialect for yours.
| Task | Windows | Linux / macOS |
|---|---|---|
| Ping a domain | ping example.com | ping example.com |
| Ping an IP address | ping 8.8.8.8 | ping 8.8.8.8 |
| Send 10 packets | ping -n 10 example.com | ping -c 10 example.com |
| Stop a running ping | Ctrl+C | Ctrl+C |
| Force IPv4 | ping -4 example.com | ping -4 example.com |
| Force IPv6 | ping -6 example.com | ping6 example.com |
On Windows, open Command Prompt or PowerShell. On macOS, open Terminal from Applications, then Utilities. On Linux, open your terminal app. Type the command, press Enter, and watch the replies appear one per line.
Try pinging your router first, then a public DNS server such as 8.8.8.8, then a website. If the router replies but the internet does not, the problem is beyond your home network. If even the router fails, the problem is local.
How do you read ping output?
Each reply line tells you the same four things: where the reply came from, how big it was, how long it took, and how much TTL remained. The summary at the end adds packet loss and the minimum, average and maximum times.
Here is a typical Windows reply, as shown in Kentik's guide: Reply from 142.251.214.142: bytes=32 time=15ms TTL=58. The bytes value is the size of the reply packet, usually 32 bytes on Windows and 64 bytes on Linux. The time value is the round-trip time for that packet. TTL is the remaining Time to Live after the packet reached the target and returned.
On Linux, a run of five probes to example.com might end with a summary like this: 5 packets transmitted, 5 received, 0.0% packet loss, and round-trip min/avg/max of 9.674/10.968/11.726 ms. That tells you the connection is stable and fast for that route.
Look at the pattern, not just one number. A steady 14 ms is healthy. Times that jump from 12 ms to 300 ms and back suggest congestion or an unstable link. A reply that takes longer on the first packet and then settles down is normal, because the first packet may need to resolve an address or wake a route.
What is a good ping time?
There is no single good ping time, because it depends on distance, the network in between, and what you are doing. Use these rough guides instead of chasing one magic number.
- Local network: under 1 to 5 ms to your router or another device on the same network is normal.
- Nearby server: under 20 to 30 ms is good for a server in your country.
- Another continent: 100 ms or more can be normal, because light and routing take time.
- Gaming and video calls: under 50 ms feels responsive; over 150 ms often feels laggy.
- Web browsing: ping matters less than bandwidth, because a page load involves DNS, TCP and TLS as well.
Stability matters more than a low average. A connection that is always 80 ms is better for a video call than one that averages 40 ms but spikes to 400 ms every few seconds. Those spikes are called jitter, and ping can reveal them if you watch a longer run.
What do ping errors mean?
Ping errors are the most useful part of the tool. Each one points at a different kind of problem, so learn to tell them apart before you start changing settings.
| Message | What it usually means | What to check first |
|---|---|---|
| Request timed out | No reply within the wait time | Host offline, link down, or firewall blocking ICMP |
| Destination host unreachable | No route to the host | Wrong IP, routing table, or local interface |
| Packet loss | Some replies never arrive | Congestion, weak Wi-Fi, or a failing link |
| TTL expired / Time exceeded | Packet looped or route too long | Routing loop or very long path |
| Unknown host | DNS could not resolve the name | Spelling, DNS server, or network connection |
Request timed out is the most common, and the most misunderstood. It usually means the host is offline, the network link is down, or a firewall is blocking ICMP. It does not prove the host is down, because many public servers block ICMP while their websites work perfectly.
Destination host unreachable is different: a router is telling you it has no route to that address. Check the IP address, your routing, and whether the local network interface is up. If you see packet loss, ping the same target several times and compare the loss rate. Occasional loss under 1% is often noise; sustained loss above 5% usually points to congestion or a weak link.
What can ping not tell you?
Ping tests only basic reachability at the network layer. It does not test your browser, DNS, a web server, or a specific port, because it uses ICMP, not TCP or TLS. A successful ping does not mean a website works, and a failed ping does not mean it is down.
That is why ping is a first step, not a final verdict. If ping works but the website does not load, the problem is higher up: DNS, the web server, the certificate, or the app itself. Check the site with our free SSL checker to see whether its certificate is valid.
Use our DNS lookup tool to see whether the domain resolves to the right address. Kentik's guide to understanding the ping command explains the same limit: ping tests reachability, not the web server itself.
Ping also cannot tell you where along the path a problem lies. For that, use traceroute, which shows each hop and the time for each one. If ping to a site is slow, traceroute can show whether the delay is on your local network, your internet provider, or further away. Our guide to securing your Wi-Fi covers the local side, where many ping problems start.
Is ping a security risk?
Normal ping use is safe. It sends only tiny diagnostic packets, and most networks expect it. The risk comes from abuse at scale, not from a single test.
A ping flood sends huge numbers of ICMP echo requests at a host to overwhelm it, which is a form of denial-of-service attack. A related trick, the ping of death, sent oversized or fragmented ping packets to crash older systems. Modern systems are protected against that, but the history is why many firewalls now rate-limit or block ICMP.
That blocking is also why attackers use ping for reconnaissance: a reply confirms that a host exists. Security teams often block ICMP at the perimeter for that reason, while allowing it inside the network where it helps troubleshooting. If you run a public server, blocking ICMP is a reasonable choice, but remember that it will make your server look down to anyone who only tests with ping.
The bottom line
Ping is a simple, fast way to test reachability and latency. It sends ICMP echo requests, times the replies, and reports round-trip time and packet loss. That is enough to separate a local problem from a provider problem, and a real outage from a site that simply blocks ICMP.
Use it as your first step, then move to the right tool for what you find: traceroute for path problems, DNS and SSL checks for website problems, and your router settings for local problems. You can check the basics right now with the what is my IP tool.
Frequently asked questions
What is ping in simple terms?
Ping is a small network tool that asks another device, are you there, and times how long it takes to answer. It sends a tiny ICMP echo request and waits for an echo reply.
What does ping measure?
Ping measures round-trip time, the time for a request to reach the target and for the reply to return, in milliseconds. It also reports packet loss and a summary of minimum, average and maximum times.
How do I ping a website?
Open a terminal or Command Prompt and type ping followed by the domain, for example ping example.com. On Windows it sends four packets by default, while on Linux and macOS it keeps going until you stop it with Ctrl+C.
What is a good ping time?
On a local network, under 1 to 5 milliseconds is normal. To a nearby server, under 20 to 30 milliseconds is good. To a server on another continent, 100 milliseconds or more can be normal. What matters most is whether the time is stable for your use.
Why does ping time out if the website works?
Many servers and firewalls block ICMP echo requests for security, even when the website itself works fine over HTTPS. A timeout means ping got no reply, not that the host is down.
What is the difference between ping and traceroute?
Ping tests reachability and round-trip time to one destination. Traceroute shows each hop along the path to that destination and the time for each hop, which helps you find where a delay or failure happens.
Is ping safe to use?
Yes, for normal testing. Ping sends only tiny diagnostic packets. Flooding a host with huge numbers of pings is an abuse technique called a ping flood, which is a form of denial-of-service attack and is not normal use.
What is ping6?
Ping6 is the version of ping for IPv6 networks, using ICMPv6 instead of ICMP. On many modern systems, the regular ping command uses IPv6 automatically when the target has an IPv6 address.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against the ping utility history and ICMP echo request and reply format, and Kentik's ping troubleshooting guide.
How we write and fact-check →