Hours calculator

Find the duration between a start and end time, including overnight shifts, in hours and minutes.

Duration: -

Formula and algorithm

Worked examples

Work day

Input: 09:00 to 17:30

Output: 8h 30m (8.5 hours)

510 minutes between the two times.

Night shift

Input: 22:00 to 06:00

Output: 8h 0m (8 hours)

Crosses midnight, so 8 hours total.

Short break

Input: 12:15 to 12:45

Output: 0h 30m (0.5 hours)

30 minutes.

FAQ

Does it handle overnight times?

Yes. If the end is before the start, it assumes the end is on the next day.

What are decimal hours?

The duration as a single number (e.g. 8h 30m = 8.5), useful for timesheets and pay.

Does it use a 24-hour clock?

Enter times in 24-hour HH:MM format; most browsers show a clock picker.

Updated: June 7, 2026