How to Ping an IP Address on Windows, Mac and Linux (and Read the Results)

Updated

Short answer

Open Command Prompt on Windows or Terminal on a Mac or Linux, type ping followed by the IP address, for example ping 192.168.1.1, and press Enter. Replies that show a time in milliseconds mean the device is reachable, while Request timed out or Destination host unreachable means it didn’t answer. Windows sends four pings and stops; a Mac or Linux keeps pinging until you press Ctrl+C.

On this page

Ping sends a small test message, an ICMP echo request, to an IP address and measures how long the reply takes. It’s the quickest way to check whether a router, printer, camera or server is reachable. Below are the steps for Windows, macOS, Linux, ChromeOS and phones, then how to read the results, fix errors and make a device answer.

How to ping an IP address on Windows 11 and 10

  1. Select Start, type cmd, and select Command Prompt.
  2. Type ping and the address, for example ping 192.168.1.1.
  3. Press Enter. Windows sends four pings, then prints the statistics.
Text
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=3ms TTL=64
Reply from 192.168.1.1: bytes=32 time=2ms TTL=64
Reply from 192.168.1.1: bytes=32 time=2ms TTL=64
Reply from 192.168.1.1: bytes=32 time=5ms TTL=64

Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 2ms, Maximum = 5ms, Average = 3ms

Four replies and 0% loss mean the device is reachable. ping -t keeps pinging until you press Ctrl + C, which also prints the totals, and ping -a adds the device’s name if your network knows it. Microsoft’s ping command reference lists every switch.

To ping this PC from another device, find your Windows PC’s IP address first and allow ping in the firewall (steps below).

Ping with PowerShell: Test-Connection and Test-NetConnection

Right-click Start and select Terminal (on Windows 10, Windows PowerShell). ping works there unchanged, and two cmdlets return results that scripts can use:

PowerShell
Test-Connection 192.168.1.1 -Count 4
Test-Connection 192.168.1.1 -Quiet
Test-NetConnection 192.168.1.1
Test-NetConnection 192.168.1.1 -Port 443
  • Test-Connection sends four pings, and -Quiet returns only True or False. In PowerShell 7, -Repeat pings nonstop (Test-Connection reference).
  • Test-NetConnection sends one ping and shows PingSucceeded. With -Port, it tests a TCP port instead: TcpTestSucceeded : True means the device is up, even if it ignores ping.

How to ping an IP address on a Mac

  1. Press Command-Space, type Terminal and press Return. Terminal is also in Applications > Utilities.
  2. Type ping 192.168.1.1 and press Return.
  3. Press Control-C to stop. macOS then prints the statistics.
Text
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=3.214 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.871 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=4.105 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=2.946 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 2.871/3.284/4.105/0.491 ms

ping -c 4 stops after four pings. Network Utility, which older guides mention, is gone from current macOS. A Mac doesn’t answer ping when Enable stealth mode is on under System Settings > Network > Firewall > Options. To ping your Mac from another device, find your Mac’s IP address.

How to ping an IP address on Linux

  1. Open a terminal. On Ubuntu, press Ctrl + Alt + T.
  2. Type ping -c 4 192.168.1.1 and press Enter. Without -c, ping runs until you press Ctrl + C.
Text
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.412 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.388 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.405 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.395 ms

--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 0.388/0.400/0.412/0.009 ms

Lost packets print no line; add -O to see them. The ping(8) manual page lists all options. For your own address, see how to get your IP address on Linux.

How to ping from a Chromebook

  1. Press Ctrl + Alt + T to open crosh, the ChromeOS shell.
  2. Type ping -c 4 192.168.1.1 and press Enter.

Without -c, ping runs until you press Ctrl + C and then shows no statistics. School and work Chromebooks may have crosh turned off.

How to ping from an iPhone or Android phone

Phones have no built-in ping tool; network utility apps from the App Store or Google Play add one. To check whether a phone is reachable, ping its IP address (in its Wi-Fi settings) from a computer on the same network, with the phone’s screen on: phones may not answer while asleep.

Ping command options: Windows vs. Mac vs. Linux

TaskWindowsMacLinux
Ping until stopped-tDefaultDefault
Number of pings-n 10-c 10-c 10
Data size in bytes-l 1000-s 1000-s 1000
Wait per reply-w 1000 (ms)-W 1000 (ms)-W 1 (seconds)
IPv4 or IPv6-4, -6ping, ping6-4, -6
TTL-i 10-m 10-t 10

Tip

The same letter can mean different things: -t is a continuous ping on Windows, the TTL on Linux and a time limit on a Mac.

How to read ping results

PartExampleWhat it means
Reply from, bytes fromReply from 192.168.1.1Who answered. A different address than the one you pinged means an error message
Bytesbytes=32Reply size: 32 bytes on Windows, 64 (56 plus header) on Mac and Linux
icmp_seqicmp_seq=1Sequence number on Mac and Linux; gaps are lost replies
Timetime=3msRound-trip time in milliseconds
TTLTTL=64Router hops left (see below)

TTL (time to live) counts routers, not time: each router on the way subtracts 1. Most systems start at 64 (Linux, macOS, many routers), Windows at 128 and some network equipment at 255, so a reply with TTL=57 likely passed through 7 routers.

The statistics count sent, received and lost packets and give the minimum, average and maximum time. Mac (stddev) and Linux (mdev) add how much the times varied; high variation, called jitter, hurts calls and games. On Windows, compare Minimum and Maximum.

What’s a normal ping time?

  • Home network: under 1 ms by cable (Windows shows time<1ms), usually a few milliseconds over Wi-Fi.
  • Internet: distance sets the floor. Light in fiber covers about 200 km per millisecond, so a server 5,000 km away can’t answer in less than about 50 ms, and real routes are longer.
  • Packet loss: a wired home network shouldn’t lose replies. Regular losses mean choppy calls and lag.

Servers and routers may deprioritize or rate-limit ping, so one slow or missing reply isn’t proof of a problem.

Ping errors: request timed out, destination host unreachable and more

MessageWhat it meansWhat to check
Request timed out. Mac: Request timeout for icmp_seq. Linux shows only the lossNo reply within the wait time, 4 seconds on WindowsDevice off or asleep, wrong address, firewall
Destination host unreachable. Mac: Host is downThe address after “Reply from” gave up. Your own IP: no device answered for that address. A router’s IP: the router can’t reach itWrong or outdated IP, device offline
PING: transmit failed. General failure.Windows couldn’t send the ping at allNo connection, a disabled adapter, VPN or security software, or IPv6 on a network without it
Ping request could not find host. Mac: Unknown host. Linux: Name or service not knownThe name couldn’t be resolved (DNS)A typo. If pinging an IP address works, DNS is the problem
TTL expired in transit. Mac and Linux: Time to live exceededToo many routers on the way, often a routing loopRun traceroute; usually your provider’s problem
100% packet lossNo reply at allSame as Request timed out
High latency or jitterCongestion or interferencePause downloads, try a cable, and ping your router to see whether it starts at home

Windows counts Destination host unreachable as received, so the statistics can show 0% loss although the device never answered:

Text
Pinging 192.168.1.50 with 32 bytes of data:
Reply from 192.168.1.23: Destination host unreachable.
Reply from 192.168.1.23: Destination host unreachable.
Reply from 192.168.1.23: Destination host unreachable.
Reply from 192.168.1.23: Destination host unreachable.

Ping statistics for 192.168.1.50:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Only real replies contain TTL=; check for that in scripts.

Why a device on your network doesn’t answer ping

  • It’s off or asleep. Phones and sleeping laptops often don’t reply.
  • Its address changed. Check its current IP in its network settings or your router’s device list.
  • A firewall blocks ping. Windows blocks it on Public networks, and on Private ones unless file and printer sharing or a ping rule is on. Macs ignore ping in stealth mode.
  • It’s on another network, such as guest Wi-Fi, which often isolates devices, or behind a second router.
  • A VPN is on and sends local traffic into the tunnel. Disconnect it or allow local network access in the VPN app.
  • Your IP starts with 169.254. Your computer got no address from the router; see what a 169.254 IP address means.

How to allow ping in Windows Defender Firewall

  1. Open Settings > Network & internet > Wi-Fi > Manage known networks and select your network. For a cable connection, open Ethernet instead.
  2. Set Network profile type to Private network. On Windows 10, open your network’s Properties from the Wi-Fi icon in the taskbar.
  3. Press Windows key + R, type wf.msc and press Enter.
  4. Select Inbound Rules and find File and Printer Sharing (Echo Request - ICMPv4-In) with Private in the Profile column.
  5. Right-click the rule and select Enable Rule. For IPv6, also enable the matching ICMPv6-In rule.

Or right-click Start, select Terminal (Admin) (on Windows 10, Windows PowerShell (Admin)) and allow ping from your local network on Private networks only, so public Wi-Fi stays protected:

PowerShell
New-NetFirewallRule -DisplayName "Allow ping from local network" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -RemoteAddress LocalSubnet -Profile Private -Action Allow

What to ping to find a network problem

Work outward from your computer; the first step that fails shows where the problem is.

StepPingExampleIf it fails
1Your computer itselfping 127.0.0.1Network software problem; restart
2Your own local IPping 192.168.1.23The adapter has no working address
3Your routerping 192.168.1.1Wi-Fi, cable or router problem
4A public IP addressping 1.1.1.1No internet connection
5A domain nameping example.comDNS problem

Your router’s address is the default gateway; how to find your router’s IP address shows where each device lists it. Ping printers and cameras after step 3.

Local addresses such as 192.168.1.40 work only inside your network. From the internet, only public IPs are reachable, and many home routers ignore pings from outside; local vs. public IP addresses explains the difference.

Ping a website or domain name

ping example.com resolves the name first and shows the IP address behind it in the first line, which makes ping a quick DNS check. Many web servers and CDNs ignore ping, so a timeout doesn’t mean a site is down. To see which network an address belongs to, our IP lookup API returns the provider, ASN and approximate location of any public IP.

How to ping an IPv6 address

On Windows and Linux, ping the IPv6 address directly, as in ping 2001:db8::1; for a name, ping -6 forces IPv6. On a Mac, use ping6 for both; Ubuntu still accepts ping6 as a shortcut too. Windows IPv6 replies show only the time.

Link-local addresses, which start with fe80, need the network interface after a percent sign: %12 on Windows (the number ipconfig shows), %en0 on a Mac, %wlp2s0 on Linux. To check whether you have IPv6 at all, ping Google Public DNS at 2001:4860:4860::8888. General failure on Windows or Network is unreachable on Linux means there’s no IPv6 route.

Continuous ping and internet ping tests

For an internet ping test, ping an address that reliably answers, such as Cloudflare’s 1.1.1.1 or Google’s 8.8.8.8, about 100 times (-n 100 on Windows, -c 100 on a Mac or Linux). Then check the loss and the spread between minimum and maximum.

For drops that come and go, run continuous pings to your router and to 1.1.1.1 side by side. Problems in both point to your home network, often Wi-Fi; problems only with the public address point to your provider. To log when drops happen, add timestamps in PowerShell:

PowerShell
ping -t 1.1.1.1 | ForEach-Object { "{0} {1}" -f (Get-Date -Format "HH:mm:ss"), $_ }

On Linux, ping -D prints a timestamp before each line.

How to find devices on your network with ping

Your router keeps the most complete list: see all devices on your network. To check a range yourself, ping each address of your own network once. This Command Prompt loop prints only real replies (in a batch file, write %%i):

Command Prompt
for /L %i in (1,1,254) do @ping -n 1 -w 200 192.168.1.%i | find "TTL="

On Linux (on a Mac, replace -W 1 with -W 1000):

Shell
for i in $(seq 1 254); do ping -c 1 -W 1 192.168.1.$i > /dev/null && echo "192.168.1.$i answers"; done

Afterwards, arp -a (Windows, Mac) or ip neigh (Linux) lists the devices your computer reached, including some that ignored the ping. Scan only networks you own or manage.

Ping vs. traceroute

Ping tells you whether one address answers and how long the round trip takes. Traceroute (tracert on Windows, traceroute on a Mac or Linux) lists every router on the way, so you can see where replies stop or slow down.

Frequently asked questions

How do I ping an IP address?

Open Command Prompt on Windows (select Start, type cmd and select Command Prompt) or Terminal on a Mac or Linux. Type ping followed by the address, for example ping 192.168.1.1, and press Enter. Replies with a time in milliseconds mean the device answered. Windows stops after four pings, while a Mac or Linux keeps going until you press Ctrl+C.

How do I ping an IP address continuously?

On Windows, add -t, as in ping -t 192.168.1.1, and press Ctrl+C to stop and see the totals. On a Mac or Linux, plain ping 192.168.1.1 already runs until you press Ctrl+C. Run one continuous ping to your router and one to a public address such as 1.1.1.1 side by side to see whether drops start in your home network or beyond it.

What does request timed out mean?

Request timed out means Windows sent the ping but got no reply within the wait time, 4 seconds by default. The device may be off or asleep, the address may be wrong, or a firewall may block ping; Windows PCs, for example, don’t answer on networks set to Public. If the device otherwise works, for example its web page opens, it simply ignores ping.

Can I ping an IP address from my phone?

iPhones, iPads and Android phones have no built-in ping tool, but network utility apps from the App Store or Google Play add one. Choose an app from a developer you trust and check the permissions it asks for. To find out whether the phone itself is reachable, ping its IP address from a computer on the same Wi-Fi while the phone’s screen is on.

Why can't I ping a device on my network?

Usually the device is off or asleep, its IP address has changed, its firewall blocks ping, or it’s on another network such as guest Wi-Fi. Check its current address in your router’s list of connected devices and ping that address. Windows PCs don’t answer ping on networks set to Public, and Macs don’t answer with stealth mode on.

How do I ping an IP address and port?

Ping can’t test a port, because it uses ICMP, which has no ports. To check a TCP port on Windows, run Test-NetConnection 192.168.1.10 -Port 443 in PowerShell and look for TcpTestSucceeded : True. On a Mac or Linux, nc -vz 192.168.1.10 443 reports whether the connection succeeded.