Skip to content
CalculatorBuddy

Hours Calculator

Find hours and minutes between two clock times or two dates — clock in and clock out, including overnight shifts.

Clock in and clock out on a 12-hour clock. If you punch out earlier than you punched in, the shift is counted as overnight.

ExampleSample values — edit any field to see your result.

Clock in — AM / PM
Clock out — AM / PM

Results update as you type.

Hours

9 hours

Estimated result

Minutes
540 minutes

Clock in and clock out to find the hours and minutes between two times, or between two dates and times. Overnight shifts that punch out earlier than they punched in wrap past midnight. This is a timesheet-style hours tool — for adding and subtracting durations, use the Time Calculator.

Formula

Convert each 12-hour clock time to minutes from midnight, then subtract. 12 AM is 0 minutes and 12 PM is 12:00 (720 minutes):

minutes from midnight = (hour mod 12) × 60 + minutes   (+ 12 × 60 if PM)
same-day minutes      = end − start   (add 1,440 if end < start)
two-date minutes      = (end date × 1,440 + end clock) − (start date × 1,440 + start clock)
hours                 = ⌊minutes ÷ 60⌋
leftover minutes      = minutes mod 60
decimal hours         = total minutes ÷ 60

Equal clock times on the same day are 0 hours, not a 24-hour shift. A night shift that starts at 10:00 PM and ends at 6:00 AM is 8 hours because the end is earlier, so 24 hours are added.

Hours in different time periods

DescriptionHours
Hours in a day24
Hours in a week168
Hours in a 28-day month672
Hours in a 30-day month720
Hours in a 31-day month744
Hours in a 365-day year8,760
Hours in a leap year8,784

Examples

Standard day shift

Clock in at 8:30 AM and clock out at 5:30 PM. That is 9 hours, or 540 minutes.

Overnight shift

Clock in at 10:00 PM and clock out at 6:00 AM. The end is earlier, so the calculator adds 24 hours and the shift is 8 hours, or 480 minutes.

Two calendar days

Start January 1, 2026 at 8:30 AM and end January 2, 2026 at 5:30 PM. The span is 1 day 9 hours, or 33 hours, or 1,980 minutes.

Frequently asked questions

How do I calculate hours between two times?
In the Work hours tab, enter a clock-in and clock-out time on a 12-hour clock (hour, minutes, AM or PM). The calculator subtracts start from end in minutes. 8:30 AM to 5:30 PM is 9 hours, or 540 minutes. Leftover minutes are shown as hours and minutes plus decimal hours (8:30 AM to 5:45 PM is 9 hours 15 minutes, or 9.25 hours).
What if my shift goes past midnight?
If you clock out earlier than you clocked in, the Work hours tab treats that as an overnight shift and adds 24 hours. 10:00 PM to 6:00 AM is 8 hours. For a shift that spans named calendar days, use Hours between two dates so both dates are explicit.
How do I calculate hours between two dates?
Open the Two dates tab and enter a start date and time and an end date and time. The span is the difference in minutes, then split into days, hours, and minutes. January 1, 2026 at 8:30 AM to January 2, 2026 at 5:30 PM is 1 day 9 hours, or 33 hours, or 1,980 minutes. The start date must be on or before the end date.
How is this different from the Time Calculator?
The Hours Calculator is a timesheet punch: clock in, clock out, and (optionally) the calendar dates. The Time Calculator adds and subtracts durations in days, hours, minutes, and seconds, or applies a span to a start date. Use Hours for "how long was this shift?" and Time for "what is 2 hours 45 minutes plus 1 hour 30 minutes?"
How are decimal hours calculated?
Decimal hours are total minutes divided by 60, used when the span is not a whole number of hours (payroll often wants 8.5 instead of 8 hours 30 minutes). Values under 0.1 hour round to three decimal places (1 minute is 0.017 hour); otherwise they round to two.

Related calculators