Why use Hours Calculator
The hours between two times are the end time minus the start time, less any break. From 9:00 AM to 5:30 PM is 8 hours 30 minutes, and with a 30-minute lunch that leaves 8 hours, or 8.00 in decimal. This hours calculator does that subtraction for one pair of times. Enter each time in 12-hour form with AM or PM or in 24-hour form, add break minutes if you need to, and it returns the duration as h:mm, in words, as decimal hours and as total minutes. When the end time is earlier than the start, it counts the end as the next day, so night shifts work without any extra setting.
Hours in common shifts, with and without a break
Each row was run through the calculator. Time on the clock is end minus start; hours after break is what is left once the break is removed.
| Start | End | Time on the clock | Break | Hours after break | Decimal hours |
|---|---|---|---|---|---|
| 9:00 AM | 5:00 PM | 8 hours | none | 8:00 | 8.00 |
| 9:00 AM | 5:00 PM | 8 hours | 30 min | 7:30 | 7.50 |
| 9:00 AM | 5:00 PM | 8 hours | 60 min | 7:00 | 7.00 |
| 9:00 AM | 5:30 PM | 8 hours 30 minutes | 30 min | 8:00 | 8.00 |
| 9:00 AM | 6:00 PM | 9 hours | 60 min | 8:00 | 8.00 |
| 8:00 AM | 4:30 PM | 8 hours 30 minutes | 30 min | 8:00 | 8.00 |
| 8:00 AM | 5:00 PM | 9 hours | 60 min | 8:00 | 8.00 |
| 8:30 AM | 5:00 PM | 8 hours 30 minutes | 60 min | 7:30 | 7.50 |
| 7:00 AM | 3:30 PM | 8 hours 30 minutes | 30 min | 8:00 | 8.00 |
| 6:00 AM | 2:00 PM | 8 hours | 20 min | 7:40 | 7.67 |
| 2:00 PM | 10:00 PM | 8 hours | 30 min | 7:30 | 7.50 |
| 10:00 PM | 6:00 AM | 8 hours | 30 min | 7:30 | 7.50 |
| 11:00 PM | 7:00 AM | 8 hours | 30 min | 7:30 | 7.50 |
| 7:00 AM | 7:00 PM | 12 hours | 60 min | 11:00 | 11.00 |
| 7:00 PM | 7:00 AM | 12 hours | 60 min | 11:00 | 11.00 |
Formula for hours between a start time and an end time
Hours = (end time − start time) − break, where 24 hours are added to the end time if it is earlier than the start time
Convert both times to minutes after midnight, subtract, then take off the break. For 9:05 AM to 5:20 PM with a 30-minute break: 5:20 PM is 17 × 60 + 20 = 1,040 minutes and 9:05 AM is 9 × 60 + 5 = 545 minutes. 1,040 − 545 = 495 minutes, and 495 − 30 = 465 minutes. Dividing by 60 gives 7 hours with 45 minutes left over, so the answer is 7:45, or 465 ÷ 60 = 7.75 decimal hours. The calculator returns exactly these figures for those inputs.
Worked examples, including an overnight shift
Office day with a half-hour lunch
Start time 9:00 AM, End time 5:30 PM, Break 30
Hours after break 8:00, Decimal hours 8.00, Total minutes 480
These are the values the page loads with. The Breakdown shows 8 hours 30 minutes on the clock before the break.
Night shift that crosses midnight
Start time 10:00 PM, End time 6:00 AM, Break 30
Hours after break 7:30, Decimal hours 7.50, Total minutes 450
6:00 AM is earlier than 10:00 PM, so the end is counted as the next day: 2 hours before midnight plus 6 after is 8 hours, minus the break.
24-hour times typed without a colon
Start time 0900, End time 1730, Break 0
Hours between 8:30, Decimal hours 8.50, Total minutes 510
Two minutes across midnight
Start time 11:59 PM, End time 12:01 AM, Break 0
Hours between 0:02, Decimal hours 0.03, Total minutes 2
12:01 AM is one minute after midnight, not one minute after noon.
Times with seconds
Start time 8:15:30, End time 12:00:10, Break 0
Hours between 3:44:40, Decimal hours 3.74, Total minutes 224.67, Total seconds 13,480
Seconds appear in the result only when one of the inputs has them.
A full day
Start time 9:00, End time 9:00, End time falls on: The next day
Hours between 24:00, Decimal hours 24.00, Total minutes 1,440
On Automatic, identical start and end times give 0 and a note explaining why.
Time formats the start and end fields accept
A time without AM or PM is read as 24-hour time, so 5:30 on its own means 5:30 in the morning.
- 12-hour with a suffix: 9:00 AM, 9:00am, 9 am, 9a, 5:30 PM, 5:30 p.m.
- 24-hour with a colon: 09:00, 9:00, 17:30, 00:15.
- 24-hour without a colon: 0900, 1730, 930.
- A bare hour: 9 means 09:00 and 17 means 17:00.
- With seconds: 8:15:30 or 8:15:30 PM.
- The words noon, midday and midnight.
- 24:00 for midnight at the end of the day, so 00:00 to 24:00 is 24 hours.
- A dot instead of a colon, as in 9.30 am.
Breaks, midnight and the limits of a two-time calculation
The break is a single number of minutes taken off the elapsed time. If you had two breaks, add them and enter the sum. A break longer than the span between the two times is rejected with a message rather than shown as a negative or zero result, because it nearly always means one of the times was mistyped.
12:00 AM is midnight and 12:00 PM is noon. Mixing these up is the most common reason a result is 12 hours out, so check the suffix when a shift starts or ends at twelve.
The result covers one start and one end within a 24-hour window, or up to 48 hours with The next day selected. It does not take dates, so it cannot measure a span of several days, and it does not allow for a clock change: on the night clocks go forward or back, an overnight shift is an hour shorter or longer than the figure shown. For several shifts with a weekly total and pay, the timesheet calculator on this site takes a list of shifts instead of one pair of times.
How to use it
- 1
In Start time, type when the period begins, for example 9:00 AM, 9am, 09:00 or 0900.
- 2
In End time, type when it finishes, for example 5:30 PM or 17:30. The two fields do not have to use the same format.
- 3
In Break (minutes), enter the unpaid break to subtract, or 0 if there is none.
- 4
Leave End time falls on set to Automatic unless you want to force The same day or The next day, for instance to measure a full 24 hours.
- 5
Read Hours after break (or Hours between when the break is 0), Decimal hours and Total minutes under Result. The Breakdown table shows the time before and after the break.