Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Total Duration
8.5
hours
Hours and minutes 8 h 30 min
Total minutes 510 min

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}$$
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.

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: