Time Duration Calculator
Free time duration calculator — type a start time and end time and get the hours and minutes between them. Handles times that cross midnight. Works in your browser.
Type a start time and an end time. The calculator returns the duration in hours and minutes, automatically wrapping past midnight if the end is earlier than the start.
Math
Both times are parsed as minutes since midnight (HH × 60 + MM). The duration is end − start; if that’s negative, add 24 × 60 (a day). Divide by 60 for hours, modulo 60 for the remaining minutes.
09:00 → 17:30:
17 × 60 + 30 − (9 × 60) = 1,050 − 540 = 510 minutes = 8 h 30 min.
22:00 → 06:30:
6 × 60 + 30 − (22 × 60) = 390 − 1,320 = −930; +1,440 = 510 minutes = 8 h 30 min.
Why 24-hour
The page uses a 24-hour dropdown because AM/PM is the leading source of bugs in any shift-time tool. “12 PM” vs “12 AM” trips up surprising numbers of off-the-shelf calculators (and humans).
Common uses
- Work hours (with or without a break — subtract the break separately)
- Sleep duration
- Travel / drive time between two clock times
- Course or event length
For multi-day spans, pair this with the days-between-dates calculator — days for the calendar part, this one for the partial-day hours.
Worked examples
-
Standard workday: 09:00 → 17:30
8 hours and 30 minutes.
-
Night shift crossing midnight: 22:00 → 06:30
8 hours and 30 minutes.
Frequently asked questions
How does this handle times that cross midnight?
If the end time is earlier than the start time, the calculator treats it as crossing midnight and adds 24 hours. So 22:00 to 06:30 returns 8 hours 30 minutes, not −15 hours 30 minutes. Useful for night shifts, sleep duration, and overnight travel.
12-hour or 24-hour format?
24-hour. "9:00" is morning, "21:00" is evening. The page uses a 24-hour dropdown to avoid the AM/PM ambiguity that bites every shift calculator at the noon and midnight boundaries.
How are partial-minute or seconds handled?
Whole minutes only. The calculator parses HH:MM. For sub-minute precision, treat both inputs as a number of minutes since midnight (so 9:30:15 ≈ 570.25) and use the percentage calculator or do the math by hand — most use cases (shift, meeting, drive time) don't need that resolution.
Can I include a break?
Not in this version. For a shift with an unpaid break, calculate the full span and subtract the break separately — e.g. 9:00 → 17:30 = 8h 30m, minus a 30-minute lunch = 8h paid.
How is this different from the date-difference calculator?
Date difference is for whole days between calendar dates (Jan 1 → Feb 15). This is for clock times within a day, or crossing one midnight. For longer overnight spans (e.g. a 4-day trip), use date-difference for the days, this one for the partial-day hours.