Hours Calculator

Enter a start time, end time, and optional break duration to calculate total hours worked. Results appear in both decimal format (e.g. 7.75 hours) for payroll calculations and HH:MM format (e.g. 7:45) for timesheet entry. Overnight shifts are handled automatically.

min
Enter 0 for no break
Enter start and end times to calculate hours worked

How It Works

Calculating hours worked sounds simple, but it involves a few steps that are easy to get wrong — especially with breaks and overnight spans.

Basic calculation:
1. Convert start and end times to minutes since midnight.
2. Subtract start from end to get raw minutes worked.
3. If end is earlier than start (overnight shift), add 1440 minutes (24 hours) to the result.
4. Subtract break minutes.
5. Convert to decimal hours: minutes ÷ 60.
6. Convert to HH:MM: hours = floor(minutes ÷ 60), remaining minutes = total minutes mod 60.

Worked example: Start 09:00, End 17:30, Break 30 minutes.
Raw minutes = (17 × 60 + 30) − (9 × 60 + 0) = 1050 − 540 = 510 minutes
Minus break: 510 − 30 = 480 minutes
Decimal: 480 ÷ 60 = 8.0 hours
HH:MM: 8:00

Worked example with break: Start 09:00, End 17:30, Break 30 minutes.
Net minutes = 480 − 30 = 450 minutes
Decimal: 450 ÷ 60 = 7.5 hours
HH:MM: 7:30

Overnight shift example: Start 22:00, End 06:00, Break 0 minutes.
Raw = (6 × 60) − (22 × 60) = 360 − 1320 = −960 → add 1440 → 480 minutes
Result: 8.0 hours / 8:00

Decimal hours are essential for payroll: multiply decimal hours by your hourly rate to get the exact amount owed. For example, 7.5 decimal hours at $25/hr = $187.50. In HH:MM format, 7:30 might mislead you into calculating 7.30 × $25 = $182.50 — a $5 error.

This calculator handles times entered in HH:MM (24-hour) format. Standard usage: enter times like 09:00, 13:30, 17:45, 22:00. The browser's time input widget ensures valid time entry.

Frequently Asked Questions

How do I calculate hours worked with a lunch break?

Enter your start time, end time, and the break duration in minutes in the "Break" field. The calculator subtracts the break from the total span automatically. For a 30-minute lunch, enter 30. For a 1-hour break, enter 60.

What is the difference between decimal hours and HH:MM?

Decimal hours express time as a single number where the fractional part is a decimal fraction of an hour (0.5 = 30 min, 0.25 = 15 min). HH:MM expresses hours and minutes separately (7:30). Payroll software and invoicing almost always use decimal hours for multiplication.

Does this handle overnight shifts?

Yes. If the end time is earlier than the start time, the calculator assumes the shift crossed midnight and adds 24 hours to the end time before calculating. For example, 22:00 to 06:00 correctly returns 8 hours, not a negative number.

Can I calculate a shift longer than 24 hours?

This calculator handles single-day or single-overnight spans (up to just under 24 hours). For multi-day shifts, calculate each day separately and add the results.

How do I convert decimal hours to pay?

Multiply your decimal hours result by your hourly rate. Example: 7.5 hours × $20/hr = $150.00. Always use the decimal figure, not the HH:MM figure, to avoid calculation errors (7:30 is NOT 7.30 decimal hours — it is 7.50).