Skip to content
Other

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.

Your details

Enter the start time in HH:MM (24-hour) format, e.g. 09:00 for 9 AM or 21:30 for 9:30 PM.
Enter the end time. If it is earlier than the start time, an overnight shift is assumed.
Total unpaid break time in minutes. Set to 0 if there is no break.
min
Net hours (decimal)Standard shift
8

Total working time after break deduction, in decimal hours (ready for payroll or billing).

Net duration8 h
Gross hours (decimal)8.5
Gross duration8 h 30 min
Break deducted30 min
Net minutes480
Net seconds28,800
Overnight shiftNo
8 h
  • 4 h
  • 8 h
  • 10 h
  • 12 h

8 h of net working time (8.00 decimal hours).

  • Your net working time is 8 h, or 8.0000 decimal hours.
  • A 30 min break reduces the gross time of 8.50 h down to 8.00 h.
  • As a fraction of a standard 40-hour week, this shift represents 20.0% of a full week.

Next stepUse the decimal hours figure directly in payroll software or billing systems for the most accurate results.

Hourly breakdown (net working time)

SegmentClock rangeDurationRunning total
Hour 109:00 - 10:001.00 h1.00 h
Hour 210:00 - 11:001.00 h2.00 h
Hour 311:00 - 12:001.00 h3.00 h
Hour 412:00 - 13:001.00 h4.00 h
Hour 513:00 - 14:001.00 h5.00 h
Hour 614:00 - 15:001.00 h6.00 h
Hour 715:00 - 16:001.00 h7.00 h
Hour 816:00 - 17:001.00 h8.00 h

Total net time: 8 h (8.0000 decimal hours). Break of 30 min has been excluded.

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 typeClock hours (example)Gross hoursDecimal hours
Half day9:00 - 13:004 h 0 min4.00
Standard day (no break)9:00 - 17:008 h 0 min8.00
Standard day (30 min break)9:00 - 17:007 h 30 min7.50
Standard day (60 min break)9:00 - 17:007 h 0 min7.00
Night shift (8 h)22:00 - 06:008 h 0 min8.00
Extended shift7:00 - 19:0012 h 0 min12.00
On-call 24 h00:00 - 00:0024 h 0 min24.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.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…