How the Hours Calculator Works
This work hours calculator measures the time difference between your start time and end time, then deducts break minutes to compute your total net working time. If your end time is earlier than your start time, the calculator assumes an overnight shift and counts hours across midnight automatically.
What Is Net Working Time?
Net working time is the total time between start and end after subtracting unpaid breaks. Example: an 8-hour shift with a 30-minute unpaid break results in 7h 30m net. This is useful for timesheets, payroll estimates, shift planning, and personal productivity tracking.
Simple formula
- Gross shift time = End − Start (if End < Start, add 24h for overnight)
- Net time = Gross shift time − Break minutes
- Decimal hours = Net minutes ÷ 60
Examples of Work Hour Calculations
- 09:00 → 17:00 with a 30-minute break = 7h 30m
- 08:15 → 16:45 with a 45-minute break = 7h 45m
- 22:00 → 06:00 with a 30-minute break = 7h 30m (overnight shift)
- 23:30 → 00:15 with a 0-minute break = 0h 45m (crossing midnight)
Overtime and Paid Breaks (Practical Notes)
This calculator focuses on net hours worked. Overtime rules vary by employer and country, so treat the result as a clean “time math” baseline.
- Paid breaks: if your break is paid, enter 0 break minutes.
- Unpaid breaks: enter the total unpaid break minutes (e.g., lunch + short breaks if unpaid).
- Overtime: compute net hours here, then apply your overtime thresholds (e.g., over 8h/day).
Multiple Shifts or Weekly Totals
If you work split shifts (e.g., 09:00–13:00 and 14:00–18:00), calculate each shift separately and add results. For weekly totals, repeat per day and sum the decimal hours or total minutes.
Split shift example
- 09:00 → 13:00 (break 0) = 4h 00m
- 14:00 → 18:00 (break 0) = 4h 00m
- Total = 8h 00m
Developer Snippets (time difference)
If you want to replicate the calculation in a spreadsheet or codebase, these snippets match the same logic: overnight shifts roll over by adding 24 hours.
JavaScript
// "HH:MM" -> minutes since midnight
function toMin(hhmm){
const [h,m] = hhmm.split(':').map(Number);
return h*60 + m;
}
function netMinutes(start, end, breakMin){
let diff = toMin(end) - toMin(start);
if (diff < 0) diff += 1440; // overnight
return Math.max(0, diff - breakMin); // clamp
}
// Example:
netMinutes("22:00","06:00",30); // 450 = 7h30m
Excel / Google Sheets
// If A2 = start time, B2 = end time, C2 = break minutes
// Net hours (decimal):
=MAX(0, (MOD(B2 - A2, 1) * 24) - (C2/60))
// Net minutes:
=MAX(0, (MOD(B2 - A2, 1) * 1440) - C2)
Tips for Accurate Results
- Enter break time in minutes (e.g., 30 for a 30-minute break).
- If you work overnight, enter the end time as normal — the tool handles midnight rollover automatically.
- If your break minutes exceed the shift duration, net time becomes 0 (the safe, expected clamp).
- For payroll, export/record the decimal hours if your system uses decimals (e.g., 7.5 hours).
Frequently Asked Questions
Does this hours calculator deduct breaks automatically?
Yes. Enter break minutes and the calculator subtracts them from the total shift duration.
Does it support overnight shifts?
Yes. If the end time is earlier than the start time, the calculator assumes the shift continues after midnight.
Why do you show both “hours/minutes” and “decimal hours”?
Hours/minutes are best for humans (7h 30m). Decimal hours are common in timesheets and payroll (7.5 hours). Both represent the same net duration.
Can I use this for payroll calculations?
It can help estimate net hours worked, but payroll rules may vary depending on overtime and local labor policies.
Is this work hours calculator free?
Yes. The tool is completely free and runs directly in your browser.
Related Time Calculators
Need totals across multiple entries or different units? Try these:
Time Calculator
Add/subtract times and durations for totals across multiple entries.
Time Duration
Calculate the duration between two times or timestamps with clear breakdowns.
Seconds to HH:MM:SS
Convert seconds to 02:14:36 and human-readable hours/minutes/seconds.
Days Between Dates
Count days (and business days) between two calendar dates.