Calculating Hours for Overnight Shifts

When a shift runs past midnight, the clock out is earlier than the clock in. Add 24 hours to the clock out, then subtract. Here is how, and what trips people up.

Open the Hours Worked Calculator →

The method

When the clock out is earlier than the clock in, the shift crossed midnight. Add 24 hours to the clock out before you subtract:

hours worked = (clock out + 24:00) − clock in − unpaid break

The calculators do this with a modulo: (out − in) mod 24 hours, which gives the same answer.

Worked examples

Clock in Clock out Calculation Hours
10:00 PM 6:00 AM (6:00 + 24:00) − 22:00 8:00
11:45 PM 12:15 AM (0:15 + 24:00) − 23:45 0:30
7:00 PM 7:30 AM, 30 min break (7:30 + 24:00) − 19:00 = 12:30, minus 0:30 12:00
12:00 AM 8:00 AM 8:00 − 0:00 8:00

A shift starting at midnight is not an overnight shift in this sense: the clock out is already later than the clock in.

Which day do the hours belong to?

Most employers count an overnight shift on the day it started, so a Sunday 10 PM to Monday 6 AM shift belongs to Sunday. The calculator does the same.

That choice matters in two places:

  • Daily overtime. Where overtime depends on hours in a single day, assigning the whole shift to one day puts all the hours in one day’s count. How a state defines the “workday” can change the answer, and this calculator does not model that.
  • The end of the workweek. A shift that starts on the last day of a workweek and finishes in the next one still counts entirely in the first week in this calculator. Payroll systems vary in how they split hours at midnight. Ask your employer how it handles this if the week boundary matters to you.

Daylight saving time

Two nights a year the clocks change, and the difference between your clock in and clock out time is not the real time worked:

  • When the clocks go forward an hour, a 10 PM to 6 AM shift is 7 hours.
  • When they go back, the same shift is 9 hours.

The calculator uses wall-clock times and does not know the date, so it shows 8 hours on both nights. Add or subtract an hour yourself for that shift.

Rounding and breaks

If your employer rounds punches, round each punch first and then subtract. 11:53 PM to 7:58 AM with a 15 minute step becomes 12:00 AM to 8:00 AM, which is 8 hours. See the 7-minute rounding rule. Enter only unpaid break minutes, and read paid and unpaid breaks if you are unsure which is which.

Try it

The hours worked calculator handles an overnight shift with no extra steps: type the start and end, and use the AM/PM boxes. For a full week with overtime and pay, use the time card calculator.

Frequently asked questions

How do you calculate hours for a shift that goes past midnight?

Add 24 hours to the clock out time, then subtract the clock in. 10:00 PM to 6:00 AM: 6:00 + 24:00 = 30:00. 30:00 − 22:00 = 8 hours.

Which day do the hours of an overnight shift belong to?

The usual approach is the day the shift started. The calculator assigns the whole shift to its start day. Your employer's payroll may split hours at midnight, which can matter at the end of a workweek, so check how it handles that.

What happens on the night the clocks change?

A shift that spans the clock change is an hour longer or shorter in real life than the difference between the two clock times. The calculator subtracts clock times and does not model daylight saving, so adjust by one hour on that night.

Why does my overnight shift show 0 hours?

Probably the start and end time are the same, which counts as 0 hours, not 24. Another cause is a break longer than the shift. Check the end time and the break minutes.

Is there a maximum length for a shift in the calculator?

A single shift must be under 24 hours. For longer stretches, enter each block as its own shift on separate days.