What this calculator does
This tool tells you exactly how many hours and minutes remain until a specific time of day. Enter the target time (for example 17:00 for 5 PM) and the current time, and it returns the gap in decimal hours, in hours-and-minutes form, and in total minutes. If the target time has already passed for today, the calculator automatically wraps to the same time tomorrow.
How to use it
Set the Target hour and Target minute to the moment you are counting down to, using a 24-hour clock (0-23 for hours). The Current hour and Current minute default to your present time but can be changed to test any scenario. Press calculate to see the remaining time.
The formula explained
Both times are first converted to minutes past midnight: \(\text{target} = \text{hour} \times 60 + \text{minute}\), and \(\text{now} = \text{currentHour} \times 60 + \text{currentMinute}\). The raw difference is \(\text{target} - \text{now}\). Because a clock repeats every 24 hours (1440 minutes), if the difference is zero or negative we add 1440 so the result always lands in the next occurrence of that time. Finally, \(\text{hours} = \text{diff} \div 60\).
$$\begin{gathered} \text{Hours Until} = \frac{\left(\,\Delta + 1440 \bmod 1440\,\right)}{60} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} \Delta &= \left(60\cdot\text{Target Hour} + \text{Target Min}\right) \\ &\quad - \left(60\cdot\text{Now Hour} + \text{Now Min}\right) \\ &\text{add } 1440 \text{ if } \Delta \le 0 \end{aligned} \right. \end{gathered}$$Worked example
Suppose it is 14:30 (2:30 PM) and you want to know how long until 17:00 (5 PM). Target = \(17\times60 = 1020\) minutes; now = \(14\times60 + 30 = 870\) minutes.
$$\text{diff} = 1020 - 870 = 150 \text{ minutes} = 2 \text{ hours } 30 \text{ minutes} = 2.5 \text{ hours}$$12-Hour to 24-Hour Clock Conversion Table
This calculator takes the target time and the current time on the 24-hour clock, so the hour fields accept values from 0 to 23. If you normally read time as AM/PM — the 12-hour convention used in everyday speech in countries such as the United States, Canada, the United Kingdom and Australia — use the table below to translate your reading into the number you type into the hour or nowhour field.
| 12-hour reading | Hour value to enter (0–23) | Part of day |
|---|---|---|
| 12:00 AM (midnight) | 0 | Start of the day |
| 1:00 AM | 1 | Night |
| 2:00 AM | 2 | Night |
| 3:00 AM | 3 | Night |
| 4:00 AM | 4 | Early morning |
| 5:00 AM | 5 | Early morning |
| 6:00 AM | 6 | Morning |
| 7:00 AM | 7 | Morning |
| 8:00 AM | 8 | Morning |
| 9:00 AM | 9 | Morning |
| 10:00 AM | 10 | Morning |
| 11:00 AM | 11 | Late morning |
| 12:00 PM (noon) | 12 | Midday |
| 1:00 PM | 13 | Afternoon |
| 2:00 PM | 14 | Afternoon |
| 3:00 PM | 15 | Afternoon |
| 4:00 PM | 16 | Afternoon |
| 5:00 PM | 17 | Evening |
| 6:00 PM | 18 | Evening |
| 7:00 PM | 19 | Evening |
| 8:00 PM | 20 | Evening |
| 9:00 PM | 21 | Night |
| 10:00 PM | 22 | Night |
| 11:00 PM | 23 | Night |
Two readings cause most of the mistakes: 12:00 AM is hour 0, not 12, and 12:00 PM is hour 12, not 0. Everything after noon is simply the 12-hour number plus 12.
Minutes as decimal hours
The countdown can be read either as hours and minutes (h:mm) or as a single decimal number of hours, since
$$\text{Decimal hours} = \frac{\text{total minutes}}{60}$$Use this column to convert the minutes part of a result — or of your input — into its decimal-hour fraction.
| Minutes | Fraction of an hour | Decimal hours |
|---|---|---|
| 5 min | 1/12 | 0.083 h |
| 10 min | 1/6 | 0.167 h |
| 15 min | 1/4 | 0.25 h |
| 20 min | 1/3 | 0.333 h |
| 30 min | 1/2 | 0.5 h |
| 40 min | 2/3 | 0.667 h |
| 45 min | 3/4 | 0.75 h |
| 50 min | 5/6 | 0.833 h |
| 60 min | 1 | 1.0 h |
So a result of 3:45 is 3.75 hours, and 7:20 is roughly 7.333 hours. Note that minute fields always use 0–59; there is no "minute 60", so 90 minutes is entered as one hour and 30 minutes.
Scenario Comparison: Same-Day vs. Overnight Countdowns
The whole behaviour of this tool comes from one decision: whether the raw difference \(\Delta\) between the target time and the current time is positive (the target is still ahead of you today) or zero/negative (the target has already passed, so it must belong to tomorrow). When \(\Delta \le 0\), a full day of 1440 minutes is added before the result is converted to hours:
$$\text{Minutes Until} = \left(\Delta + 1440\right) \bmod 1440 \quad\text{with } 1440 \text{ used when } \Delta = 0$$| Current time | Target time | Raw Δ (minutes) | Wrap applied? | Result (h:mm) | Decimal hours | Total minutes |
|---|---|---|---|---|---|---|
| 14:30 (2:30 PM) | 17:00 (5:00 PM) | +150 | No — same day | 2:30 | 2.5 h | 150 min |
| 09:00 (9:00 AM) | 09:30 (9:30 AM) | +30 | No — same day | 0:30 | 0.5 h | 30 min |
| 22:00 (10:00 PM) | 06:00 (6:00 AM) | −960 | Yes — +1440 | 8:00 | 8.0 h | 480 min |
| 23:45 (11:45 PM) | 00:15 (12:15 AM) | −1410 | Yes — +1440 | 0:30 | 0.5 h | 30 min |
| 08:00 (8:00 AM) | 08:00 (8:00 AM) | 0 | Yes — +1440 | 24:00 | 24.0 h | 1440 min |
How each row is produced
- Same-day, hours ahead (14:30 → 17:00). \(\Delta = (60\cdot 17 + 0) - (60\cdot 14 + 30) = 1020 - 870 = 150\) minutes. Positive, so no wrap: \(150 / 60 = 2.5\) hours, or 2:30.
- Same-day, under an hour (09:00 → 09:30). \(\Delta = 570 - 540 = 30\) minutes \(= 0.5\) hours. Short countdowns stay exact to the minute.
- Overnight (22:00 → 06:00). \(\Delta = 360 - 1320 = -960\). The target is behind the current time, so it is read as tomorrow morning: \(-960 + 1440 = 480\) minutes \(= 8\) hours. This is the classic "how long until my alarm" case.
- Across midnight by minutes (23:45 → 00:15). \(\Delta = 15 - 1425 = -1410\), then \(-1410 + 1440 = 30\) minutes. Only half an hour separates the two times even though the clock hour drops from 23 to 0 — the wrap handles it without any special "midnight" rule.
- Identical times (08:00 → 08:00). \(\Delta = 0\). Because the rule adds 1440 when \(\Delta \le 0\), the answer is a full day, 1440 minutes = 24 hours, rather than zero. This is the intended reading of "how many hours until 8 AM" when it is already 8 AM: the next 8 AM is tomorrow.
Practical consequence: the result of this calculator is always greater than 0 and at most 24:00, and it never depends on the calendar date, time zone or daylight-saving rules — it is pure clock arithmetic on the 1440 minutes of a nominal day. On a day when a daylight-saving change shifts the clock (in regions that observe one), an overnight countdown across the transition will differ from the real elapsed time by the size of that shift, usually one hour.
FAQ
What if the target already passed today? The calculator adds 24 hours, so it counts down to the next time that clock reading occurs.
Does it use a 12 or 24-hour clock? Inputs use the 24-hour clock (0-23). For 5 PM enter 17, for 9 AM enter 9.
What happens if the times are equal? A difference of zero is treated as a full day away (24 hours), since the time has just passed.