Use this free hours calculator to work out the exact time between two clock times in decimal hours and h:mm, including shifts that cross midnight, for payroll.
Hours Calculator
Get the exact duration between two times — decimal hours for payroll and h:mm for people — even when the period crosses midnight.
Enter your values
Fill in the fields below — the result appears with every step shown.
Your result will appear here
Enter your values above, then press Calculate — or press Enter in any field.TinyExe · Hours Result
Calculated locally in your browser
—
Name
—
Start hour (0–23)
—
Start minute
—
End hour (0–23)
—
How this was calculated
What to do next
TinyExe PDF & PNG exports carry the TinyExe logo and tinyexe.com header & footer.
Runs 100% in your browser — your numbers never leave this tab; nothing is uploaded or stored.
The short answer
To find the hours between two times, convert both to minutes, add 1,440 minutes for each extra day, subtract, and divide by 60. From 09:30 to 17:45 is 495 minutes, which is 8.25 decimal hours, written 8 hours 15 minutes — the decimal form payroll systems multiply by an hourly rate.
- Decimal hours = total minutes ÷ 60; 45 min = 0.75 h, not 0.45 h
- 168 hours in a week; about 730.5 in an average month
- Crossing midnight: add 1,440 minutes per extra day
Hours in common periods
Reference values for this calculator.
| Period | Hours | Minutes |
|---|---|---|
| 1 day | 24 | 1,440 |
| 1 week | 168 | 10,080 |
| Average month (365.25 ÷ 12 days) | 730.5 | 43,830 |
| 1 year (365 days) | 8,760 | 525,600 |
| Full-time week | 40 | 2,400 |
The formula
The exact formula this calculator uses — every variable in it is explained in the card below.
The formula
Enhancement: handles periods crossing midnight via an explicit days-later field (the usual failure of two-time subtraction), and returns both decimal hours for payroll and the h:mm duration people quote.
Worked examples
Worked examples with the full working shown — try them in the calculator to check.
Example 1
Standard workday with a late finish
startHour = 9, startMinute = 30, endHour = 17, endMinute = 45, daysLater = 0
| Calculation | Steps |
|---|---|
| Start = 9:30 = 570 minutes into its day End = 17:45 plus 0 day(s) = 1065 minutes Duration = 1065 − 570 = 495 minutes = 8.25 hours | 8 h 15 min (8.25 hours) — Duration: 8 h 15 min; Total minutes: 495 min; Decimal hours: 8.25 h |
Result
Example 2
Night shift across midnight
startHour = 22, startMinute = 0, endHour = 6, endMinute = 0, daysLater = 1
| Calculation | Steps |
|---|---|
| Start = 22:00 = 1320 minutes into its day End = 6:00 plus 1 day(s) = 1800 minutes Duration = 1800 − 1320 = 480 minutes = 8 hours | 8 h 0 min (8 hours) — Duration: 8 h 0 min; Total minutes: 480 min; Decimal hours: 8 h |
Result
Example 3
Short appointment
startHour = 14, startMinute = 15, endHour = 15, endMinute = 0, daysLater = 0
| Calculation | Steps |
|---|---|
| Start = 14:15 = 855 minutes into its day End = 15:00 plus 0 day(s) = 900 minutes Duration = 900 − 855 = 45 minutes = 0.75 hours | 0 h 45 min (0.75 hours) — Duration: 0 h 45 min; Total minutes: 45 min; Decimal hours: 0.75 h |
Result
How to use this calculator
Step 1
Enter the start time in 24-hour format (e.g. 9 for 9 AM, 17 for 5 PM).
Step 2
Enter the end time the same way.
Step 3
If the period runs past midnight, set “days later” to 1 (or more).
Step 4
Read the duration as decimal hours for payroll, or h:mm for everyday use.
Step 5
For a weekly total, add the daily decimal hours together.
Frequently asked questions
How do I convert PM times to 24-hour time?
Add 12 to PM hours except 12 PM itself: 1 PM = 13, 5 PM = 17, 11 PM = 23. 12 AM (midnight) is 00. This is the “military time” conversion the keywords ask about.
How many hours are in a week?
168 hours: 7 × 24. A standard full-time working week is 40 of those hours.
How many hours are in a month?
It varies: 672 hours in a 28-day February up to 744 in a 31-day month. The long-run average month is about 730.5 hours.
Why does payroll use decimal hours?
Because pay multiplies cleanly: 7 h 45 min = 7.75 h, and 7.75 × hourly rate gives gross pay directly. Minutes must be divided by 60, not read as hundredths — 45 minutes is 0.75 h, not 0.45 h.
What if my shift crosses midnight?
Set the end day offset to 1. A 22:00 start ending at 06:00 the next morning is 8 hours: (6×60 + 1440) − (22×60) = 480 minutes.
About this calculator
An hours calculator finds the elapsed time between two clock times, expressed as decimal hours and as hours-and-minutes. Elapsed-time questions look trivial and are quietly error-prone: borrowing across the hour boundary and crossing midnight defeat mental subtraction, and payroll adds a second trap — minutes must be converted to hundredths by dividing by 60, so 45 minutes is 0.75 hours, not 0.45. This calculator converts both clock times to minutes first, which removes both problems.
Elapsed-time questions look trivial and are quietly error-prone: borrowing across the hour boundary and crossing midnight defeat mental subtraction, and payroll adds a second trap — minutes must be converted to hundredths by dividing by 60, so 45 minutes is 0.75 hours, not 0.45. This calculator converts both clock times to minutes first, which removes both problems.
Use it for shift lengths, billable time, study or driving logs, and any “how many hours between” question. For multi-day periods the days-later field counts whole extra days; for calendar questions such as days between dates, a date calculator is the better tool because months have unequal lengths.
Get the exact duration between two times — decimal hours for payroll and h:mm for people — even when the period crosses midnight. Use it for shift lengths, billable time, study or driving logs, and any “how many hours between” question. For multi-day periods the days-later field counts whole extra days; for calendar questions such as days between dates, a date calculator is the better tool because months have unequal lengths.
How to calculate it yourself
Step 1
Write both times in 24-hour format.
Step 2
Convert each to minutes: hour × 60 + minute.
Step 3
Add 1,440 minutes for each day the end falls after the start day.
Step 4
Subtract start from end for total minutes.
Step 5
Divide by 60 for decimal hours; the remainder is the minutes in h:mm form.
Real-life examples
Timesheet for a warehouse shift
Amara clocks in at 07:50 and out at 16:20 with no day change, and needs decimal hours for her timesheet before multiplying by her hourly rate.
Start = 7:50 = 470 minutes into its day End = 16:20 plus 0 day(s) = 980 minutes Duration = 980 − 470 = 510 minutes = 8.5 hours
8 h 30 min (8.5 hours). Decimal hours are what payroll and timesheets use; the h:mm form is what people say out loud.
Overnight drive leg
A driver leaves at 21:40 and arrives at 05:10 the next morning; the logbook needs the driving duration in hours and minutes.
Start = 21:40 = 1300 minutes into its day End = 5:10 plus 1 day(s) = 1750 minutes Duration = 1750 − 1300 = 450 minutes = 7.5 hours
7 h 30 min (7.5 hours). Decimal hours are what payroll and timesheets use; the h:mm form is what people say out loud.
Ideas & use cases
- Payroll check: run each shift, add the decimal hours for the week, and multiply by your rate to verify a payslip.
- Billable-time log: time a task from start to end clock time instead of guessing rounded hours — small leaks add up weekly.
- Sleep tracking: bedtime to wake time with days-later = 1 gives true sleep duration to compare against your target.
Limitations & sources
- Computes elapsed clock time only; it does not apply overtime rules, unpaid break deductions, time zones or daylight-saving changes — subtract breaks and check local rules separately.
Sources: Standard 24-hour clock arithmetic; US DOL timesheet rounding guidance (29 CFR 785.48) for payroll context
