Enter a start time and an end time and this calculator tells you how much time passed between them, in hours and minutes, in decimal hours and in minutes. It works across midnight, so a night shift from 10:30 PM to 6:15 AM is counted correctly as 7 hours and 45 minutes.
Formula
Minutes = end − start (both in minutes after midnight). If the end is earlier than the start, add 1,440 minutes (24 hours). HH:MM = ⌊minutes ÷ 60⌋ : (minutes mod 60); decimal hours = minutes ÷ 60.
How it works
Enter when something starts and when it ends. Both times are turned into minutes after midnight and subtracted. When the end time is earlier than the start, such as a night shift from 22:30 to 06:15, the calculator assumes it ends the next day and adds 24 hours. You get the result as HH:MM, as decimal hours for timesheets and invoices, and as total minutes.
How to calculate the time between two times
Turn both times into minutes after midnight: hours × 60 + minutes. Then subtract the start from the end. 8:15 AM is 495 minutes and 5:45 PM is 1,065 minutes, so the difference is 570 minutes, which is 9 hours and 30 minutes.
If the end time is earlier than the start, the period crossed midnight. Add 24 hours (1,440 minutes) to the end before subtracting. The calculator does this automatically and also divides the minutes by 60 to give decimal hours, the format payroll and invoicing tools usually expect.
Worked example: a night shift from 22:30 to 06:15
22:30 is 1,350 minutes after midnight and 06:15 is 375. Since the end is earlier, add 1,440: 375 + 1,440 = 1,815. Subtracting 1,350 gives 465 minutes, which is 7 hours and 45 minutes, or 7.75 decimal hours.
At $22 an hour, that shift is worth 7.75 × 22 = $170.50. Typing 7.45 into a spreadsheet instead of 7.75 would underpay by about $6.60, which is why the decimal value matters.
Edge cases: equal times, breaks and periods over 24 hours
When start and end are the same, the result is 0, not 24 hours. Two clock times cannot tell whether a whole day passed, so for spans longer than 24 hours count the days with the days between dates calculator and add the hours separately.
This tool measures elapsed time only. To subtract a lunch break and compare against a daily target, use the work hours calculator, which takes clock-in, break and clock-out times.
Common mistakes
Subtracting times like ordinary numbers is the classic error: 17.45 minus 8.15 gives 9.30, which looks right by accident here but fails as soon as minutes need borrowing (5:10 PM minus 8:45 AM is 8:25, not 8.65). Always work in minutes.
The other mistake is mixing 12 hour and 24 hour formats. 6:15 in the morning and 6:15 in the evening are 12 hours apart; the time fields use the 24 hour clock to avoid that. To convert any HH:MM value to decimal and back, see the hours to decimal converter.
Frequently Asked Questions
- What if the period is longer than 24 hours?
- Two clock times alone cannot show that. For multi-day spans, use the days between dates calculator for the days and add the hours with the hours calculator.
- How many hours are there between 8:15 AM and 5:45 PM?
- 9 hours and 30 minutes, or 9.5 decimal hours (570 minutes).
- How do I calculate hours that go past midnight?
- Add 24 hours to the end time before subtracting. From 22:30 to 06:15 is (6:15 + 24:00) minus 22:30 = 7:45.
- How do I write 7 hours 45 minutes in decimal?
- Divide the minutes by 60: 45 ÷ 60 = 0.75, so 7 hours 45 minutes is 7.75 hours.
- Can I enter AM and PM?
- The fields use the 24 hour clock. For PM times add 12 to the hour: 5:45 PM is 17:45. Midnight is 00:00 and noon is 12:00.