Clock in at 9:15 AM, clock out at 5:42 PM. How many hours did you work? The answer matters for payroll, for billable hours, for overtime calculations, and for any hourly worker cashing a paycheck. The math is straightforward — but the edge cases (breaks, overnight shifts, minute-to-decimal conversions) trip people up more often than they should.

The core method

To find the difference between two times:

  1. Convert both times to a 24-hour format.
  2. Subtract minute-by-minute, borrowing from hours if needed.
  3. Convert the result to decimal hours if required for payroll.

A worked example

Clock in at 9:15 AM, clock out at 5:42 PM.

  1. 24-hour form: 09:15 to 17:42.
  2. Minutes: 42 − 15 = 27.
  3. Hours: 17 − 9 = 8.
  4. Total: 8 hours 27 minutes.

Handling minute overflow

If the end minute is smaller than the start minute, borrow an hour. Example: clock in 10:50, clock out 4:20 PM.

  1. 24-hour form: 10:50 to 16:20.
  2. Minutes: 20 − 50 = −30. Borrow 60 minutes: (20 + 60) − 50 = 30.
  3. Hours: (16 − 1) − 10 = 5.
  4. Total: 5 hours 30 minutes.

Overnight shifts

For shifts that cross midnight, add 24 hours to the end time before subtracting. Example: 10:30 PM to 6:15 AM.

  1. 24-hour form: 22:30 to 30:15 (treating the next morning as +24).
  2. Minutes: 15 − 30 = −15. Borrow: (15 + 60) − 30 = 45.
  3. Hours: (30 − 1) − 22 = 7.
  4. Total: 7 hours 45 minutes.

Subtracting lunch breaks

Unpaid breaks reduce total worked hours. Standard: subtract the break duration from the shift total.

Example: 9:00 AM to 5:30 PM with a 30-minute unpaid lunch.

  1. Gross time: 17:30 − 9:00 = 8 hours 30 minutes.
  2. Less break: 8:30 − 0:30 = 8:00.
  3. Worked: 8 hours.

Federal and state law dictate when breaks must be unpaid. In California, for example, a meal break of 30 minutes or more is unpaid; a 10-minute rest break is paid.

Decimal hours for payroll

Payroll systems usually want hours as a decimal, not hours-and-minutes. Convert minutes to decimal by dividing by 60:

  • 15 minutes = 0.25 hours
  • 30 minutes = 0.50 hours
  • 45 minutes = 0.75 hours
  • 27 minutes = 0.45 hours
  • 42 minutes = 0.70 hours

So 8 hours 27 minutes = 8.45 decimal hours. At $20/hour, that's $169.00 for the shift.

Common rounding rules

Many employers round clock-in and clock-out times to the nearest 15 minutes — provided the rounding doesn't systematically disadvantage employees. This is called "7-minute" or "quarter hour" rounding:

  • Clock in 8:53 AM → rounded to 8:45
  • Clock in 8:58 AM → rounded to 9:00
  • Clock out 5:11 PM → rounded to 5:15
  • Clock out 5:06 PM → rounded to 5:00

Under federal law, the rounding must be neutral — not consistently down for clock-in and up for clock-out. Many employers have moved to exact time tracking as disputes over rounding have grown.

Overtime calculations

US federal law (Fair Labor Standards Act) requires overtime pay at 1.5× the regular rate for hours beyond 40 in a workweek. California has daily overtime thresholds too: over 8 hours in a day, or over 6 days in a week.

Example week: Mon 9, Tue 9, Wed 9, Thu 9, Fri 9 = 45 hours. Overtime = 5 hours × 1.5× rate. Regular = 40 hours × 1× rate.

Billable hours for consultants

Service professionals typically bill in increments: 6-minute (.1 hour), 15-minute (.25 hour), or 30-minute (.5 hour) minimums. A 2-minute phone call might still bill as 0.1 or 0.25 hours depending on the firm. Track actual time accurately; apply the billing increment at the end.

Time zone issues

If an employee clocks in in one time zone and out in another (travel, remote work), use the local time at each event or a single reference time zone. Mixing them creates phantom hours.

Let the tool do the math

Our time duration calculator computes the difference between any two times — same day or across midnight — and returns the result in hours, minutes, and decimal hours with one click. It handles breaks, overnight shifts, and formatting automatically. For payroll, invoicing, or any situation where getting hours exactly right matters, the right tool eliminates arithmetic mistakes. Your time is worth tracking accurately.