BYTETOOLS

How to Calculate Hours Between Two Times

To calculate the hours between two times, enter the start (clock-in) and end (clock-out) times into the ByteTools Hours Between Times Calculator, add any unpaid break minutes, and read the result in hours and minutes, decimal hours and total minutes. It handles shifts that cross midnight automatically, so you never get a negative number. Here is the full walkthrough.

Calculate hours in four steps

  1. Enter the start time. Type your clock-in — for example 09:00 — in the start field.
  2. Enter the end time. Add your clock-out, such as 17:30. If it falls after midnight, the tool detects that for you.
  3. Add break minutes (optional). Enter unpaid break time, like 30 minutes for lunch, to subtract it from the total.
  4. Read the results. You get the duration in h:m, as decimal hours for payroll, and as total minutes.

A 09:00 to 17:30 shift with a 30-minute break returns 8 hours 0 minutes, or 8.0 decimal hours — the exact payable time.

How overnight shifts are handled

When the end time is earlier on the clock than the start time, the calculator assumes the shift crossed midnight and adds 24 hours to the end before subtracting. So a 22:00 start and 06:00 end is counted as eight hours, not minus sixteen. This is the single biggest source of manual timesheet errors, and the tool removes it entirely.

StartEndBreakResult
09:0017:3030 min8h 00m / 8.0
22:0006:0008h 00m / 8.0
07:1515:4545 min7h 45m / 7.75

Understanding the three result formats

The hours and minutes figure is the natural way to read a shift length. Decimal hours convert the minutes into a fraction — 7 hours 30 minutes becomes 7.5 — which payroll systems multiply by an hourly rate. Total minutes is the raw count, useful when you are summing many short intervals. Having all three means you never convert by hand for whichever system needs which format.

Private timesheet math in your browser

Every calculation runs locally with JavaScript. No times are uploaded, so your clock-in and clock-out data stays on your device — which matters when you are reconciling real payroll hours. Because nothing needs a server, the calculator keeps working offline once the page has loaded.

Try the Hours Between Times Calculator — free and 100% in your browser.

FAQ

How do I calculate hours for a shift that ends after midnight?

Just enter the times as they appear — a 22:30 clock-in and 06:15 clock-out. Because the end reads as earlier than the start, the tool adds 24 hours and returns the correct positive duration of 7 hours 45 minutes.

How do I subtract a lunch break?

Put the unpaid break length in the break-minutes field. It is deducted from the raw time between your two clock readings, giving the exact payable hours.

What is the difference between decimal hours and hours and minutes?

Hours and minutes is 7:30; decimal hours is 7.5 — the same length expressed as a fraction of an hour. Payroll uses decimal hours to multiply by a wage, so both are shown.

Do I need to type AM or PM?

Enter the times in the format the input expects; the tool works out the duration from the values you give and handles the midnight crossover automatically.

Related free tools

Built by ByteVancer

ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS and custom software. If you need a tailored tool or internal system, explore what ByteVancer can build.