How this calculator works
Enter the clock-in time (start hour and minute) and clock-out time (end hour and minute), plus any unpaid break in minutes. This calculator converts both times to minutes since midnight, finds the raw duration between them, applies an overnight-wrap rule when needed, subtracts the break, and converts the result to decimal hours.
The formula
startMin = startHour x 60 + startMinute endMin = endHour x 60 + endMinute rawMin = endMin - startMin If rawMin <= 0: rawMin = rawMin + 1440 (overnight wrap; also covers start == end as a full 24h shift) paidMin = max(0, rawMin - breakMinutes) hours = paidMin / 60
Worked example
Clocked in at 9:30, clocked out at 17:45, no break:
- Start: 9 x 60 + 30 = 570 minutes
- End: 17 x 60 + 45 = 1065 minutes
- Raw duration: 1065 - 570 = 495 minutes (positive, no wrap needed)
- Paid minutes: 495 - 0 = 495
- Hours: 495 / 60 = 8.25 hours
Frequently asked questions (FAQ)
How does this calculator handle an overnight shift?
If your clock-out time is earlier on the clock than your clock-in time, for example 22:00 to 06:00, this calculator assumes you worked through midnight and adds 24 hours to the raw duration before subtracting any break. An overnight shift is flagged explicitly in the breakdown so you can confirm it computed correctly.
What happens if I clock in and out at the exact same time?
This calculator treats identical start and end times as a full 24.0-hour shift, not zero hours. The same rule that handles overnight wraparound also catches this case, since a zero or negative raw duration always triggers the add-24-hours rule. This is a deliberate choice documented in the calculator's spec.
How is this different from the Age Calculator or a date duration calculator?
The Age Calculator measures spans between calendar dates, like years and months from a birth date to today. This calculator measures clock time within a single shift, like 9:30 to 17:45, for payroll and timesheet purposes. Use this one for hours worked, and the Age Calculator for date-to-date spans.
Does the unpaid break get subtracted before or after the overnight wrap?
After. The overnight-wrap rule first establishes the raw duration of the shift (adding 24 hours if needed), and the unpaid break is subtracted from that raw duration afterward. The result is floored at zero, so a break longer than the shift never produces a negative number.
Why does the result show decimal hours instead of hours and minutes?
Payroll systems typically run on decimal hours, for example 8.25 hours rather than 8 hours 15 minutes, since decimal hours multiply directly against an hourly rate. The breakdown table still shows the raw duration in hours and minutes so you can double-check the arithmetic.
Can I use this for a shift longer than 24 hours?
Not directly. This calculator only accepts a single start and end clock time within a 24-hour cycle, so the longest single shift it can compute is 24.0 hours (the identical-time edge case). For a multi-day span, add up separate shifts or use the Age Calculator for calendar-date math.
Sources
This is standard clock-time arithmetic; no external source is needed. For calendar-date spans (birthdays, project durations across multiple days), see the Age / Date Duration Calculator.