Countdown Calculator
Set a target date and time, give it a label, and watch a live countdown tick down in days, hours, minutes, and seconds. Bookmark the URL to return to your countdown any time.
How It Works
A countdown timer computes the difference between the current moment and a fixed future (or past) target moment, then updates that difference every second.
Core calculation:
Delta (milliseconds) = Target timestamp − Current timestamp
Days = floor(Delta / 86,400,000)
Hours = floor((Delta % 86,400,000) / 3,600,000)
Minutes = floor((Delta % 3,600,000) / 60,000)
Seconds = floor((Delta % 60,000) / 1,000)
This is the same time-decomposition used in digital clocks. The modulo operations peel off each unit's contribution from the remainder.
Worked example: It is 14:30:00 on 1 October 2025. Target: midnight 1 January 2026.
Delta = 91 days, 9 hours, 30 minutes, 0 seconds = 7,894,200,000 ms
Days = floor(7,894,200,000 / 86,400,000) = 91
Remaining = 7,894,200,000 − 91 × 86,400,000 = 33,000,000 ms
Hours = floor(33,000,000 / 3,600,000) = 9
Remaining = 33,000,000 − 9 × 3,600,000 = 600,000 ms
Minutes = floor(600,000 / 60,000) = 10 (note: 30 min was specified but there is rounding)
The display updates every 1,000ms (1 second) using setInterval. When the target time is reached, the timer switches to a "passed" message showing how long ago the event occurred.
Time zones: Dates entered without a time component are treated as midnight local time. If you share a countdown link with someone in a different time zone, they will see their local time calculation — which may not match yours for a precise moment like a concert start. For location-specific events, include the event time converted to UTC.
The URL permalink encodes your target date, time, and label as query parameters, so bookmarking or sharing the URL re-creates your exact countdown.
Frequently Asked Questions
Why does my countdown show a different time than my friend's?
The countdown runs in your browser using your local time zone. If your friend is in a different time zone and you both entered a date without a specific time, you are each counting down to midnight in your own time zone, which are different moments. For a shared countdown, use a specific UTC time.
What happens when the countdown reaches zero?
The display switches to a count-up showing how long ago the target date/time occurred, phrased as "X days, Y hours, Z minutes, W seconds ago."
Can I share this countdown with others?
Yes. The URL updates as you type. Copy the full URL from your browser bar and share it. Anyone opening that URL will see the same countdown event (adjusted for their local time zone).
How accurate is the countdown?
It is accurate to within 1 second, updating every second. JavaScript's setInterval is not guaranteed to fire at exactly 1-second intervals (it can drift by a few milliseconds), but the display re-calculates from the actual current time each tick, so it self-corrects and never accumulates error.
What is the "% of year elapsed" figure?
This shows what percentage of the current calendar year has passed as of right now. It is calculated as (days since Jan 1) / (days in current year) × 100. It gives you a sense of where you are in the year at a glance.