Hours Between Two Times Calculator
Enter a start time and an end time to find the exact duration between them in hours and minutes, decimal hours, and a full hours-minutes-seconds breakdown. Overnight shifts (e.g. 10 PM to 6 AM) are handled automatically. You can also subtract a break or lunch period to get net working hours. Results update as you type.
How to calculate hours between two times
The core formula is simple: subtract the start time from the end time. The safest way to do this is to convert both times into minutes since midnight (hours x 60 + minutes), subtract, and then divide by 60 to get decimal hours. For example, a shift from 9:00 to 17:30 is (17 x 60 + 30) - (9 x 60 + 0) = 1050 - 540 = 510 minutes = 8.5 hours. If you also have a 30-minute lunch break, you subtract 30 more minutes, leaving 480 minutes = 8.0 hours net. This calculator performs all those steps for you automatically and displays the result in multiple formats.
Handling overnight shifts
When a shift spans midnight - for example, a nurse working 22:00 to 06:00 - a naive subtraction gives a negative number. The correct approach is to add 24 hours (1440 minutes) to the end time when the end time is earlier than the start time. So 06:00 becomes 30:00 in the calculation: (30 x 60) - (22 x 60) = 1800 - 1320 = 480 minutes = 8 hours. This calculator detects overnight shifts automatically and applies the adjustment without any extra input from you.
Why decimal hours matter for payroll and billing
Many payroll systems and billing platforms expect time in decimal hours rather than hours and minutes. 8 hours 30 minutes is NOT 8.30 hours; it is 8.50 hours. The confusion arises because minutes are out of 60, not out of 100. To convert: decimal hours = total minutes / 60. So 8 hours 45 minutes = 525 minutes / 60 = 8.75 hours. This calculator always shows both the hours-and-minutes representation and the exact decimal, so you can paste the right number directly into your time-tracking or invoicing software.
Break deductions and net working time
Labour laws in most countries require employees to take unpaid rest breaks during long shifts. The standard in many jurisdictions is a 30-minute unpaid break for shifts over 6 hours. When calculating pay, you must subtract unpaid break time from the gross shift duration to find the net paid hours. This calculator accepts a break duration in minutes and deducts it automatically. If your break is paid (as is the case for some contracts), simply leave the break field at 0 and use the gross hours figure instead.
Common shift durations at a glance
| Shift type | Clock hours (example) | Gross hours | Decimal hours |
|---|---|---|---|
| Half day | 9:00 - 13:00 | 4 h 0 min | 4.00 |
| Standard day (no break) | 9:00 - 17:00 | 8 h 0 min | 8.00 |
| Standard day (30 min break) | 9:00 - 17:00 | 7 h 30 min | 7.50 |
| Standard day (60 min break) | 9:00 - 17:00 | 7 h 0 min | 7.00 |
| Night shift (8 h) | 22:00 - 06:00 | 8 h 0 min | 8.00 |
| Extended shift | 7:00 - 19:00 | 12 h 0 min | 12.00 |
| On-call 24 h | 00:00 - 00:00 | 24 h 0 min | 24.00 |
Typical shifts and their decimal-hour equivalents for payroll and scheduling.
Frequently asked questions
How do I calculate hours between two times manually?
Convert both times to minutes since midnight: multiply the hour by 60 and add the minutes. Then subtract the start total from the end total. If the result is negative, add 1440 (24 hours in minutes) for an overnight shift. Finally, divide by 60 to get decimal hours, or express the remainder as hours and minutes. For example, 8:15 to 16:45 is (16x60+45) - (8x60+15) = 1005 - 495 = 510 minutes = 8 hours 30 minutes = 8.50 decimal hours.
Does this calculator handle overnight shifts?
Yes. If the end time you enter is earlier than the start time, the calculator automatically treats it as an overnight shift crossing midnight and adds 24 hours to the end time for the calculation. For example, entering 22:00 to 06:00 gives 8 hours, not a negative number.
What is the difference between decimal hours and hours-and-minutes?
Hours-and-minutes is the clock format you are used to: 8:30 means 8 hours and 30 minutes. Decimal hours expresses the same duration as a single number: 30 minutes is half an hour, so 8 hours 30 minutes = 8.5 decimal hours. The mistake people commonly make is writing 8 hours 30 minutes as 8.30, which actually means 8 hours and 18 minutes (0.30 x 60 = 18). Payroll software expects decimal hours, so always divide the minutes by 60 to convert.
How do I account for a lunch break?
Enter the total unpaid break time in minutes in the "Break / lunch" field. The calculator subtracts it from the gross elapsed time to give you the net working hours. If you worked 9:00 to 17:30 with a 45-minute unpaid lunch, the gross time is 8.5 hours and the net paid time is 8.5 - 0.75 = 7.75 hours (7 hours 45 minutes).
Can I use this calculator for billing clients?
Absolutely. Use the decimal hours output directly in your billing formula: invoiced amount = hourly rate x decimal hours. For example, 2 hours 15 minutes is 2.25 decimal hours, so at $80 per hour that is 2.25 x 80 = $180. The four-decimal precision shown is more than enough for accurate billing even on very short tasks.
What if my shift is exactly 24 hours?
If start and end times are the same (for example, 08:00 to 08:00), the calculator returns 24 hours, treating it as a full day. If you actually worked 0 hours at the same start and end time, simply check the result and set it to 0 manually, since there is no way to distinguish "just started" from "just finished a 24-hour period" from time inputs alone.
How many seconds are in a work shift?
Multiply the net hours by 3600 (seconds per hour). An 8-hour shift has 8 x 3600 = 28,800 seconds. The calculator shows the seconds figure in the steps panel so you never have to do that conversion yourself.