How to Calculate Hours Between Two Times
To calculate the hours between two times, convert both to 24-hour time and subtract the start from the end, adding 24 hours to the end if it is earlier. For example, 8:45 AM to 5:15 PM is 17:15 − 8:45 = 8 hours 30 minutes, or 8.50 decimal hours.
How to calculate hours between two times by hand
Work on the 24-hour clock, where every time of day is a single reading from 00:00 to 23:59 and no AM or PM can be misread.
- Convert both times. Add 12 to PM hours from 1 PM to 11 PM, keep 12 PM (noon) as 12, and write 12 AM (midnight) as 00.
- Add 24 hours to the end time if it is earlier than the start time, because the span crosses midnight.
- Borrow 1 hour from the end time if its minutes are smaller than the start minutes, and add those 60 minutes to the end minutes.
- Subtract the minutes, then the hours.
Take 8:45 AM to 5:15 PM. In 24-hour time that is 08:45 to 17:15. The end minutes (15) are smaller than the start minutes (45), so 17:15 is rewritten as 16 hours 75 minutes, and 16:75 − 8:45 leaves 8 hours 30 minutes.
Step through the subtraction
Pick a start and an end time. The worksheet subtracts them the way you would on paper, and the buttons move through the five steps one at a time.
- Convert both times to 24-hour time. 8:45 AM is 08:45 and 5:15 PM is 17:15 on the 24-hour clock.
- Check whether the span crosses midnight. The end (17:15) is not earlier than the start (08:45), so both times fall on the same day and nothing changes.
- Borrow 60 minutes if needed. 15 minutes is less than 45 minutes, so borrow 1 hour as 60 minutes: 17:15 becomes 16 h 75 min.
- Subtract hours and minutes. 16 − 8 = 8 hours and 75 − 45 = 30 minutes, so the span is 8 hours 30 minutes.
- Convert to decimal hours. 30 ÷ 60 = 0.50, so 8 h 30 min = 8.50 hours.
Step 5 of 5
Worked examples, including overnight shifts
Where a borrow happens, the subtraction column shows the end time after it, so 17:15 appears as 16:75. The last three rows end after midnight and had 24 hours added to the end time first.
| Start | End | Subtraction | Time between | Decimal hours |
|---|---|---|---|---|
| 8:45 AM | 5:15 PM | 16:75 − 8:45 | 8 h 30 min | 8.50 |
| 7:20 AM | 3:05 PM | 14:65 − 7:20 | 7 h 45 min | 7.75 |
| 6:50 AM | 12:25 PM | 11:85 − 6:50 | 5 h 35 min | 5.58 |
| 11:40 AM | 2:10 PM | 13:70 − 11:40 | 2 h 30 min | 2.50 |
| 10:50 PM | 7:20 AM | 30:80 − 22:50 | 8 h 30 min | 8.50 |
| 11:30 PM | 6:10 AM | 29:70 − 23:30 | 6 h 40 min | 6.67 |
| 6:15 PM | 12:05 AM | 23:65 − 18:15 | 5 h 50 min | 5.83 |
Checking an overnight span at midnight
Split the span at midnight and add the two parts. For 10:50 PM to 7:20 AM, the part before midnight is 1 hour 10 minutes and the part after is 7 hours 20 minutes. Together they make 8 hours 30 minutes, the same as the subtraction.
A span that crosses more than one midnight needs 24 hours for each one. From 9:00 PM on Monday to 6:00 AM on Wednesday, the end becomes 6:00 + 48:00 = 54:00, and 54:00 − 21:00 = 33 hours.
Two shortcuts that avoid borrowing
Counting up is the easiest method to do in your head. Go from the start time to the next whole hour, count the whole hours, then add the minutes past the last one. For 8:45 AM to 5:15 PM, that is 15 minutes to 9:00, 8 hours to 5:00 and 15 minutes more, or 8 hours 30 minutes.
Converting both times to minutes after midnight suits spreadsheets and code. 5:15 PM is 17 × 60 + 15 = 1,035 minutes and 8:45 AM is 8 × 60 + 45 = 525. The span is 1,035 − 525 = 510 minutes, or 8 hours 30 minutes. For an overnight span, add 1,440 minutes (one day) to the end first: 10:50 PM to 7:20 AM is 440 + 1,440 − 1,370 = 510 minutes.
Common mistakes when subtracting times
- Subtracting the times as decimals gives 17.15 − 8.45 = 8.70. The real span is 8 hours 30 minutes, or 8.50 hours, and the shortcut adds 12 minutes because an hour has 60 minutes, not 100.
- Reading leftover minutes as a decimal turns 5 hours 50 minutes into 5.50 hours. The correct value is 5.83, so 20 minutes go missing.
- Treating 12 PM as midnight writes 12:30 PM as 00:30 instead of 12:30. A 12:30 PM to 4:00 PM shift of 3 hours 30 minutes then comes out as 15 hours 30 minutes.
- Skipping the 24-hour step leaves 10:50 PM to 7:20 AM as 7:20 − 22:50, a negative span.
- Ignoring a clock change measures clock readings instead of elapsed time. On the night clocks spring forward, 10:00 PM to 6:00 AM lasts 7 real hours, and on the night they fall back it lasts 9. Check the clock change dates for any shift in March or November.
Decimal hours and unpaid breaks
Payroll usually wants decimal hours. Divide the leftover minutes by 60 and keep the whole hours, so 7 hours 45 minutes is 7 + 45 ÷ 60 = 7.75 hours. The minutes-to-decimal chart lists every value from 1 to 60 minutes.
Take an unpaid break off after the subtraction. 7:20 AM to 3:05 PM is 7 hours 45 minutes, and a 30-minute unpaid lunch leaves 7 hours 15 minutes, or 7.25 hours. A whole week of shifts totals the same way on a weekly time card, and the guide to time card math explains which breaks count as work time.
Hours between two times in Excel or Google Sheets
Spreadsheets store a time as a fraction of a 24-hour day, so the difference between two times is a fraction too. Multiply it by 24 for hours or by 1,440 for minutes. These formulas assume the start time is in A2, the end time in B2 and an unpaid break in minutes in C2. The results are for 8:45 AM to 5:15 PM with a 30-minute break.
| Formula | Result | What it gives |
|---|---|---|
=(B2-A2)*24 |
8.5 | Decimal hours for a span within one day |
=MOD(B2-A2,1)*24 |
8.5 | Decimal hours for any span under 24 hours, including overnight |
=MOD(B2-A2,1)*1440 |
510 | Total minutes |
=MOD(B2-A2,1)*24-C2/60 |
8 | Decimal hours after the unpaid break |
=MOD(B2-A2,1) with the format [h]:mm |
8:30 | Hours and minutes |
Without MOD, an overnight span is a negative fraction of a day, and Excel shows a negative time as a cell full of # signs. MOD(…, 1) adds the missing day. For spans longer than 24 hours, enter the full date with each time and subtract those instead.
Frequently asked questions
How do I subtract times that include seconds?
Borrow from the minutes the same way you borrow from the hours. For 1:45:50 PM to 2:10:05 PM, 14:10:05 becomes 14:09:65 and then 13:69:65, and subtracting 13:45:50 leaves 24 minutes 15 seconds.
How do I find the hours between times in different time zones?
Convert one time into the other's zone first. A flight leaving New York at 8:00 AM Eastern and landing in Los Angeles at 11:15 AM Pacific lands at 2:15 PM Eastern, so the trip takes 6 hours 15 minutes.
How many hours is it from noon to midnight?
12 hours. Noon is 12:00 and the midnight that ends the day is 24:00, so 24:00 − 12:00 = 12:00.
Related guides
- How to add hours and minutes
Add durations column by column and carry every 60 minutes into the hours, with clock-time, spreadsheet and time sheet examples.
Related calculators
- Time Addition Calculator
Add or subtract hours, minutes and seconds, or find the time X hours from a start time.
- Hours Until Midnight
A live countdown to midnight, or to any clock time, in hours, minutes and seconds.