Track your weekly shift durations including break subtractions.
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Total Hours (HH:MM):00:00
Total Decimal Hours:0.00
function calculateTotalHours() {
var days = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
var totalMinutes = 0;
for (var i = 0; i < days.length; i++) {
var startVal = document.getElementById(days[i] + '_start').value;
var endVal = document.getElementById(days[i] + '_end').value;
var breakVal = parseFloat(document.getElementById(days[i] + '_break').value) || 0;
if (startVal && endVal) {
var startParts = startVal.split(':');
var endParts = endVal.split(':');
var startMin = parseInt(startParts[0]) * 60 + parseInt(startParts[1]);
var endMin = parseInt(endParts[0]) * 60 + parseInt(endParts[1]);
// Handle overnight shifts
if (endMin 0) {
totalMinutes += dayTotal;
}
}
}
var hours = Math.floor(totalMinutes / 60);
var minutes = totalMinutes % 60;
var decimalHours = (totalMinutes / 60).toFixed(2);
document.getElementById('total-hhmm').innerText = hours + "h " + minutes + "m";
document.getElementById('total-decimal').innerText = decimalHours + " hours";
document.getElementById('result-box').style.display = 'block';
}
How to Calculate Hours Worked: A Comprehensive Guide
Calculating hours worked accurately is essential for both employees ensuring they are paid fairly and employers maintaining compliance with labor laws like the FLSA (Fair Labor Standards Act). Whether you are tracking manual timesheets or calculating overtime, understanding the math behind the clock is vital.
The Simple Hours Worked Formula
To find the total hours worked for a single day, use this basic formula:
(End Time – Start Time) – Unpaid Break Time = Total Hours Worked
Step-by-Step Calculation Example
Let's say you started work at 8:30 AM and finished at 5:15 PM, with a 45-minute unpaid lunch break.
Convert to Military Time (24-hour clock): 8:30 AM is 08:30. 5:15 PM is 17:15.
Calculate Difference: From 08:30 to 17:15 is 8 hours and 45 minutes.
Most payroll systems use decimal hours rather than minutes. To convert minutes to decimals, divide the minutes by 60.
Minutes
Decimal Equivalent
15 Minutes
0.25
30 Minutes
0.50
45 Minutes
0.75
60 Minutes
1.00
Common Time Tracking Rules
Rounding Rules: Some employers use the "7-minute rule" where time is rounded to the nearest quarter hour. For example, 8:07 is rounded down to 8:00, while 8:08 is rounded up to 8:15.
Overnight Shifts: If a shift starts at 10:00 PM and ends at 6:00 AM, you must add 24 hours to the end time to calculate the duration correctly.
Unpaid vs. Paid Breaks: Generally, short breaks (5–20 minutes) are considered paid work time, while "bona fide" meal periods (30+ minutes) are unpaid.
Why Accuracy Matters
Inaccurate time tracking can lead to "wage theft" or significant legal liabilities for companies. Using an automated calculator helps eliminate human error in time-to-decimal conversions and ensures that every minute of hard work is accounted for.