Short answer

Click in the window where ping is running and press Ctrl + C. This works on Windows, macOS and Linux. Ping stops, prints a short summary and gives you the prompt back.

Stop ping with Ctrl + C

  1. Click inside the window where ping is running.
  2. Hold down Ctrl. On a Mac, this is the Control key, not Command.
  3. Press C.

Ping stops at once. It shows how many packets were sent, received and lost, and the shortest, average and longest reply times. The window stays open for your next command.

Why ping keeps running

System A plain ping
Windows Sends 4 pings, then stops. Only ping -t keeps going.
macOS Keeps going until you stop it
Linux Keeps going until you stop it

So on Windows, a ping that never ends was started with -t. On macOS and Linux, ping runs until you stop it, unless you give it a count or a time limit.

Make ping stop on its own

Give ping a count, and it stops after that many pings.

Windows

Use -n and a number:

ping -n 10 example.com

Windows has no total time limit for ping. Take care: -t means “keep going until stopped”, and -w is how long to wait for each reply, in milliseconds.

Mac

Use -c and a number:

ping -c 10 example.com

Or set a time limit in seconds with -t. Ping stops when the time runs out:

ping -t 30 example.com

Linux

Use -c and a number:

ping -c 10 example.com

Or set a time limit in seconds with -w. Ping stops when the time runs out:

ping -w 30 example.com

See the results without stopping ping

You can get the numbers so far while a long ping keeps running.

System Press What happens
Windows (ping -t) Ctrl + Break Shows the statistics and keeps going
macOS Control + T Shows the statistics and keeps going
Linux Ctrl + \ Shows a short line of statistics and keeps going

Many laptops have no Break key. Your laptop maker’s keyboard guide shows which key combination works as Break.

Test your ping without a terminal

Test it now

Ping test

It shows your ping and jitter to our server, then stops by itself. It tells you if your connection is steady, not where a delay comes from.

Open the ping test

If your ping is high or jumps around, see why is my ping so high for the fixes.

Questions people ask

Ctrl + C doesn't stop ping. What else can I try?

Click inside the ping window first, so it’s the active one, then press Ctrl + C again. Closing the window always ends the ping.

Does closing the window stop ping?

Yes. Closing the window ends the ping at once, but you lose the summary. Ctrl + C stops it and keeps the summary on screen.

How do I run ping forever on Windows?

Type ping -t and the address, for example ping -t example.com. It keeps sending pings until you press Ctrl + C.