Time Duration Calculator
Free Time Duration Calculator. Calculate the time difference between two times, including hours, minutes, and overnight durations.
What does this Time Duration Calculator do?
This calculator finds the elapsed time between two clock times (in HH:MM format), correctly handling durations that cross midnight — useful for calculating work shift lengths, sleep duration, or any time span within a day or overnight.
How the calculation works
The calculator converts both times to total minutes since midnight, subtracts the start from the end, and if the result is negative (meaning the end time is technically "before" the start time on the clock), it adds 24 hours' worth of minutes to correctly account for the overnight rollover.
Step-by-step example
From 09:00 to 17:30: 17:30 is 1,050 minutes since midnight, 09:00 is 540 minutes. Difference = 510 minutes = 8 hours 30 minutes.
For an overnight shift from 22:00 to 06:00: 06:00 (360 minutes) minus 22:00 (1,320 minutes) gives −960, so the calculator adds 1,440 (24 hours in minutes) to get 480 minutes = 8 hours.
Tips & common mistakes
- Always enter times in 24-hour HH:MM format (e.g., 22:00 for 10 PM) to avoid AM/PM ambiguity.
- The overnight-crossing logic assumes the end time is on the next calendar day whenever it's numerically earlier than the start time — this is correct for shift/sleep calculations but wouldn't apply if you genuinely meant a negative duration.
Common uses
This calculator is useful for tracking work shift lengths (especially overnight shifts), calculating sleep duration between bedtime and wake time, timing how long a meeting or class ran, and any other situation where you know a start and end clock time and need the elapsed duration.
24-hour format, explained
If you're more used to 12-hour AM/PM format, converting is straightforward: times from midnight to noon stay the same (1:00 AM = 01:00), while afternoon and evening times add 12 (2:00 PM = 14:00). Using 24-hour format avoids any AM/PM ambiguity in the calculation.
Calculating total hours across multiple shifts
For payroll purposes involving several shifts in a pay period, you'd typically calculate each individual shift's duration with a tool like this one, then sum those durations together — this calculator handles one start/end pair at a time, so multi-shift totals require adding up several individual results.
Time duration and overtime calculations
Many workplaces calculate overtime based on hours worked beyond a threshold within a day or week — having an exact duration (rather than a rounded estimate) matters for correctly calculating overtime pay, especially for shifts that don't start and end on neat round hours.
A worked example: a split shift
For a split shift working 08:00–12:00 and then 16:00–20:00: the first segment is 4 hours, the second is also 4 hours, for a total of 8 hours worked across the day despite a 4-hour unpaid gap in the middle. Calculating each segment separately and summing them is the correct approach for any non-continuous work period.
Frequently asked questions
Yes — if the end time is earlier than the start time, the calculator assumes it falls on the next day and adds 24 hours automatically.
A zero-duration result (0h 0m) is the mathematically correct output if the start and end times are exactly the same, representing no elapsed time.