How the hours calculator works
Working out time worked is subtraction on a 24-hour clock, with two twists: shifts can cross midnight, and pay systems want the answer as a decimal. This tool handles both.
The core steps are:
- Convert each time to minutes since midnight. 9:00 becomes 540, 17:30 becomes 1050.
- Subtract start from end. 1050 โ 540 = 510 minutes.
- Handle overnight. If the result is negative, add 24 hours (1440 minutes).
- Subtract the break in minutes, then clamp at 0 so you never see a negative total.
- Split into hours and minutes, and separately divide by 60 for decimal hours.
So 9:00 AM to 5:30 PM with a 30-minute break is 510 โ 30 = 480 minutes, which is 8h 0m, or 8.00 decimal hours.
A worked example
Say you clock in at 9:00 AM and clock out at 6:00 PM, with a 30-minute unpaid lunch.
- Start = 540 minutes, end = 1080 minutes.
- Gap = 1080 โ 540 = 540 minutes (9 hours).
- Minus the 30-minute break = 510 minutes.
- As hours and minutes: 510 รท 60 = 8 remainder 30, so 8h 30m.
- As decimal hours: 510 รท 60 = 8.50.
Converting between decimal hours and hours:minutes
The two formats describe the same duration. To go from minutes to a decimal, divide by 60:
- 15 minutes = 0.25 hours
- 30 minutes = 0.50 hours
- 45 minutes = 0.75 hours
To go back, multiply the decimal fraction by 60: 0.5 ร 60 = 30 minutes. This is why 8.5 hours is 8h 30m, not 8h 50m, a common mistake when reading a decimal as if it were minutes.
Overnight and night shifts
If your end time is earlier on the clock than your start time, the shift crossed midnight. A 10:00 PM start (1320 minutes) and 6:00 AM end (360 minutes) gives 360 โ 1320 = โ960. Adding 1440 gives 480 minutes, or 8 hours. The calculator does this automatically whenever the end is before the start, so you can enter night shifts without any workaround.
Deducting breaks
Enter only the unpaid break time. A 30-minute lunch you are not paid for goes in the break field; a paid 10-minute rest break does not. The break is subtracted from the raw gap between your times. If the break is larger than the shift (an unusual entry), the total is clamped to 0h 0m rather than showing a negative value.
Turning hours into pay
Add an hourly rate and the calculator multiplies it by the decimal hours to estimate gross pay before tax:
- 8.50 hours at $18.00/hr = $153.00
- 7.25 hours at $22.00/hr = $159.50
This is gross pay only. It does not account for overtime multipliers, taxes, or deductions, so treat it as a quick estimate rather than a payslip.