How this works
Punch-in / punch-out is one of the more error-prone everyday calculations because clock arithmetic doesn't behave like decimal arithmetic. 7:45 + 45 minutes is 8:30, not 8:90. Crossing midnight throws off the simple "end − start" subtraction (a 22:00–06:00 shift is 8 h, not −16 h). And payroll wants decimal hours (7.5), not the colon format you actually worked (7:30). The calculator handles all three: it converts both inputs to total minutes since 00:00, subtracts, wraps to a positive number when needed (or when you tick "next day"), subtracts your unpaid break, and reports the result both as h:mm for sanity-checking and as decimal hours for slotting into a payroll spreadsheet. The break field is the most-overlooked piece — most jurisdictions treat unpaid lunches as time worked unless explicitly subtracted.
The formula
startHour, startMin, endHour, endMin — taken from the two HH:MM inputs in 24-hour clock. unpaidBreak is in minutes, default 0. The 24 × 60 = 1440-minute wrap is what makes overnight shifts work; we apply it whenever the raw subtraction is negative, plus an explicit "next day" toggle for cases where you want the wrap regardless (e.g. a 24-hour on-call shift starting and ending at 09:00).
Example calculation
- Start: 09:00. End: 17:30. Break: 30 min.
- Elapsed = 17:30 − 09:00 = 8 h 30 min = 510 min.
- Worked = 510 − 30 = 480 min = 8:00 = 8.00 h decimal.
- Overnight example: 22:00 → 06:00, no break. Raw = −16 h, but adding 24 h gives 8 h.
Frequently asked questions
Why does payroll want decimal hours instead of h:mm?
Because hourly pay is a multiplication: hours × rate. Spreadsheets and payroll systems can't multiply 7:30 by an hourly rate without first converting it. 7:30 in clock format is actually 7 hours and 30 minutes — but 30 minutes is half an hour, so as a decimal it's 7.5. Multiply by $20/h and you get $150. If you naively multiplied 7.30 by 20 you'd get $146 — short by $4. The mistake comes from minutes being base-60 while pay is base-10, and decimal hours bridges the gap.
I worked a shift that crossed midnight — do I still need to tick the box?
Usually no — when the end time is earlier than the start time, the calculator assumes you crossed midnight and adds 24 hours automatically (so 22:00 → 06:00 just works). The toggle is for the edge case where the end time is later than (or equal to) the start time but you still want the +24 h: a 24-hour on-call from 09:00 to 09:00 is exactly that. If you don't tick it, the calculator reads it as a zero-minute shift.
Can I add multiple breaks?
Sum them and enter the total. If you took a 30-minute lunch and two 15-minute coffee breaks, type 60. Most workplaces only count unpaid breaks toward this number — paid 5-minute pauses don't subtract. If you're tracking shifts where the breaks vary day to day, it's worth keeping them in a separate column on your timesheet rather than merging them into one figure.
How do I round to the nearest quarter hour for billing?
Take the decimal-hours number and round to the nearest 0.25 (or 0.1 for tenths-of-an-hour). For 7.45 h that's 7.50; for 7.55 h it's also 7.50 if you round to nearest, or 7.75 if your contract specifies always-round-up. Be careful — different jurisdictions and contracts have different rules: round-down, round-to-nearest, round-up-after-7-min are all common. Don't mix h:mm and decimal in the same calculation; convert to decimal first, then round. The calculator gives you both forms so you can see what you're rounding from.