How long between 9:30 AM and 5:45 PM — or between a 10 PM departure and a 6:30 AM arrival? Enter any start and end time on the 24-hour clock and get the exact duration, including overnight spans.
Whenever the end time is earlier than the start time, it is treated as falling on the next day — the standard assumption for shifts, flights and journeys.
Payroll, billing and timesheets often need hours as a decimal (8.25 instead of 8:15). Both forms are shown so you can use whichever your form demands.
Identical times mean a duration of zero — enter an end time earlier than the start if you mean a full day later.
The calculator turns both clock times into minutes since midnight — hour × 60 + minute — and subtracts the start from the end. If the end time is earlier than the start time, it adds a full day (1,440 minutes) to the end first, which is what makes overnight spans work: the end is treated as falling on the next day. The result is then shown three ways: as hours and minutes, as a total minute count, and as decimal hours (minutes ÷ 60) for timesheets and billing.
Formula: Duration in minutes = (end hour × 60 + end minute) − (start hour × 60 + start minute), plus 1,440 if that result is negative. Decimal hours = duration in minutes ÷ 60.
Inputs: Start time 22:45 (10:45 PM); end time 05:15 (5:15 AM).
Steps: Start = 22 × 60 + 45 = 1,365 minutes. End = 5 × 60 + 15 = 315 minutes. 315 − 1,365 is negative, so add 1,440: the duration is 390 minutes, which is 6 hours and 30 minutes, or 390 ÷ 60 = 6.5 decimal hours.
Result: Duration: 6 hours, 30 minutes — 390 minutes in total, shown from 10:45 PM to 5:15 AM (next day).
On the 24-hour clock: hours run from 0 to 23 and minutes from 0 to 59, so 5:45 PM is entered as hour 17, minute 45. The start and end times in the result are displayed back in 12-hour AM/PM form so they are easy to recognise.
Just under a full day — 23 hours and 59 minutes. Both times sit inside a single day, and an earlier end time rolls over by exactly one day, so for spans of several days you would add whole days yourself or use a date-based calculator.
The calculator rejects it with a message asking for hours from 0 to 23 and minutes from 0 to 59. Hours and minutes must also be whole numbers — 9.5 as an hour is not accepted.
Enter hour 0 and minute 0 for the start. A shift from 0:00 to 8:00 is then calculated as a plain 8 hours, with no overnight rollover involved.
No. Minutes are the smallest unit it works with, so round the start and end times to the nearest minute before entering them.
Add this calculator to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the calculator to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.