Time Duration Calculator
Compute the elapsed time between two clock times (hh:mm to hh:mm), handling midnight wrap-around. Returns the duration in decimal hours.
Last updated: September 2026
Compare with similar
About this calculator
The duration between two clock times is the difference in minutes, modulo one day. Modding by 1440 (= 24 × 60) is what makes an overnight shift work: if you clock in at 22:00 and out at 06:00, the raw subtraction gives −16 hours, but adding one day and taking the remainder gives 8 hours, which is the answer you want.
This calculator returns decimal hours: 8 h 30 min shows as 8.5. To read back the minutes, take the fractional part times 60 (0.5 × 60 = 30 min).
The wrap-around behaviour assumes the end time is later on the clock than the start time within a single 24-hour window. If you actually mean multi-day durations (e.g. Monday 09:00 to Wednesday 17:00), use the day counter at /en/calculators/time-zones/day-counter/ for the day count and add the intraday difference on top.
How to use
Example — a standard workday. Start at 09:00, end at 17:30. Enter start hour 9, start minute 0, end hour 17, end minute 30. Result = ((17*60 + 30) − (9*60 + 0)) / 60 = (1050 − 540) / 60 = 510 / 60 = 8.5 hours. Subtract a 30-minute unpaid lunch and you have 8.0 hours paid. Example — an overnight shift. 22:00 to 06:00. Enter 22, 0, 6, 0. Raw difference = 360 − 1320 = −960 min. Add 1440 and mod: (−960 + 1440) % 1440 = 480 min = 8.0 hours. That is the expected 8-hour overnight.
Frequently asked questions
How do I handle a shift that spans more than one day?
This calculator wraps at 24 hours, so it treats 08:00 → 09:00 the next day as one hour, not 25. For multi-day work, split the calculation: compute whole days with /en/calculators/time-zones/day-counter/, then add the hh:mm-to-hh:mm difference for the last partial day using this calculator.
Can I enter 12-hour (AM/PM) times?
Convert to 24-hour first: 1 PM = 13, 6 PM = 18, midnight = 0, noon = 12. This calculator uses 24-hour input to avoid the standing AM/PM ambiguity around midnight and noon.
How do I convert the decimal result to hours and minutes?
Take the integer part as hours and the fractional part × 60 as minutes. 8.5 hours = 8 h 30 min. 7.75 hours = 7 h 45 min. 6.25 hours = 6 h 15 min. This is the same trick used on time cards to convert fractional-hour totals into a payroll-friendly form.
What if my time entries include seconds?
Round the seconds into the minute — 08:32:15 becomes 08:32 (round down) or 08:33 (round up), depending on your policy. For payroll, most employers round to the nearest quarter-hour (0.25 h) or tenth-hour (0.1 h); the FLSA in the US permits this as long as the rounding does not systematically favour the employer.