Work Hours Calculator
Enter start and end times, break minutes and standard hours to get attendance time, worked hours and overtime; add an hourly rate and multiplier to estimate overtime pay. Night shifts crossing midnight are handled automatically.
The question usually arrives on the way home: how long was actually worked today, and does the overtime line on the payslip add up? Enter the start time, the end time, the break taken and the standard hours, and attendance time, worked hours and overtime are separated out; add an hourly rate and a multiplier to put a value on the extra hours. A shift crossing midnight is counted into the next day automatically.
Worked hours = attendance time − break, and overtime = worked hours − standard hours, with a shortfall shown as zero rather than negative. The pay figure is an estimate: what is actually settled depends on the contract, company policy and local rules, and averaging or flexible-hours arrangements calculate differently. The multiplier is yours to set, so the tool fits any scheme instead of assuming one.
Did this tool solve your problem?
Submitting sends the tool name, your input and the current result to the server. Please do not include ID numbers, phone numbers or other private data.
AI assistant It answers using your current input and result
Asking again sends your current input and result to the server once more. Please do not include private data.
How to use
- Enter the start time, the end time and the break duration.
- Set the standard hours for the day and read attendance, worked and overtime hours.
- Add an hourly rate and the overtime multiplier to estimate the pay.
- Check overnight shifts — the end time is treated as the following day.
How it works
How work hours are computed
Work hours = attendance time - break time. Attendance is the gap between clock-out and clock-in: 9:00 to 18:30 is 9 hours 30 minutes (570 minutes); subtracting a 90-minute lunch gives 480 minutes = 8 hours. Anything beyond standard hours is overtime — e.g. 9:00 to 21:00 minus 60 minutes of break is 11 hours, so against an 8-hour standard it's 3 hours of overtime.
Handling overnight shifts
When clock-out is not later than clock-in, the tool treats it as crossing to the next day and adds 24 hours. So a night shift 22:00 to 06:00 next day computes 8 hours of attendance, and 7 hours 30 minutes of work after a 30-minute break. This also covers "overtime until dawn" without manual conversion to 30:00.
Estimating overtime pay
Overtime pay = overtime hours x hourly wage x multiplier. Multipliers commonly use 1.5x on workdays, 2x on rest days and 3x on statutory holidays (per Article 44 of the Labor Law). Note the basis should be the normal working-hours wage agreed in the contract, and some cities cap overtime at "no more than 1 hour daily, 3 hours for special reasons, and 36 hours monthly."
Code example
JavaScript Shift work across midnight, with overtime pay
function workHours(start, end, restMin, stdHours, hourly, rate) {
const toMin = (t) => { const [h, m] = t.split(":").map(Number); return h * 60 + m; };
let span = toMin(end) - toMin(start);
if (span < 0) span += 1440; // night shift across midnight
const work = Math.max(0, span - restMin) / 60;
const overtime = Math.max(0, work - stdHours);
return { work, overtime, pay: overtime * hourly * rate };
}
workHours("22:00", "06:00", 60, 8, 50, 1.5); // a 7h night shift, no overtime
Python Worked hours from a datetime difference
from datetime import datetime, timedelta
def work_hours(start, end, rest_min):
s = datetime.strptime(start, "%H:%M")
e = datetime.strptime(end, "%H:%M")
if e < s: e += timedelta(days=1) # night shift across midnight
return (e - s).total_seconds() / 60 - rest_min
work_hours("09:00", "18:30", 60) # 510.0 minutes = 8.5 hours
FAQ
How is work hours computed?
Subtract clock-in from clock-out for attendance, then subtract break time. For example 9:00 to 18:30 is 9 hours 30 minutes, or 8 hours after a 90-minute lunch. If the company excludes lunch and it varies, enter the actual break time.
How are overnight shifts handled?
When clock-out is earlier than or equal to clock-in, the tool assumes crossing to the next day and adds 24 hours. 22:00 to 06:00 becomes 8 hours of attendance rather than negative or 16. The result notes "overnight shift" for verification.
What's the overtime pay formula?
Overtime pay = overtime hours x hourly wage x multiplier. Hourly wage is usually "monthly wage / 21.75 / 8," with multipliers 1.5 on workdays, 2 on rest days and 3 on statutory holidays. This tool takes your hourly wage directly, so it also works with a contract-based figure.
Does lunch count as work hours?
Generally not statutory working time — it isn't employer-arranged work and employees are free to use it, so it's subtracted. If the role requires eating while on duty (front desk, customer service) with no freedom to leave, it counts as work — enter 0 break time then.
What standard hours should I set?
The default 8 hours corresponds to the standard system of no more than 8 hours daily and 44 weekly. If the company runs 7.5-hour days (some foreign firms), change it to 7.5; under a comprehensive-hours system, compute by the cycle's total, not per day.
Do the 1.5 / 2 / 3 multipliers have a legal basis?
Yes. Article 44 of the Labor Law: extended work time pays no less than 150% of wages; work on rest days without compensatory time off pays no less than 200%; work on statutory holidays pays no less than 300%. "No less than" means a higher company standard isn't illegal.
Can the result serve as legal grounds for wage claims?
Not directly, but as a reference for self-checking and communication. Actual hours follow attendance records, and overtime recognition still requires showing the work was employer-arranged. For chronic overtime, keep punch screenshots and work communications and consult local labor inspection.
What's the maximum minutes per day?
Attendance span is capped at 24 hours (overnight shifts add one full turn), and break time can't exceed the span. Overtime hours are capped protectively at 31 days x 24 hours to prevent astronomical input from freezing the page.