Compute the duration between two times, with break and pay options.
Net duration = end − start − break. For night shifts, toggle “crosses midnight” to add 24 h to the end time.
Adding and subtracting clock times is an everyday task that a calculator handles badly. People want to know "how many hours did I work today?", "how long is the night shift?", "what does that pause for lunch leave me with?", or "how much do I bill for the meeting that ran from 14:30 to 17:15?" Doing it on paper means converting hours-and-minutes into decimal hours, subtracting, then converting back — error-prone, especially across midnight or with irregular breaks. This calculator does the conversion in both directions, deducts an arbitrary break, optionally multiplies the net duration by an hourly rate, and shows the answer in the two formats people actually use: HH:MM (for timesheets) and decimal hours (for invoices and payroll).
Net duration = (end − start) − break, where times are first converted to minutes-since-midnight. The headline trap is the night shift: if end is before start (e.g. start 22:00, end 06:00), naive subtraction produces a negative. The fix is a "crosses midnight" toggle that adds 24 × 60 = 1 440 minutes to the result when the end-of-shift is the next calendar day. Decimal hours = net minutes ÷ 60. Pay = decimal hours × hourly rate. The result block shows raw duration (no break), net duration (after break), the explicit break amount for sanity-check, and the calculated pay if a non-zero rate was provided.
Enter the start time and end time in 24-hour format (the HTML5 time picker will handle locale display). If the shift crosses midnight, flip "Crosses midnight" to Yes — otherwise the calc treats end ≤ start as a zero-duration shift. Enter the break in minutes (0 if none). Optionally enter an hourly rate to get a pay estimate at the bottom — leave it at 0 to skip. The calc updates live as you type. The HH:MM result is for timesheet entries; the decimal-hours result is what payroll software and invoicing tools usually want.
Start 09:00, end 17:30, break 60 min, rate 25 €/h. - Raw: 17:30 − 09:00 = 8 h 30 = 510 min = 8.50 h. - Net: 510 − 60 = 450 min = 7 h 30 = 7.50 h. - Pay: 7.50 × 25 = 187.50 €.
Night shift example: start 22:00, end 06:00, "crosses midnight" yes, break 30, rate 0. - Raw with the +1 440 fix: (360 − 1 320) + 1 440 = 480 min = 8 h. - Net: 480 − 30 = 7 h 30.
Forgetting the midnight flag. Without it, a 22:00–06:00 shift returns "0" because end is before start. The flag is a deliberate explicit choice — auto-detecting "crosses midnight" leads to surprises (an 06:00–05:30 shift is almost certainly a typo, not a 23.5-hour shift, so we refuse to guess).
Negative duration after break. If the break is longer than the shift, net duration is clamped at 0. We do not return a negative — there is no "negative work" semantic.
HH:MM vs decimal hours confusion. 7.5 hours and 7:30 are the same; 7.5 hours and 7:50 are different (the latter is 7 h 50 min = 7.833 h). Always check whether your timesheet expects decimal or sexagesimal — payroll bugs commonly trace back to this confusion.
Rounding for billing. Some agencies bill to the nearest 15 min, some to the nearest 6 min (a tenth of an hour), some to the exact minute. The calc reports to the minute; round to your contract's granularity at the bill-entry step, not in the calc.
Locale time format. The HTML5 time input shows 24-hour or AM/PM depending on the user's locale, but the underlying value is always 24-hour. Submitting the form value to another system, no surprise.