Countdown Timer
Create countdown timers with custom time and reminders
Set Time
What is a Countdown Timer?
A countdown timer is a simple time-control tool that starts from a chosen duration and counts down to zero. Common uses include focused work, cooking, exercise intervals, classroom activities, meetings, speeches, and any task where a fixed time box matters more than the current clock time. Unlike a stopwatch, which measures elapsed time upward from zero, a countdown timer creates a visible endpoint and can warn you as the remaining time becomes short. This page also includes stopwatch and multi-timer modes, so it can handle lap timing and several small timers in one place. Because it runs in the open browser tab, it should be kept visible or active when the reminder is important.
How to Use
How to use
- Select a tab: Countdown, Stopwatch, or Multi Timer mode
- For Countdown: enter hours/minutes/seconds or click preset times
- Click 'Start' to begin timing, 'Pause' to pause
- A sound alert plays when countdown ends
Timing Notes
- Browser timers can pause or drift when the tab is in the background, the device sleeps, or power-saving mode is enabled.
- For meetings, exams, or production work, keep a system clock or dedicated timer as the final reference.
Use Cases
Technical Principle
The countdown engine does not use setInterval(callback, 1000) as an authoritative clock - that approach accumulates drift because the HTML5 event-loop spec only guarantees a minimum delay, not a fixed cadence. Instead, the page records a startTime via Date.now() (or performance.now() for sub-millisecond resolution) and on each tick computes remaining = targetDuration - (Date.now() - startTime). The display refresh is driven by requestAnimationFrame, which is throttled by the browser to the display vsync rate (typically 60 Hz / 16.67 ms, sometimes 120 Hz on high-refresh laptops and phones). This self-correcting design keeps the displayed seconds aligned with wall-clock time even after the JavaScript task queue stalls for garbage collection or a long layout. Background throttling is the dominant source of timer surprises. Per the HTML Living Standard, hidden tabs clamp setInterval/setTimeout to a minimum of 1000 ms (Chrome, Firefox, Safari implement this with their own heuristics; Chrome additionally freezes inactive tabs after about 5 minutes on battery). The Page Visibility API (document.visibilityState, document.hidden, the visibilitychange event) lets the timer detect a tab switch and reconcile its internal clock against Date.now() when the tab becomes visible again. The end-of-countdown sound is played through the Web Audio API (AudioContext + OscillatorNode or a preloaded AudioBuffer), which requires a prior user-gesture activation on iOS Safari and modern Chrome to satisfy autoplay policy. A best-effort visual alert is also rendered, and if the user has previously granted permission, an OS-level toast can be posted through the Notification API. Multi-timer mode keeps each timer in its own state object with an independent startTime; a single requestAnimationFrame loop iterates over the array each frame rather than spinning a separate interval per timer, which keeps CPU work flat as the count grows. Persistence across reloads uses localStorage with a serialized endTime, so the page can recompute remaining time on mount. Be aware that wall-clock corrections by the OS (manual time change, NTP step, or daylight-saving transition) shift Date.now() instantly and can make a recovered timer appear to jump - performance.now() is monotonic and is preferred when only elapsed time matters within a single page load.
- Use Date.now() or performance.now() as the source of truth; never trust accumulated setInterval ticks.
- requestAnimationFrame caps repaint at the display vsync (60 Hz = ~16.67 ms; 120 Hz = ~8.33 ms).
- Hidden tabs throttle setInterval to a 1000 ms minimum per HTML spec; Chrome may freeze the page after ~5 min on battery.
- Page Visibility API (visibilitychange event) is the hook for reconciling the timer when the tab returns to foreground.
- Web Audio API needs a prior user-gesture activation on iOS Safari and Chrome to satisfy autoplay policy.
- Notification API requires Notification.requestPermission() and a secure context (HTTPS or localhost).
- performance.now() is monotonic across NTP steps and DST jumps; Date.now() is not - choose accordingly.
Examples
Pomodoro work block (25 min focus + 5 min break)
Mode : Countdown
Duration : 00 : 25 : 00
Start at : 14:00:00
Finish at : 14:25:00 (alarm plays)
Next : 5-minute break timer (preset)Cooking - soft-boil egg (6 min 30 s)
Mode : Countdown
Set : 00 : 06 : 30
At 1:00 -> visual warning highlights remaining time
At 0:00 -> alarm + page banner: Countdown Complete!Stopwatch with laps (running 1 km practice)
Start -> 00:00.00
Lap 1 -> 04:12.80 (split 04:12.80)
Lap 2 -> 08:31.45 (split 04:18.65)
Lap 3 -> 12:48.10 (split 04:16.65)
Finish -> 16:55.30 (split 04:07.20 fastest)Multi-timer for HIIT (30s work / 15s rest x 4)
Timer A: 00:30 (work) -> alarm
Timer B: 00:15 (rest) -> alarm
Timer C: 00:30 (work) -> alarm
Timer D: 00:15 (rest) -> alarm
Total session: 3 minutes, keep tab visible so alarms fire on time.Exam invigilation - 45-minute writing block
Duration : 00 : 45 : 00
Start : 09:15:00
End : 10:00:00
Tip: leave the tab in foreground - background tabs may throttle setInterval and drift by several seconds over 45 minutes.FAQ
Does the countdown keep running if I switch tabs?
Modern browsers throttle background tabs to about 1 update per second to save battery, so the displayed value may lag slightly when you return - but the underlying calculation is based on absolute time, so the elapsed total is correct. The displayed countdown jumps to the right value as soon as you focus the tab.
Will the alarm fire while the tab is in the background?
Audio playback in background tabs is restricted by some browsers and OS power-saving settings. The alarm is played through the Web Audio API and requires a prior user interaction. Keep the tab focused or visible if the alert is important.
What happens if the computer sleeps?
The countdown's underlying time math is based on Date.now() (wall-clock), so it still tracks correctly while the system was asleep. The display catches up on wake. The audible alarm, however, won't fire while the system is suspended.
How precise is the timer?
Display updates every second, but internally the page uses millisecond-precision timestamps. Real precision is limited by browser tab throttling (background tabs lose precision) and by audio-output latency for the alarm sound (typically <100 ms). For physics or audio-engineering precision, use specialised hardware.
Can I save preset durations?
Quick preset buttons (5 min, 10 min, 25 min, 45 min, 1 hour) are provided for common durations. These are built-in shortcuts, not user-customizable presets. Closing the tab loses the current timer state.
What about daylight saving time?
The countdown uses elapsed seconds, not wall-clock dates, so DST transitions don't affect it. A 2-hour countdown started 30 minutes before DST 'spring forward' still finishes 90 minutes later, correctly.
Is anything uploaded?
No. The timer runs entirely in your browser. Custom presets and history are stored locally if you opt in.