Time Clock Calculator

Time Entry

Results

Hours Worked: 0.00

Worked example (the default values)

Clock in 09:00, clock out 17:00, break 30 minutes: the raw span is 8 hours (480 minutes). Subtract the 30-minute break: 480 - 30 = 450 minutes, or 450 ÷ 60 = 7.50 hours worked. That's what the calculator shows on page load before you change anything.

How the time math works

Clock in and clock out are converted to full JavaScript date objects (same calendar day, different times), and the difference between them is measured in minutes before the break is subtracted. Working in minutes rather than raw hour:minute strings avoids the bug of treating "17:00 minus 9:00" as simple subtraction, which breaks the moment minutes don't align (e.g. 17:15 to 9:45).

Overnight shifts

If clock-out is earlier in the day than clock-in (e.g. in at 22:00, out at 06:00), the calculator assumes the shift crossed midnight and adds a full day to the clock-out time before computing the difference — 22:00 to 06:00 next day works out to 8 hours, not a negative number.

Rounding

Hours worked are rounded to two decimal places. Payroll systems that require hours in quarter-hour increments (0.25, 0.5, 0.75) will need an extra rounding step on top of this raw figure — 7.50 rounds cleanly, but something like 7.53 would need to be rounded to 7.50 or 7.75 depending on your employer's rounding policy.