ThisCalculator

Date and time

No of Hours Calculator: How It Works & How to Use

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

No of Hours Calculator: How It Works & How to Use

This calculator works out the number of hours between two points in time, or the total hours from a start time plus a duration. You enter a start time and an end time (or a start time and a number of hours/minutes), and it returns the elapsed time in hours, with minutes shown as a decimal. It also shows the result as a clock time when you add hours to a start time.

Formula

The calculator converts the times you enter into minutes past midnight, subtracts the start from the end, and then converts back to hours.

Let:

  • start = start time in minutes after midnight (e.g., 9:00 AM = 540)
  • end = end time in minutes after midnight (e.g., 5:30 PM = 1050)

Then:

Elapsed hours = (end − start) / 60

For example, 1050 − 540 = 510 minutes, and 510 / 60 = 8.5 hours.

Worked Example

Using the default values from the calculator: start = 09:00, end = 17:30.

  1. Convert 09:00 to minutes: 9 × 60 = 540
  2. Convert 17:30 to minutes: 17 × 60 + 30 = 1050
  3. Subtract: 1050 − 540 = 510 minutes
  4. Divide by 60: 510 / 60 = 8.5 hours

The calculator shows 8.50 hours (and 510 minutes).

What This Calculator Is For

People use this type of calculator for many everyday tasks:

  • Calculating work hours for timesheets or payroll (e.g., 9 AM to 5 PM = 8 hours).
  • Finding how long a meeting or event lasted.
  • Figuring out travel time between two clock times.
  • Adding a duration (like 1.5 hours) to a start time to get an end time.

The result in hours is often expressed as a decimal (e.g., 8.5 hours) rather than 8 hours 30 minutes. Many payroll systems use decimal hours, so this is directly useful.

How to Read the Result

The main output is the elapsed time in hours, with two decimal places. For example:

  • 8.50 hours = 8 hours and 30 minutes (0.50 × 60 = 30 min)
  • 7.25 hours = 7 hours and 15 minutes
  • 9.75 hours = 9 hours and 45 minutes

The second output shows the total minutes, which is helpful if you need to report in minutes rather than hours.

Common Mistakes and How to Avoid Them

One frequent error is mixing 12-hour and 24-hour times. If you enter 5:30 thinking it’s PM but the calculator treats it as AM, you’ll get a negative result. Always use 24-hour format or clearly indicate AM/PM.

Another mistake is forgetting that times are not decimal. 1.5 hours is 1 hour 30 minutes, but 1.50 as a time (1:50) is 1 hour 50 minutes. The calculator avoids this by working in minutes, but when you do it manually, be careful.

If the end time is earlier than the start time (e.g., you start at 10 PM and end at 2 AM), the calculator will give a negative number. That’s a sign you need to add 24 hours to the end time for overnight shifts.

Limitations of the Formula

This simple subtraction works for any two times on the same day. It does not automatically handle:

  • Crossing midnight (you must add 24 hours to the end time).
  • Daylight saving time changes (the formula ignores them).
  • Time zones (it assumes both times are in the same zone).

For overnight shifts, a common workaround is to add 24 hours to the end time if it is smaller than the start. For example, 10 PM (1320 min) to 2 AM (120 min) becomes (120 + 1440 − 1320) / 60 = 4 hours.

Frequently Asked Questions

How do I calculate hours between two times?

Convert both times to minutes past midnight, subtract the start from the end, then divide by 60. For example, 9:15 AM to 2:45 PM: 9:15 = 555 min, 2:45 = 885 min, difference = 330 min, which is 5.5 hours.

What if the end time is before the start time?

That usually means the shift crosses midnight. Add 24 hours (1440 minutes) to the end time before subtracting. For example, 11 PM to 1 AM: (60 + 1440 − 1380) / 60 = 2 hours.

How do I convert hours and minutes to decimal hours?

Divide the minutes by 60 and add to the hours. For 8 hours and 45 minutes: 45 / 60 = 0.75, so 8.75 hours. This is the format most payroll systems use.

Can this calculator handle lunch breaks?

No, it only gives the raw time between two clock times. To get paid work hours, subtract the break duration. For example, if your shift is 9 AM to 5 PM (8 hours) and you take a 30-minute lunch, paid hours = 7.5.

Is there a difference between elapsed time and duration?

No, they are the same. Elapsed time is the amount of time that passes from a start to an end. Duration is the length of that interval. Both are measured in hours, minutes, and seconds.

Related

Formula used
in start | Start time (HH:MM) | - | 09:00 | 0
in end | End time (HH:MM) | - | 17:30 | 0
out hours | Hours between | hours | (end - start) / 60 | 2
out minutes | Minutes between | minutes | end - start | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.