How to Calculate Hours Worked Between Two Times (With Breaks)
Calculate hours and minutes between two times, subtract unpaid breaks, handle overnight shifts crossing midnight, and convert to decimal hours for payroll.
"9:15 to 5:45, minus a 30-minute lunch." Most timesheet errors start there — mental math on the clock, a rounded break, an overnight shift that wraps past midnight. Here's how to get the exact number every time.
The basic method
- Convert both times to minutes since midnight. 9:15 is 555. 17:45 is 1065.
- Subtract: 1065 − 555 = 510 minutes.
- Divide by 60 for hours: 510 / 60 = 8.5 hours, or 8 h 30 m.
Once you have minutes, everything else — breaks, rounding, decimal payroll — is arithmetic.
Subtracting unpaid breaks
Most US employers don't pay for meal breaks of 30 minutes or more if the employee is fully relieved of duty. Short rest breaks (under 20 minutes) usually stay paid. Subtract only the unpaid portion:paid_minutes = end − start − unpaid_break
Our Time Duration Calculator takes an optional break value and applies it in the same step.
Overnight shifts that cross midnight
A shift from 22:00 to 06:00 looks negative if you just subtract (6 − 22 = −16). Fix it by adding 24 hours to the end whenever it's less than the start:
- End 06:00 → 06:00 + 24:00 = 30:00
- 30:00 − 22:00 = 8 hours
Same rule works for any shift that wraps past midnight, including split shifts recombined into one entry.
Decimal hours for payroll
Payroll systems almost always want decimal hours, not hours and minutes. The rule: minutes / 60. 15 min = 0.25, 30 min = 0.50, 45 min = 0.75. So 8 h 20 m becomes 8.33, not 8.20 — a common typo that quietly underpays or overpays every pay period.
Rounding rules
The FLSA in the US allows rounding to the nearest quarter hour (7-minute rule) as long as it doesn't systematically shortchange the worker over time. Round consistently. If you round clock-in down, round clock-out down too — never round both toward the shorter shift.
Excel and Google Sheets
=(end - start) * 24 gives decimal hours when both cells are formatted as time. Add + (end < start) to handle overnight shifts: =(end - start + (end < start)) * 24. Subtract breaks the same way: - break_minutes/60.
The fast way
Skip the arithmetic. The Time Duration Calculator handles midnight rollover, break subtraction, and decimal-hour output automatically. For multi-day timesheets or PTO accruals, pair it with the Business Days Calculator to count only working days in the range.