Stopwatch and Countdown Timer

A stopwatch with laps, and a countdown. Both read the clock rather than counting ticks, so the time is still right when you come back to a tab you left in the background.

00:00.00 Stopwatch
0Laps
—Fastest lap
readyState
Laps

        

Why it is still right after you switch tabs

The obvious way to build a stopwatch is to add ten milliseconds to a number every ten milliseconds. It is also wrong, and it goes wrong in a way you only notice later.

A browser does not promise to run your timer on time. It runs it when it can, and when the tab is hidden it deliberately slows it down to about once a second to save your battery. A stopwatch built by counting ticks therefore loses time whenever you look away — a few seconds a minute, quietly, with nothing to show that it happened.

So this one does not count. It writes down the clock reading when you press start, and every time it draws the display it asks the clock again and subtracts. If the browser skips a hundred draws, the display is late but never wrong. Come back to a tab after ten minutes and the elapsed time is exactly ten minutes.

The countdown has the same problem and the same answer

A countdown built on ticks finishes late on a hidden tab — sometimes by minutes. This one works out the finishing moment when you press start and then compares against the clock, so it ends when it should. If the tab was asleep at the time, it will tell you the moment you return.

What no web page can promise is a sound or a notification the instant a hidden tab's timer ends. If the exact moment matters — a train, an exam, something in the oven — use a phone alarm. That is not this page being modest; it is what a browser tab is allowed to do.

Laps

Each lap records the time since the previous one, with the running total beside it, and the fastest is marked. That is the pair of numbers people actually want: the split tells you how that effort went, the total tells you where you are.

Nothing is saved

Reload the page and everything is gone — the running time, the laps, all of it. Nothing is stored on your machine or anywhere else. If the laps matter, copy them out before you leave.

Frequently asked questions

Does it keep running if I switch to another tab?

Yes, and it stays accurate. It reads the clock rather than counting its own ticks, so a browser slowing the page down in the background cannot make it lose time.

Will it make a sound when the countdown ends?

It tries, and browsers permit it because you pressed start. What no web page can guarantee is a sound from a tab that is hidden or a phone that is locked. For anything that truly matters, set a phone alarm as well.

How precise is it?

To a hundredth of a second, which is as fine as this is worth reading. The clock underneath is better than that, but a person pressing a button is not - your reaction time is a tenth of a second on a good day.

Are my laps saved if I reload?

No. Nothing is stored, here or anywhere. Copy them out if you need them.

Can I count down from more than an hour?

Yes - put the minutes in the minutes box. 90 minutes is fine, so is 999.

Is my text sent anywhere?

No. Everything happens in JavaScript inside your own browser. Nothing is uploaded and nothing is saved - close the tab and it is gone.

Related tools