Hours Between Two Times Calculator

Hours Between Two Times Calculator

Popular AI Skill PRO

Enter Calculation

Formula

Hours=(Δ+1440)mod144060whereΔ=(60·End Hour+End Min)−(60·Start Hour+Start Min)\begin{gathered} \text{Hours} = \frac{\left(\Delta + 1440\right) \bmod 1440}{60} \\[1.5em] \text{where}\quad \Delta = \left(60\cdot\text{End Hour} + \text{End Min}\right) - \left(60\cdot\text{Start Hour} + \text{Start Min}\right) \end{gathered}
Usage stats

Advertisement

Results

Total Duration
8.5
hours
Hours and minutes 8 h 30 min
Total minutes 510 min
Clock times used (24-hour clock: 5 PM = 17) 09:00 → 17:30

Report an error on this page

What It Does

This calculator measures the elapsed time between a start time and an end time on a 24-hour clock. It returns the duration both as a decimal number of hours and as a clean hours-and-minutes breakdown. It is handy for timesheets, shift planning, billing, study sessions, cooking, and any task where you need to know how long something lasted.

How to Use It

Enter the start hour and minute, then the end hour and minute, all in 24-hour format (0–23 for hours, 0–59 for minutes). For example, 5:30 PM is hour 17, minute 30. Click calculate to see the total duration. If the end time is earlier than the start time, the tool assumes the span crosses midnight and adds 24 hours automatically — perfect for overnight shifts.

The Formula Explained

Both times are converted to "minutes since midnight": \(\text{minutes} = \text{hour} \times 60 + \text{minute}\). The start total is subtracted from the end total. If the result is negative (end is on the next day), 1,440 minutes (24 hours) is added so the value wraps correctly. Finally the minutes are divided by 60 for decimal hours.

$$\begin{gathered} \text{Hours} = \frac{\left(\Delta + 1440\right) \bmod 1440}{60} \\[1.5em] \text{where}\quad \Delta = \left(60\cdot\text{End Hour} + \text{End Min}\right) - \left(60\cdot\text{Start Hour} + \text{Start Min}\right) \end{gathered}$$
Advertisement
Circular 24-hour clock face showing an arc swept from a start time to an end time
The duration is the arc swept clockwise from start to end on a 24-hour clock.

Worked Example

Start at 09:00 (540 minutes) and end at 17:30 (1,050 minutes). The difference is \(1050 - 540 = 510\) minutes. As hours that is

$$510 / 60 = 8.5 \text{ hours},$$

or 8 hours and 30 minutes.

Horizontal timeline wrapping past midnight from an evening start to a morning end
For overnight spans the timeline wraps past midnight, shown by the mod-1440 step.

More Worked Examples

Example 1: Overnight shift, 22:00 to 06:00

The end time is earlier than the start time, so the span crosses midnight. Convert both times to minutes after midnight:

  1. Start: \(22 \cdot 60 + 0 = 1320\) minutes
  2. End: \(6 \cdot 60 + 0 = 360\) minutes
  3. Difference: \(\Delta = 360 - 1320 = -960\) minutes
  4. Wrap around the 24-hour clock: \((-960 + 1440) \bmod 1440 = 480\) minutes
  5. Convert to hours: \(480 \div 60 = 8\)

The shift lasts 8 hours.

Example 2: Minute borrowing, 08:50 to 14:20

The end minutes (20) are smaller than the start minutes (50), so borrow one hour (60 minutes):

  1. Borrow: 14:20 becomes 13 h 80 min
  2. Minutes: \(80 - 50 = 30\)
  3. Hours: \(13 - 8 = 5\)
  4. Result: 5 h 30 min

Check with the formula: \(\Delta = (14 \cdot 60 + 20) - (8 \cdot 60 + 50) = 860 - 530 = 330\) minutes, and \(330 \div 60 = \) 5.5 hours.

Another overnight case: 23:45 to 00:15

Start = 1425 minutes, end = 15 minutes, \(\Delta = 15 - 1425 = -1410\). Then \((-1410 + 1440) \bmod 1440 = 30\) minutes, which is 0.5 hours.

Edge case: start equals end

If both times are identical, \(\Delta = 0\) and \((0 + 1440) \bmod 1440 = 0\), so the result is 0 hours. A full 24-hour span cannot be represented this way; the calculator treats identical times as zero elapsed time.

Advertisement

Minutes to Decimal Hours Conversion Table

Decimal hours = minutes ÷ 60. Values are rounded to three decimal places.

Minutes Decimal hours
5 0.083
6 0.10
10 0.167
15 0.25
20 0.333
30 0.50
40 0.667
45 0.75
50 0.833
60 1.00

12-hour to 24-hour clock

Enter times in 24-hour format (hours 0–23) in the calculator.

12-hour time 24-hour hour
12 AM (midnight) 0
1 AM 1
12 PM (noon) 12
1 PM 13
5 PM 17
11 PM 23

FAQ

What if the end time is before the start time? The calculator treats it as crossing midnight and adds 24 hours, so 22:00 to 06:00 returns 8 hours.

Can I get more than 24 hours? No. Because times are clock values without dates, the maximum span is just under 24 hours.

How do I convert PM times? Add 12 to the hour for PM (except 12 PM, which stays 12). For example 3 PM is hour 15.

Last updated:

Most popular in Time and Date

View all Time and Date calculators