How to Calculate Hours Between Two Times
Put both times on the 24-hour clock and subtract the start from the end — minutes first, borrowing an hour (60 minutes) if the end minutes are smaller. From 9:15 to 17:45 is 8:30. If the end time looks earlier than the start, the shift crossed midnight: add 24 hours to the end, then subtract.
The method, step by step
Elapsed time is just subtraction — the only catch is that minutes roll over at 60, not at 100. Work through these six steps in order and the answer comes out right every time.
- Put both times on the 24-hour clock. Add 12 to any PM hour: 5:20 PM becomes
17:20. Noon is 12:00, midnight is 00:00, and AM times stay as they are. - Check for midnight. If the end time is earlier than the start, add 24 hours to the end time before you subtract.
- Subtract the minutes. If the end minutes are smaller, borrow: drop the end hour by 1 and add 60 to its minutes.
- Subtract the hours. Combine with the minutes for the elapsed time in
H:MM. - Take off unpaid breaks. Elapsed time isn't always paid time — remove any unpaid lunch.
- Convert to decimal if payroll asks for it. Divide the minutes by 60.
What does a clean subtraction look like?
Start with a shift where nothing awkward happens: 9:15 → 17:45.
Minutes first: 45 − 15 = 30. Then hours: 17 − 9 = 8. The answer is 8:30 — 8 hours and 30 minutes. Crossing noon needs no special handling at all, as long as both times are on the 24-hour clock. That's the whole reason to convert first: 9:15 AM to 5:45 PM looks like it needs a trick, and 9:15 → 17:45 plainly doesn't.
What if the minutes don't subtract cleanly?
Take 8:45 AM → 5:20 PM, which is 8:45 → 17:20 on the 24-hour clock. The end minutes (20) are smaller than the start minutes (45), so you borrow.
Borrow one hour from the end time: 17:20 becomes 16 hours and 80 minutes. Now subtract normally: 80 − 45 = 35 minutes, and 16 − 8 = 8 hours. The answer is 8:35.
Sanity-check it the long way: 8:45 to 17:45 would be a flat 9 hours, and you're stopping 25 minutes early, so 9:00 − 0:25 = 8:35. Both routes agree.
How do I calculate hours across midnight?
Overnight shifts break plain subtraction, because the clock-out number is smaller than the clock-in number. Subtracting directly would give you a negative answer. The fix is to add 24 hours to the end time first.
Take a 21:45 → 06:15 shift. Since 06:15 is earlier than 21:45, add 24 hours: 06:15 + 24:00 = 30:15. Now subtract: minutes are fine (15 − 45 needs a borrow, so 30:15 becomes 29 hours 75 minutes), giving 75 − 45 = 30 minutes and 29 − 21 = 8 hours. The shift is 8:30.
Check it by splitting at midnight: 21:45 to 24:00 is 2:15, and 00:00 to 06:15 is 6:15. 2:15 + 6:15 = 8:30. Same answer. There's no 24-hour cap here — you're measuring elapsed time, so a 30-hour stretch is a perfectly valid total.
Worked examples you can check against
Every row below is a real shift shape, with the elapsed time in H:MM and the same value in decimal hours.
| Start → End | 24-hour | Elapsed | Decimal |
|---|---|---|---|
| 9:15 AM → 5:45 PM | 9:15 → 17:45 | 8:30 | 8.50 |
| 8:45 AM → 5:20 PM | 8:45 → 17:20 | 8:35 | 8.58 |
| 10:30 AM → 2:15 PM | 10:30 → 14:15 | 3:45 | 3.75 |
| 7:00 AM → 7:00 PM | 7:00 → 19:00 | 12:00 | 12.00 |
| 9:45 PM → 6:15 AM | 21:45 → 06:15 | 8:30 | 8.50 |
| 11:00 PM → 7:30 AM | 23:00 → 07:30 | 8:30 | 8.50 |
The 8:35 row is the one worth staring at. In decimal it's 35 ÷ 60 = 0.5833…, so 8.58 hours rounded — not 8.35. Mixing up those two is the single most common timesheet error.
The minutes-since-midnight shortcut
If borrowing across the hour is fiddly, convert both times to plain minutes, subtract, then convert back. Multiply the hour by 60 and add the minutes.
For 9:15 → 17:45: the start is 9 × 60 + 15 = 555 minutes, and the end is 17 × 60 + 45 = 1065 minutes. Subtract: 1065 − 555 = 510 minutes. Convert back by dividing by 60: 510 ÷ 60 = 8 remainder 30, so 8:30.
For overnight shifts, add 1440 (a full day in minutes) to the end value first. For 21:45 → 06:15: the end is 375 minutes, plus 1440 is 1815; the start is 1305. Then 1815 − 1305 = 510 minutes — 8:30 again, matching the borrowing method exactly.
Why does a regular calculator get this wrong?
Punch 17.45 − 9.15 into a phone calculator and you get 8.30, which looks correct — but only by luck, because those minute digits happened to subtract cleanly. Try the 8:45 AM to 5:20 PM shift: 17.20 − 8.45 = 8.75, which reads as 8 hours 45 minutes. The real answer is 8 hours 35 minutes. The calculator is doing base-10 arithmetic on a base-60 quantity.
You have two honest ways out: convert minutes to decimals before you calculate (divide by 60), or use something that understands H:MM natively. Our guide to decimal hours for payroll covers the conversion side in depth.
From elapsed time to paid hours
Elapsed time and paid time aren't the same thing. Subtract any unpaid break from the elapsed total: an 8:30 shift with a 30-minute unpaid lunch is 8:00 of paid time. Paid breaks stay in.
To get gross pay, convert to decimal and multiply by the rate. An 8:30 shift is 8.5 hours, and at $20 an hour that's 8.5 × 20 = $170.00. The 3:45 example is 3.75 hours, so at $24 an hour it's 3.75 × 24 = $90.00.
One note on overtime: in the US, non-exempt employees are generally owed a premium — usually time-and-a-half — for hours past 40 in a workweek, but the specifics depend on your state, your role, and how the workweek is defined. Calculate each day's hours the same way, then split the week into regular and overtime hours before applying rates. This is general US information, not legal or tax advice.
Let the app do the subtraction
Hours subtracts times in H:MM, handles overnight shifts and negative totals without complaint, flips to decimal in one tap, applies your hourly rate, and exports to CSV or PDF. Free, offline, no ads, no sign-in.
Frequently asked questions
How do you calculate the hours between two times?
Put both times on the 24-hour clock and subtract the start from the end, minutes first. If the end minutes are smaller, borrow an hour by adding 60 to them and reducing the end hour by one. From 9:15 to 17:45 is 8:30, because 45 − 15 = 30 and 17 − 9 = 8.
How do I calculate hours across midnight?
If the end time is earlier than the start time, the shift crossed midnight. Add 24 hours to the end time, then subtract. A 21:45 to 06:15 shift becomes 30:15 − 21:45 = 8:30.
Why does my calculator give the wrong answer for time?
A standard calculator treats 8:30 as 8.30 and works in tens, but time rolls over at 60. For 8:45 AM to 5:20 PM it returns 8.75, implying 8 hours 45 minutes — the real answer is 8:35. Convert minutes to decimals first, or use a calculator built for H:MM.
How many hours is 9 to 5?
From 9:00 AM to 5:00 PM is 8 hours elapsed. With an unpaid 30-minute lunch it's 7:30 of paid time; with a full hour it's 7:00.