Timesheet guide6 min readUpdated September 25, 2026

How to Calculate Hours Worked, Including Breaks and Overnight Shifts

The formula, a one-shift calculator, paid versus unpaid breaks, midnight shifts, a worked weekly timesheet and the spreadsheet formulas.

By Amara TaylorReviewed September 25, 2026

Quick answer: To calculate hours worked, subtract the start time from the end time, then subtract any unpaid breaks. Convert the leftover minutes to decimal by dividing by 60. A shift from 8:30 AM to 5:15 PM with a 30-minute unpaid lunch is 8 hours 45 minutes minus 30 minutes = 8 hours 15 minutes, or 8.25 hours.

The hours worked formula

hours worked = (end time − start time) − unpaid breaksThen divide any leftover minutes by 60 to get decimal hours.
  1. Write both times in 24-hour format. 5:15 PM becomes 17:15. This removes AM and PM mistakes.
  2. Subtract the start from the end. 17:15 − 8:30 = 8 hours 45 minutes. If the minutes go negative, borrow 60 minutes from the hours.
  3. Subtract unpaid breaks. 8:45 − 0:30 = 8 hours 15 minutes.
  4. Convert to decimal. 15 ÷ 60 = 0.25, so the shift is 8.25 hours.

Calculate one shift

An end time earlier than the start time is treated as an overnight shift.

Hours worked

8.25hours

    For a full week with a different break every day, the hours worked calculator totals each shift and the week.

    Paid breaks versus unpaid breaks

    Only unpaid breaks come off the total. Under federal rules the difference depends on length and whether the employee is truly off duty.

    Break typeFederal treatmentSubtract it?
    Rest break, 5 to 20 minutesCounted as hours worked (29 CFR 785.18)No
    Meal period, usually 30 minutes or more, fully relieved of dutyNot work time (29 CFR 785.19)Yes
    Meal period while still answering phones or watching equipmentWork time, because the employee is not relievedNo
    On-call time at the workplaceGenerally work timeNo

    Federal law does not require breaks, but many states do. California, for example, requires a 30-minute meal period for shifts over five hours and paid 10-minute rest breaks for every four hours worked or major fraction of four hours.

    Overnight shifts that cross midnight

    When the end time is earlier than the start time, the shift ran past midnight. Add 24 hours to the end time before subtracting.

    Example: a night shift

    1. Start 22:00 (10:00 PM), end 06:30 (6:30 AM).
    2. 06:30 is earlier than 22:00, so add 24 hours: 30:30.
    3. 30:30 − 22:00 = 8 hours 30 minutes.
    4. Subtract a 30-minute unpaid meal: 8 hours 0 minutes.

    Result: 8.00 hours

    In a spreadsheet, the MOD function handles midnight automatically: =MOD(B2-A2,1)*24 returns decimal hours whether or not the shift crosses midnight.

    Adding up a weekly timesheet

    Work out each day in minutes, add them together, then convert once. Rounding each day separately can shift the total by a few minutes.

    DayInOutUnpaid breakWorkedDecimal
    Mon8:0016:3030 min8 h 00 min8.00
    Tue8:0516:4030 min8 h 05 min8.08
    Wed7:5517:1045 min8 h 30 min8.50
    Thu8:0016:2030 min7 h 50 min7.83
    Fri8:1015:0030 min6 h 20 min6.33
    Total38 h 45 min38.75

    The weekly total is 38 hours 45 minutes, or 38.75 hours. Note that adding the rounded decimals day by day (8.00 + 8.08 + 8.50 + 7.83 + 6.33) gives 38.74, one hundredth short, which is why the total should be converted from minutes.

    Split shifts and multiple punches

    For a split shift, calculate each block separately and add them. A shift of 7:00 to 11:00 and 16:00 to 20:30 is 4 hours plus 4 hours 30 minutes, 8 hours 30 minutes in total. The gap between blocks is not work time unless the employee is required to stay on duty.

    Excel and Google Sheets formulas

    // Start in A2, end in B2, unpaid break minutes in C2
    =(B2-A2)*24-C2/60
    // Same, but safe for overnight shifts
    =MOD(B2-A2,1)*24-C2/60
    // Weekly total of decimal hours in D2:D8
    =SUM(D2:D8)

    Format the time columns as Time and the result column as Number with two decimals. If a cell shows a strange time instead of a number, the result is still formatted as Time.

    Mistakes that cost money

    • Deducting paid rest breaks. A 15-minute coffee break is paid time under federal rules.
    • Mixing AM and PM. 8:00 to 5:00 is 9 hours, not −3. Use 24-hour times.
    • Treating minutes as decimals. 7 hours 30 minutes is 7.50, not 7.30.
    • Ignoring pre-shift work. Required meetings, logging in and safety checks count as hours worked.
    • Rounding every punch in one direction. See the time clock rounding rules.

    Frequently asked questions

    How do I calculate hours worked in a day?

    Subtract the start time from the end time, then subtract unpaid breaks. 9:00 AM to 5:30 PM with a 30-minute unpaid lunch is 8 hours 30 minutes minus 30 minutes, which is 8 hours.

    How many hours is 8 AM to 5 PM?

    9 hours. With a 1-hour unpaid lunch it is 8 hours worked, and with a 30-minute unpaid lunch it is 8.5 hours.

    How do I calculate hours for a shift that crosses midnight?

    Add 24 hours to the end time before subtracting. 10 PM to 6 AM becomes 22:00 to 30:00, which is 8 hours.

    Are 15-minute breaks paid?

    Under federal rules, rest breaks of 5 to 20 minutes are counted as hours worked, so they are paid and should not be subtracted.

    How do I convert hours and minutes to decimal hours?

    Divide the minutes by 60 and add them to the hours. 7 hours 45 minutes is 7 + 45 ÷ 60 = 7.75 hours.

    What Excel formula calculates hours worked?

    With start in A2 and end in B2, use =MOD(B2-A2,1)*24 for decimal hours. Subtract unpaid break minutes divided by 60.

    This guide explains federal hours-worked principles in general terms. State break laws and company policies differ, so confirm the rules that apply to you.

    Amara Taylor, who builds and maintains Anchor AI Tools
    Written and checked by Amara Taylor

    Content Lead, Anchor AI Tools, California, USA. Spotted an error? Email hello@anchoraitools.com and it will be checked and corrected. See our editorial standards.