Hours Worked Calculator

Calculate hours worked from clock-in and clock-out times, including overnight shifts and unpaid breaks. Decimal hours and the matching spreadsheet formula, tested 12 November 2026.

One shift

Enter a clock-in and clock-out time. If the out time is earlier than the in time, the shift is counted as ending the next morning. The 22:00–06:00 example below, with a 30-minute break, should read 7:30 and 7.5 hours.

Hours : minutes7:30
Decimal hours7.5
Total minutes450

A seven-day timesheet

Add as many days as you need. The weekly total is the sum of the rows, in hours:minutes and in decimal hours. Hours above 40 are shown as a simple arithmetic leftover, not as legal overtime.

Day Clock in Clock out Break (min) Hours
Mon —
Tue —
Wed —
Thu —
Fri —
Sat —
Sun —
Week total0:00
Decimal hours0
Above 40 hours0

The spreadsheet formula

The calculator uses the same arithmetic as this Google Sheets and Excel formula, with the start time in C2, the end time in D2, and the unpaid break in minutes in E2:

=ROUND((MOD(D2-C2,1)-E2/1440)*24,2)

On 12 November 2026 I entered that formula in Google Sheets. A 22:00 to 06:00 shift with a 30-minute break returned 7.5. A 09:00 to 17:30 shift with the same break returned 8. Those are the figures this page is built around.

MOD(...,1) folds a negative difference back into a positive duration, which is what you want when the end time is the next morning and both cells hold a time of day, not a date. The same check produced 8 hours for 18:00 to 02:15 with a 15-minute break, and 7.5 hours for a 00:30 to 08:30 start that never crossed midnight at all.

Without ROUND, the overnight 22:00–06:00 case came back as 7.500000000000002. Two-decimal rounding is not cosmetic; it is what stops a pay formula from multiplying a stray fraction of a second. The earlier [overnight timesheet tutorial](/excel/hours-worked-overnight-shift/) walks through the same formula, including a weekly layout and the case of a 24-hour shift, which this calculator does not try to handle.

Format a duration such as 7:30 with a time format of h:mm, or in Google Sheets with Format > Number > Duration. If you total several days and the sum might go past 24 hours, use the duration format described in [how to sum time over 24 hours](/google-sheets/sum-time-over-24-hours/).

What the formula will not do for you

When clock-in and clock-out are the same time, MOD(D2-C2,1) returned 0. It does not assume a 24-hour shift. If someone actually worked around the clock, store a date with each time instead of a time-only value.

If the break is longer than the shift, Sheets returns a negative number. A 09:00 to 10:00 shift with a 90-minute break calculated as −0.5 hours. Formatted as a time, that same cell showed 23:30, which looks like a long shift and is the wrong reading. The calculator reports an error in that situation rather than a wrapped time.

Hours above 40 in the weekly total are just the decimal hours minus 40, when that remainder is positive. Pay rules vary, and this page does not apply them.

FAQ

How do I calculate hours worked overnight?

If the clock-out time is earlier than the clock-in time, the shift is treated as ending the next day. In Excel or Google Sheets, =MOD(end-start,1) does the same thing for shifts shorter than 24 hours.

How do I subtract an unpaid break?

Enter the break in minutes. The calculator subtracts it from the shift length. In a spreadsheet, use =MOD(end-start,1)-break/1440, because there are 1,440 minutes in a day.

Why do payroll sheets want decimal hours?

7:30 is a duration; 7.5 is what most hourly-pay formulas multiply by a rate. Multiply the duration by 24, then ROUND to two decimal places to clear floating-point leftovers.

What if clock-in and clock-out are the same time?

The MOD formula and this calculator both return zero. A shift of 24 hours or longer needs a date on each time, not time-only values.

Oscar

专注电子表格公式与排错;具体测试环境和待验证事项见各篇文章。

Tested in Google Sheets, 12 November 2026.