Hours Between Two Times Calculator
Need to know exactly how many hours passed between two points in time? This calculator handles standard day shifts, overnight shifts (when end time is earlier than start), and optional break deductions. Enter your start and end times in either 12-hour (AM/PM) or 24-hour format, subtract any unpaid breaks, and instantly get the result as a decimal, in HH:MM, and as total minutes.
When to use this calculator
- Calculate payroll hours for hourly workers and contractors
- Track billable hours for freelancers and consultants
- Measure study or focus session durations
- Log overnight shift lengths for nurses, security staff, or drivers
- Verify timesheet entries before submitting to HR
- Plan event durations and scheduling blocks
How it works
2 min readWhat is the time between two times?
Time between two times is the elapsed duration measured in hours and minutes from a start point to an end point. For example, 9:00 AM to 5:30 PM equals 8 hours and 30 minutes. Calculations automatically handle overnight shifts, AM/PM formats, and optional break deductions for accurate work hour tracking.
How It Works
The calculator converts both times to minutes since midnight, computes the raw difference, applies an overnight correction if needed, subtracts break time, then formats the result three ways.
Formula
startMinutes = startHour × 60 + startMin
endMinutes = endHour × 60 + endMin
diffMinutes = endMinutes − startMinutes
IF diffMinutes < 0 THEN diffMinutes += 1440 // overnight: add 24 hours
netMinutes = diffMinutes − breakMinutes
decimalHours = netMinutes ÷ 60
HH = floor(netMinutes ÷ 60)
MM = netMinutes mod 60The constant 1440 is the number of minutes in 24 hours. Adding it when the raw difference is negative correctly handles any shift that crosses midnight without requiring you to enter a date.
Worked Examples
| Scenario | Start | End | Break | Net minutes | Decimal hours | HH:MM |
|---|---|---|---|---|---|---|
| Standard workday | 9:00 AM | 5:00 PM | 30 min | 450 | 7.50 | 7:30 |
| Half day | 8:00 AM | 12:00 PM | 0 | 240 | 4.00 | 4:00 |
| Overnight shift | 10:00 PM | 6:00 AM | 30 min | 450 | 7.50 | 7:30 |
| Long shift | 7:00 AM | 7:00 PM | 60 min | 660 | 11.00 | 11:00 |
Overnight example step-by-step:
Converting Decimal Hours to Pay
Multiply decimal hours by your hourly rate directly: 7.50 hrs × $18.00/hr = $135.00. No conversion needed — decimal format is designed for payroll math.
Limitations
Frequently asked questions
How does the overnight calculation work?
When end time is earlier than start time, the calculator adds 1,440 minutes (24 hours) to the difference. For example, starting at 11:00 PM (1,380 min) and ending at 7:00 AM (420 min) gives 420 − 1,380 = −960, then −960 + 1,440 = 480 minutes = 8 hours.
What if my start and end times are exactly the same?
The result will be 0:00 / 0 hours. If you worked a full 24-hour shift, this tool cannot distinguish that from zero time — you would need to enter it as two separate periods or use a date-aware time tracking tool.
How do I convert decimal hours to hours and minutes manually?
Take the decimal portion and multiply by 60. Example: 7.75 hours → 0.75 × 60 = 45 minutes → 7 hours 45 minutes. The HH:MM output on this calculator does this automatically.
Should I include lunch in my break minutes?
If your lunch is unpaid, yes — enter it as break minutes and it will be deducted from total hours. If lunch is paid, leave the break field at 0. FLSA rules in the US generally require breaks under 20 minutes to be paid; longer meal periods may be unpaid.
Can I use this for payroll calculations?
Yes, the decimal hours output is designed for direct payroll use. Multiply it by your hourly rate to get gross pay. However, always verify against official timekeeping records — this tool is for quick estimates and does not replace certified payroll software.
What is the difference between decimal hours and hours:minutes?
Decimal hours express fractions of an hour as decimals (e.g., 7.5 = 7 hours 30 minutes). Hours:minutes uses the traditional colon format (7:30). Decimal is preferred for math and payroll; HH:MM is preferred for schedules and readability.
Does this account for Daylight Saving Time?
No. The calculator performs pure arithmetic on clock times without any date context. On the night clocks spring forward (lose 1 hour) your shift is actually 1 hour shorter than the clock difference; on fall-back night it is 1 hour longer. Adjust manually if precision is needed for DST nights.
My shift is exactly 8 hours — why does the decimal show 8.00 instead of 8?
The output is formatted to two decimal places so results are consistent across all scenarios. 8.00 and 8 are mathematically identical; the format makes it immediately clear the result is a decimal value ready for payroll math.
Can I calculate multiple shifts in one day?
Not directly. To calculate a split shift (e.g., 8 AM–12 PM and 2 PM–6 PM), run the calculator twice and add the decimal results: 4.00 + 4.00 = 8.00 hours. Then deduct any unpaid breaks from the combined total.
What is the maximum shift this calculator can handle?
Up to 23 hours 59 minutes (1,439 minutes) of gross time, minus any break. This covers virtually all single-period shifts including extended overnight shifts. Shifts spanning more than 24 hours require a date-aware calculator.